Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

splint: parse error in for loop

I am using splint as static analyzer for c99 code.

Splint seems to be not quite c99 compliant. Thus I have applied this patch: http://www.cs.virginia.edu/pipermail/splint-discuss/attachments/20080718/52cc25f6/attachment.obj

Now I get no parse errors due to declarations not beeing on top.

But I still get parse errors in for loops, if I put in the for statement a variable declaration. For example:

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

A workaround is to write it like this:

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

But as I dont want to adapt all my for loops, I am wondering if there is a patch available which solves this issue.

like image 320
tobias Avatar asked Apr 21 '12 08:04

tobias


1 Answers

Since there is no answer yet, I just quote the wikipedia article on 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.

Since declaring variables in the loop head is C99 compliant ( and argueable preferable style ), you should refrain from splint until this is fixed.

like image 182
shuhalo Avatar answered Oct 20 '22 23:10

shuhalo