PC-lint9 集成至vs2008及配置

Setp 1:运行config.exe对std.lnt进行配置时,勾上对VS2008的支持,这里不在赘述,网上关于此的文章非常多。
Setp 2:打开vs 2008,点击Tools->External Tools



STEP 3 : 选择ADD,输入如下内容:


Title : 随便起个,方便记忆
command: 输入你lint的路径
arguments: -i"c:\lint" std.lnt env-vc9.lnt "$(ItemDir)$(ItemFileName)$(ItemExt)"
initial director:$(ItemDir)

这样 PClint就在VS2008里配置完毕了。
写个程序验证下吧:
#include <stdio.h>

int main()
{
     int a;

     printf("a = %d\n", a);
     return 0;
}

点击tool- >pclint ,结果如下:

--- Module:   C:\Documents and Settings\XX\Desktop\1234.cpp (C++)
 printf("a = %d\n", a);
C:\Documents and Settings\XX\Desktop\1234.cpp(11): error 530: (Warning -- Symbol 'a' (line 9) not initialized --- Eff. C++ 3rd Ed. item 4)
C:\Documents and Settings\XX\Desktop\1234.cpp(9): error 830: (Info -- Location cited in prior message)
C:\Documents and Settings\XXu\Desktop\1234.cpp(15): error 783: (Info -- Line does not end with new-line)
C:\Documents and Settings\XX\Desktop\1234.cpp(15): error 953: (Note -- Variable 'a' (line 9) could be declared as const --- Eff. C++ 3rd Ed. item 3)
C:\Documents and Settings\XX\Desktop\1234.cpp(9): error 830: (Info -- Location cited in prior message)




 error 900: (Note -- Successful completion, 6 messages produced)

你可能感兴趣的:(PC-lint9 集成至vs2008及配置)