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.
Since there is no answer yet, I just quote the wikipedia article on splint article
Since declaring variables in the loop head is C99 compliant ( and argueable preferable style ), you should refrain from splint until this is fixed.