PClint配置

建一个proj.bat批处理文件, 文件内容如下:

d:/pclint/lint-nt.exe -id:/pclint/check include.lnt  std.lnt option.lnt files.lnt %1 %2 %3 %4 %5 %6 %7 %8 %9

{假设pclint存放在d:盘根目录下, include.lnt std.lnt option.lnt files.lnt 都在d:/pclint/check目录下}

 include.lnt文件的内容:

-id:/pclint
-id:/pclint/lnt
-iC:/"Program Files"/vc8/vc/include
-iC:/"Program Files"/vc8/vc/atlmfc/include
//-iC:/"Program Files"/vc8/vc/PlatformSDK/include/prerelease
-iC:/"Program Files"/vc8/vc/PlatformSDK/include
-iD:/MSYS/1.0/src/Torque/SDK/engine
-iD:/MSYS/1.0/src/Torque/SDK/lib/openal/win32
-iD:/MSYS/1.0/third_party

std.lnt文件内容如下:

//c:/pclint/lnt/co-cb.lnt // 编译器相关选项
//c:/pclint/lnt/env-cb.lnt // 开发环境相关选项
//c:/pclint/lnt/lib-atl.lnt
//c:/pclint/lnt/lib-owl5.lnt
//c:/pclint/lnt/lib-stl.lnt
//c:/pclint/lnt/lib-w32.lnt
//c:/pclint/lnt/lib-win.lnt
//c:/pclint/lnt/lib-wnt.lnt // 使用库的选项
////c:/pclint/lnt/au-sm123.lnt
//c:/pclint/lnt/au-ds.lnt
////c:/pclint/lnt/au-misra2.lnt // 作家推荐选项

d:/pclint/lnt/au-sm.lnt
d:/pclint/lnt/au-ds.lnt
d:/pclint/lnt/co-msc71.lnt
d:/pclint/lnt/env-vc7.lnt
d:/pclint/lnt/lib-mfc.lnt
d:/pclint/lnt/lib-stl.lnt
d:/pclint/lnt/lib-w32.lnt
d:/pclint/lnt/lib-wnt.lnt
d:/pclint/lnt/lib-atl.lnt
//c:/pclint/lnt/options.lnt
-si4 -sp4

//-d_FLAT_ -u_SMALL_ -si4 -sp4 // 其他一些选项,可以查阅帮助文档

option.lnt文件内容如下:

//-e720 // allow direct test of assignment
//-e502 -e713 -e737 -eau // don't report on signed/unsigned mismatches
//-e734 // allow sub-integer loss of information
//-e701 -e703 // shifting int left is OK
//-e718 // allow calls to undeclared C functions
//-e746 // allow calls w/o prototypes in C.
-wlib(0)   //忽略库文件


-e715
-e522
-e534       //避免未使用函数返回值的警告
-e830

files.lnt文件内容如下:(也就是项目里所有CPP文件的绝对路径), 比方:

d:/MSYS/1.0/src/Torque/SDK/engine/ext/check/dll.cpp
d:/MSYS/1.0/src/Torque/SDK/engine/ext/check/Majon.cpp
d:/MSYS/1.0/src/Torque/SDK/engine/ext/check/stdafx.cpp
d:/MSYS/1.0/src/Torque/SDK/engine/ext/check/test_console/test.cpp
d:/MSYS/1.0/src/Torque/SDK/engine/ext/check/test_console/test_console.cpp

你可能感兴趣的:(c++)