根据夹板常见问题解答:
对于 Win32,由于 DOS 文件名限制,Splint 会查找 splint.rc 而不是 .splintrc。它将首先在当前目录中查找,然后在您的主目录中查找。
我设置了一个非常简单的测试来尝试让 Splint 工作:
- 第 1 步:提取
splint-3.1.1.win32.zip
到c:\splint
第2步:输入
c:\test\test.c
一个简单的程序:无效的主要(无效){}
第三步:运行“cmd”
- 第四步:输入命令:
cd c:\test\
然后我尝试使用夹板,没有夹板.rc,没有标志
- 第 5 步:输入命令 `c:\splint\bin\splint.exe test.c'
正如预期的那样,这会产生输出The function main does not output the expected type
然后我尝试使用夹板,没有夹板.rc,和 -maintype 标志
- 第 5 步:输入命令 `c:\splint\bin\splint.exe test.c -maintype'
正如预期的那样,输出不再产生The function main does not output the expected type
.
然后我尝试使用带有 splint.rc 的夹板,其中包含 -maintype 标志
- 第5步:在
c:\test\splint.rc
我把内容-maintype
。 - 第 5 步:输入命令 `c:\splint\bin\splint.exe test.c'
因为我输入-maintype
了splint.rc
,并且因为我正在从其中包含的目录中运行 splint 命令,splint.rc
所以 splint 不应该出现关于 main 函数的警告,但它确实出现了。我猜夹板没有拿起 splint.rc 配置文件。
我究竟做错了什么?谢谢