【发布时间】:2013-03-05 09:30:56
【问题描述】:
我想在 debian 稳定环境中的一些源上运行 splint。
我需要给预处理器指令-DUINT16_T='unsigned short',因为我经常需要它。我想把它放在我的.splintrc 文件中。
从像splint -DUINT16_T='unsigned short' mysource.c 这样的命令行运行时,它运行良好。如果将此行移动到我的.splintrc 文件中
-DUINT16_T='unsigned short'
-I/usr/local/include/
splint 调用结果
Cannot list files in .splintrc files:
short' (probable missing + or -)
A flag is not recognized or used in an incorrect way (Use -badflag to inhibit
warning)
有人有解决办法吗? (请不要使用别名)。
为了进一步讨论,我将提供一个 mnwe(最小的不工作示例)hello.c,这可能会有所帮助:
#include <stdio.h>
int main (void)
{
UINT16_T returnvalue=0;
printf ("Hello, world!\n");
return returnvalue;
}
gcc -DUINT16_T='unsigned short' hello.c 命令运行良好——当然splint -DUINT16_T='unsigned short' hello.c 也运行良好
Return value type unsigned short int does not match declared type
int: returnvalue
但是,我怎样才能将这个 DEFINE 包含在我的 .splintrc 中?
【问题讨论】:
-
我需要同样的东西,除了标志:“-Dbit=unsigned char”
标签: debian whitespace preprocessor-directive splint secure-coding