夹板:请勿检查系统头

时间:2017-01-10 22:43:41

标签: c static-analysis splint

有没有办法阻止splint分析包含的系统头文件,POSIX,libc等?我使用-warnposix -preproc

运行
% splint -warnposix -preproc my.c

/usr/include/unistd.h:220:8: Parse Error: Non-function declaration:
    __BEGIN_DECLS : int. (For help on parse errors, see splint -help
    parseerrors.)
*** Cannot continue.

更新

% splint +posixlib +unixlib -I/path/to/myheaders -I/usr/include/x86_64-linux-gnu my.c

/usr/include/asm-generic/int-ll64.h:19:24: Parse Error:
    Suspect missing struct or union keyword: __signed__ :
    int. (For help on parse errors, see splint -help parseerrors.)

阅读splint FAQ14后,我尝试删除非标准关键字:

% splint +posixlib +unixlib -D__signed__= -I/path/to/myheaders -I/usr/include/x86_64-linux-gnu my.c

/usr/include/x86_64-linux-gnu/sys/syslog.h:200:66: Parse Error:
    Inconsistent function parameter syntax: __gnuc_va_list :
    <any>. (For help on parse errors, see splint -help parseerrors.)
*** Cannot continue.

在此特定情况下,将__gnuc_va_list声明为非标准关键字并不起作用。我觉得splint是一个强大的工具,但它需要注释它解析的几乎所有代码。我错了吗?

0 个答案:

没有答案