【问题标题】:Splint static analyser: not finding splint.rc configuration file (Windows)Splint 静态分析:找不到 splint.rc 配置文件(Windows)
【发布时间】:2014-02-23 13:09:30
【问题描述】:

根据Splint FAQ

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

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

  • 步骤 1:将splint-3.1.1.win32.zip 提取到c:\splint
  • 第二步:在c:\test\test.c 中放一个简单的程序:

    空主(空){ }

  • 第 3 步:运行“cmd”

  • 第四步:输入命令:cd c:\test\

然后我尝试使用夹板,没有夹板.rc,也没有标志

  • 第五步:输入命令`c:\splint\bin\splint.exe test.c'

正如预期的那样,这会产生输出The function main does not output the expected type

然后我尝试使用夹板,没有夹板.rc,和-maintype标志

  • 第五步:输入命令`c:\splint\bin\splint.exe test.c -maintype'

正如预期的那样,输出不再产生The function main does not output the expected type

然后我尝试使用夹板,带有 splint.rc,其中是 -maintype 标志

  • 第五步:在c:\test\splint.rc我把内容-maintype
  • 第五步:输入命令`c:\splint\bin\splint.exe test.c'

因为我在splint.rc 中输入了-maintype,并且因为我正在从包含splint.rc 的目录中运行夹板命令,所以夹板不应该出现关于主功能的警告,但它做。我猜 slint 没有获取 splint.rc 配置文件。

我做错了什么? 谢谢

【问题讨论】:

    标签: c windows cmd splint


    【解决方案1】:

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

    c:\splint\bin\splint.exe test.c -f splint.rc
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-07
      • 2017-12-24
      • 1970-01-01
      • 2021-07-02
      • 2021-08-27
      • 2014-11-10
      • 2011-08-26
      相关资源
      最近更新 更多