轉載:http://blog.yesky.com/340/xioxu/165340.shtml
PC-LINT配置使用說明
0、在http://unxutils.sourceforge.net下載win32下的tools
1、將udfserver/share/tools/unix目錄copy to C:/
2、在"我的電腦"右擊mouse選"進階"之"環境變數"之"系統變數",選"Path"
並加入"C:/unix/usr/local/wbin/;"在路徑表項中,重啟生效。
3、在VC中整合(針對單個檔案):
A 點擊Tools/Customize/Tools出現定製視窗
B 在Menu contents中雙擊空白攔,輸入:pclint
C 雙擊pclint項,在Command:中填入:pclint
Arguments:中填入:-i"C:/unix/usr" -u std.lnt env-vc6.lnt "$(FilePath)"
選中"Use Output Window"
D 開啟一個項目,讓焦點位於Source Window中,點擊Tools/pclint菜單即可
4、在VC中整合(針對項目中的多個檔案):
A 點擊Tools/Customize/Tools出現定製視窗
B 在Menu contents中雙擊空白攔,輸入:pclint-project
C 雙擊pclint項,在Command:中填入:find
Arguments:中填入:$(FileDir) -name *.c | xargs pclint -i"c:/unix/usr" -u
std.lnt env-vc6.lnt
選中"Use Output Window"
D 開啟一個項目,讓焦點位於最項層目前的一個Source Window中,點擊Tools/pclint-
project菜單即可
5、命令列中針對項目所有檔案的pclint:
開啟command,輸入pclint-prj <項目路徑> <輸出檔案>即可
6、增加自訂的include path方法:
在include-path.lnt中按格式加入自已的include path即可。
7、在Source Insight中的整合:
A 點擊Options/Custom Commands出現定製視窗
B 點擊"Add"
C 在New Command Name中輸入:pclint
D 在Run中輸入:pclint -i"C:/unix/usr" -u std.lnt env-vc6.lnt %f
E 在Pattern中輸入:^/([a-zA-Z].*/)(/([0-9][0-9]*/)).*
F 選中"Iconic Window"及"Capture Output"及"Parse Links in Output"及"File,Then
Line",其餘不選
E 點擊"Menu"
F 選取Cmmand List中的"Custom Cmd: pc-lint"項,Menu中選"View",點"<End of Menu
>"後點擊"Insert",
然後點擊"OK"退出即可
8、在Source Insight中整合(針對多個檔案)
A、與7類似
B、7.D中輸入變為:find %d -name *.c | xargs pclint -i"c:/unix/usr" -u std.
lnt env-vc6.lnt
C、7.C中的輸入變為:pclint-project