[splint-discuss] Unrecognized macros like "timerisset" "timercmp"

Tommy Pettersson ptp at lysator.liu.se
Tue Aug 22 05:15:08 EDT 2006


On Tue, Aug 22, 2006 at 09:14:25AM +0800, raymond wrote:
> Yes, I think so. But is there options just to parse all header files in
> the analysis progress, because many projects not posix compatible but
> using some lib of posix like "pthread".

Many library header files use trickery that fools splint. The
elegant solution is to generate a library (.lcd) for splint, but
it's a solution that requires a fair amount of work. You would
basically rewrite the include file(s) for pthread without any
trickery but with splint annotations. Look at the splint
standard libraries include files and compare them with the
system include files for example. Section 14.2 of the splint
manual explains how to generate the library file from there.
Then you would instruct splint _not_ to read the pthread include
files but instead use this pthread library file. This will buy
you checking for proper use of the pthread library (which splint
by default only offers for the standard libraries in ansi, posix
and to some extent unix).

I use a more self-centered and time preserving approach; I make
a per project splint library with _only_ the extra stuff I use,
all of it in one incompatibility library. It makes splint both
run and do proper checking, but reusability is very low.


-- 
Tommy Pettersson <ptp at lysator.liu.se>


More information about the splint-discuss mailing list