Therefore, if the sky falls into the ranks of the people of Sri Lanka, we must first suffer from their own aspirations, work out their bones and muscles, starve their bodies, empty their bodies, and do whatever they do, so they are willing to gain what they cannot.
Mencius
1 Guide
I have heard from Han today. After ten years of hard work, we can see that the people around us are greedy and comfortable, and there is no dedicated talent, which is disappointing. It can be said that over the past few years, I have also hoped that my friends around me can use my strength to work together to create some "Miracles", but every time I am disappointed, still disappointed.
Although people have said before that there is no exclusive person in this era. However, it is too difficult to find a like-minded person. In addition, it is difficult to find like-minded people without a common goal. Therefore, it is better to be a dedicated person in silence during this period, saving some troubles.
However, you cannot lose confidence in yourself because of others. My limited ability is correct. My dad told me from an early age that I want to know how many dry meals I can eat. As Mencius said, since he knows his abilities, he is willing to learn and improve his abilities.
Therefore, although I can understand this kind of mood, forgive me for failing to agree with the results with limited capabilities.
Take copper for identification, you can wear the clothing crown; take the ancient for identification, we can know the Xing Ti; people for identification, you can understand the gains and losses. Every employee conference has a lot of GAINS. It is a sense of listening to your speech and winning over 10 years of reading books. Mr. Han thinks that the so-called C ++ 10 thousand hours is far from enough. Assuming that the average daily work and study for ten hours takes one thousand days, which is about three years. Since my internship in July, I have been practicing for about two and a half years. I keep reading, studying, and working every day, but I feel that C ++ is profound, it will take two and a half years to become proficient. Maybe two and a half years later, I think it will take another five years. Well, it is a great time to forget everything.
Now, start with today's topic, pclint. Consciously, this part can be divided into at least two articles. If you want to explain it in depth, it is enough to cover objective C ++. more than tive C ++ and other books, so I will only introduce usage. If you want to know more, Google it!
The first part describes the functions of pclint and how to install it. The second part explains how to use pclint. (for the time being, this plan may lead to an unexpected idea. For the third part, the fourth part. Please stay tuned ).
2 pclint Introduction
First, provide the relevant links of pclint:
Official Website: http://www.gimpel.com/html/index.htm
Latest 9.0l installation package: http://download.csdn.net/detail/winking324/8102281
Next, let's briefly introduce what kind of tool pclint is.
Pclint is a static analysis tool for C/C ++ software code developed by gimpelsoftware. It can be said that pclint is a more rigorous compiler. It is mainly divided into pclint and flexelint. pclint is mainly used on Windows platform and provided as binary executable files. flexelint is applied to other platforms, such as Linux, and released as source code.
Pclint has a wide range of customers around the world. Many large software R & D organizations use pclint check as the first process of code lookup. For example, Huawei (thanks to Huawei, let me learn such a powerful tool ). Pclint not only performs global analysis on the program, but also identifies array subscripts that are not properly tested, reports uninitialized variables, and warns of the use of null pointers along with redundant code, it can also effectively improve the space utilization and running efficiency of many programs.
To sum up, pclint does not analyze the code by executing programs and discovers potential bugs in the code. In my personal practice, pclint can discover about 80% of non-logical bugs, it is definitely a powerful assistant for C ++ developers and testers (Mom and Dad no longer have to worry about writing wrong code ).
Since pclint is so powerful, the problem arises.
3 pclint installation and preliminary configuration
The installation is based on the latest 9.0l installation package. The package is updated on July 15, October 16, 2014. I package the package myself and add an automatic update script to facilitate one step of operation (resources are charged at 1 point. Thank you, if you do not have a score for downloading, please leave a message to your mailbox ).
The installation package mainly contains the following two parts (forgive me for my small advertisement, please support 2345.com ):
The first updateis the upgrade package, and the second gimpel_pc_lint_9.zip is the pclint installation package.
1. decompress the pclint installation package and install the package. Click next to the last step, select execute the configuration program, and click Finish. If no configuration program is selected, You can execute config.exe in the installation directory to execute the configuration program.
2. The pclint configuration program will pop up and click Next to start configuration.
3. After the pclint configuration is executed, the execution script and the pclint configuration file (*. LNT) will be generated and the next step will continue.
4. Select the generation path, installation path, and file name, and then click Next.
5. Select the compiler. Currently, Visual Studio has a maximum value of 2008, so you have to select this option. Then click Next.
6. Select the platform and select the corresponding platform as needed. Here, select 32bit and click Next.
7. select the dependent library. for Visual Studio development, it mainly includes four parts: Active Template Library (ATL), Microsoft foundationclass library, standard template library, and Windows 32-bit. Then, click Next.
8. Select some special optimization suggestions, such as code security and efficiency. Select Scott Meyers (valid C ++ more effective C ++ and valid C ++ 3 rdedition), Dan Saks, Misra 2004, next step (PS: Objective C ++, these two major works are really awesome, and C ++ must read the classics as a beginner ).
9. Specify the position of the header file of the currently used library, select create-I options, and next. Otherwise, the execution of pclint fails because the header file cannot be found.
10. Select the header file path and use a semicolon or line break (CTRL + enter). Only the standard header file of Visual Studio is added here. Because different companies or organizations may have different file organization methods or contain different libraries, you can add them here or encounter an error when executing pclint, modify *. add the LNT file.
11. The system prompts whether to enable the new configuration. Select No.
12. create options. the LNT file is a few simple issues. Because the content displayed here is incomplete, select "no" and next. If the display is complete, you can take a look at the instance Code separately, select one.
13. Select the corresponding development environment. The maximum value here is vc9, so select this one.
14. Add the pclint to the system environment variable.
15. After a long configuration setup, it was finally completed.
4. pclint update
After the complex installation and configuration above, We need to update the pclint program to support more C ++ check items.
1. Extract all files in the update directory of the compressed package to the pclint installation path. For example, if my pclint is installed on disk D, the corresponding file path should be:
D: \ lint \ l9-a-b.lp
...
D: \ lint \ lpatch.exe
D: \ lint \ update. bat
2. Double-click Update. BAT to update the pclint.
The last line. The version number must be 9.00l. If not, check whether the path or file is correct.
Skip-v. License l9-a-b.lp.
5. Further consideration
It's a pity that it's not a weekend or a Friday. You can't finish it in one breath. If you are familiar with the installation and upgrade methods, you can use Google to check the C ++ code or the pclint manual, you can definitely see a big rise and learn a lot of notes in C ++ programming. If you can write a code that does not even contain a warning or error, congratulations! You have become a cool person in C ++!
Yesterday I saw a good sentence. When I started it, it was gold, and when I tried it, it was water. When I read the book, it was knowledge, and when I did not read it, it was waste paper. If I tried my best, it was a dream, it's just a delusion to give up. If you give up, you will surely get nothing.
Think of what lI ke shared, the most important thing for product personnel is curiosity. What I want to say is that the most important thing for developers is to try it! Right, right, right, and wrong, but it's a hello World!
Software Quality path: One of pclint