[splint-discuss] Parse Error

Lee l_rm at yahoo.com
Mon Aug 29 05:09:37 EDT 2005


I have just started working with C and splint (Java and O-O
background) but am having a little trouble getting past a
parse error. I have simplified the code to demonstrate the
problem:
-----------------------------

int main()
{
 int good;
 if(true){}
 int fail;
 return(0);
}

-----------------------------
I get the following error:
C:\<Path with spaces>\>splint +ansi-lib +trytorecover
test.c
Splint 3.1.1 --- 12 April 2003

test.c: (in function main)
test.c(6,4): Parse Error. Attempting to continue.
test.c(6,4): Cannot recover from parse error.
*** Cannot continue.

Note that line 6 is 'int fail;'
I have tried variations of the flags with no effect, also
changing the if statement to another logic statement as
below, also causes the parse error:

int good = 2;
good = (good -1) * 10;

This is under Windows XP (Home) SP1 with the GCC includes
from DEV-C++ 4.9.9.0
I haven't been able to test this problem with other
platforms or libraries.

Is this a bug with splint, or is it a rule with C that all
declaration statements must be before any logic statements.
The program I initially had this problem in compiles and
runs correctly.

Any help you could give would be appreciated.

Lee.


		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 



More information about the splint-discuss mailing list