1, installation Pclint
A. Download the cracked version of the pclint9i version from http://download.csdn.net/detail/finewind/8426979;
B. Click Pclint9setuo.exe to install the Pclint to C:\lint (or another location);
C. Copy the content under the patch to C:\lint, 32-bit system performs the patch.bat,64-bit system execution patch64.bat;
D. After you finish executing the bat in C, you can delete the files copied from C.
2. Configure individual file check items
A. Create a new check folder under C:\lint;
B. Create a new file named Include.lnt under C:\lint\check and enter the following:
[CPP]View Plaincopy
- -ic:/lint
- -ic:/lint/lnt
- -ic:/"program Files"/"Microsoft Visual Studio 12.0"/vc/include
- -ic:/"program Files"/"Microsoft Visual Studio 12.0"/vc/atlmfc/include
- -ic:/"program Files"/"Microsoft Visual Studio 12.0"/vc/include
(This file contains the file path, the path of the remaining LNT file and the path of the system header file, can be added and modified according to the actual)
C. Create a new file named Std.lnt under C:\lint\check and enter the following:
[CPP]View Plaincopy
- -ic:\lint\lnt
- C:\lint\lnt\lib-w32.lnt
- C:\lint\lnt\co-msc90.lnt
- C:\lint\lnt\env-vc9.lnt
- -si4-sp4
(This file contains the basic LNT files required by vs2013 and some standard options, which can be added and modified according to the actual)
D. Create a new file named Option.lnt under C:\lint\check and enter the following:
[CPP]View Plaincopy
- -wlib (0)
- -e714 //function not use
- -e715
- -e522
- -e534
- -e830
(This file contains special options related to the project and can be modified according to the specific project)
E. Create a new File_chk.bat file under C:\lint\check and enter the following:
[CPP]View Plaincopy
- C:\lint\lint-nt.exe-ic:\lint\check include.lnt std.lnt option.lnt%1%2%3%4%5%6%7%8%9
F. Open VS2013, click Tools--External tools, click the Add button in the popup dialog box, and enter the following in each input box:
Title: Pclint File CHK
Command: C:\lint\check\file_chk.bat
Parameter: "$ (itemdir) $ (itemfilename) $ (itemext)"
Initial directory: $ (ITEMDIR)
Select the tick before using the Output window, then click Confirm to finish.
After that, a menu named Pclint file Chk will appear in the tool drop-down menu, and the current file can be pclint checked by clicking this bar.
3. Configure the entire project check
Note that 3 relies on several LNT files created by 2, so you need to complete 2 first.
A. Create a new file named Proj.bat under C:\lint\check and enter the following:
[CPP]View Plaincopy
- Echo >.\_file.lnt
- C:\lint\lint-nt.exe +linebuf%1 >. \_file.lnt
- C:\lint\lint-nt.exe-ic:\lint\check include.lnt std.lnt option.lnt. \_file.lnt
- del/f/Q. \_file.lnt
B. Open VS2013, click Tools--External tools, click the Add button in the popup dialog box, and enter the following in each input box:
Title: Pclint Prj CHK
Command: C:\lint\check\proj.bat
Parameters: $ (ProjectDir) $ (projectfilename)
Initial directory: $ (ProjectDir)
Select the tick before using the Output window, then click Confirm to finish.
After that, a menu named Pclint Prj chk will appear in the tool drop-down menu, and the current project can be pclint checked by clicking on this bar.
Note: You need to complete the INCLUDE.LNT header file according to the actual project, otherwise you may be unable to find the head file and error.
references:http://blog.csdn.net/zhangcunli/article/details/6842518
Configuration of the Pclint in VS2013