0

根据夹板常见问题解答

对于 Win32,由于 DOS 文件名限制,Splint 会查找 splint.rc 而不是 .splintrc。它将首先在当前目录中查找,然后在您的主目录中查找。

我设置了一个非常简单的测试来尝试让 Splint 工作:

  • 第 1 步:提取splint-3.1.1.win32.zipc:\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'

因为我输入-maintypesplint.rc,并且因为我正在从其中包含的目录中运行 splint 命令,splint.rc所以 splint 不应该出现关于 main 函数的警告,但它确实出现了。我猜夹板没有拿起 splint.rc 配置文件。

我究竟做错了什么?谢谢

4

1 回答 1

0

与此同时,我通过使用 -f 标志来包含它来让它工作:

c:\splint\bin\splint.exe test.c -f splint.rc
于 2014-02-23T16:02:22.423 回答