有没有办法停止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.)
阅读夹板常见问题解答14后,我尝试消除非标准关键字:
% 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
是一个强大的工具,但它几乎需要注释它解析的每一个代码。我错了吗?