gpt4 book ai didi

c - 夹板:for 循环中的解析错误

转载 作者:太空狗 更新时间:2023-10-29 15:39:16 27 4
gpt4 key购买 nike

我正在使用夹板作为 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 循环,我想知道是否有可用的补丁来解决这个问题。

最佳答案

既然还没有答案,我就直接引用维基百科关于splint的文章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 的(并且是有争议的首选样式),因此在修复此问题之前,您应该避免使用 splint。

关于c - 夹板:for 循环中的解析错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10257470/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com