sourceinsight搭建pclint工程,自定义命令如下:"C:\lint\lint-nt.exe" -u -ic:\lint std %f
lint测试代码如下:
#include <stdio.h>
//#include <sys/times.h>
int main(int argc, char * argv)
{
int i;
int j = i + 3;
return 0;
}
去掉#include <stdio.h>可以lint成功,加上时报错:
# error "You need a ISO C conforming compiler to use the glibc headers"
y:\usr\include\sys\cdefs.h 32 Error 309: # error "You need a ISO C conforming
compiler to use the glibc headers"
此处的代码为:
#if defined __GNUC__ && !defined __STDC__
# error "You need a ISO C conforming compiler to use the glibc headers"
#endif
std.lnt内容如下:
-i"c:\lint\lnt"
//lnt\co-msc60.lnt
co-gcc.lnt
options.lnt -si4 -sl8 -sp8
include.lnt
co-gcc.lnt里包含了co-gcc.h文件,该文件包含了lint-cmac.h,该头文件中定义了
#define __GNUC__ 4
#define __STDC__ 1
不知怎么 !defined __STDC__未生效,通过-D定义__STDC__ 及在文件开头定义的方法多次尝试都无效,请知道的高手指教,谢谢。