c – splint:for循环中的解析错误

我使用夹板作为c99代码的静态分析器.

Splint似乎不太符合c99标准.因此我应用了这个补丁:
http://www.cs.virginia.edu/pipermail/splint-discuss/attachments/20080718/52cc25f6/attachment.obj

现在我没有得到任何解析错误,因为声明没有在顶部.

但是我仍然在for循环中得到解析错误,如果我在for语句中放入一个变量声明.
例如:

for(int i = 0; i < 10; i++)
{
}

解决方法是像这样写:

int i;
    for(i = 0; i < 10; i++){
    }

但是因为我不想调整所有的for循环,我想知道是否有可用的补丁解决了这个问题.

最佳答案 由于还没有答案,我只是引用关于夹板
article的维基百科文章

Recent development activity on Splint has slowed significantly.
According to the CVS at SourceForge, as of January 2009 the most
recent change in the repository was in August 2008. The whole year
2008 had only two write accesses to the repository. The maintainer has
said that development is stagnant and the project needs new
volunteers.

由于在循环头中声明变量符合C99(并且可以说是更好的样式),因此在修复之前应该克制夹板.

点赞