[splint-discuss] Parse Error on "pthread.h" from Cygwin

Richard A. O'Keefe ok at cs.otago.ac.nz
Sun Sep 10 22:33:37 EDT 2006


SF Markus Elfring <elfring at users.sourceforge.net> wrote:
	I would like to try static code analysis on the software 
	"http://www.apsis.ch/pound/" with your tool.
	
	$ /cygdrive/e/Programme/splint-3.1.1/bin/splint -warnposix +trytorecover 
	-I/usr/include /cygdrive/e/Projekte/Pound/2.1/pound.c
	Splint 3.1.1 --- 08 Sep 2006
	/usr/include/pthread.h:79:56: Parse Error.  Too many errors, giving up.
	*** Cannot continue.
	
	I am surprised that the error message points to a comma that is a 
	delimiter for a function parameter in this line from the header file. 

Why the surprise?  Presumably the parse error is in the argument
just preceding that token.

On the Linux box I sometimes use, /usr/include/pthread.h line 79 is
  PTHREAD_PRIO_INHERIT,
which doesn't have a column 56.  Perhaps you could show us the entire
declaration where the problem is.

A good strategy is to check whether identifiers are declared.

	Are any special configuration settings 
	(https://sourceforge.net/tracker/index.php?func=detail&aid=1281594&group_id=34302&atid=459914) 
	useful to resolve this issue?

Yes.  Remember that Splint checks for conformance to standards; it knows
what *should* be in standard headers (C89 by default; add POSIX headers
with +posixlib) so doesn't need to actually read the system headers.

	I would like to see a better readable hint about the detail that the 
	parser does not like or does not understand.
	
The parser does not like and does not understand NON-STANDARD constructions
(where the standard is ANSI C89/ISO C90).  Everything else it understands.
GNUisms are a problem, but the usual cause of this kind of problem seems to
be identifiers that you think are declared but splint thinks aren't because
they are system-specific stuff in standard headers.



More information about the splint-discuss mailing list