[splint-discuss] bug with -load flag

David Evans evans at cs.virginia.edu
Sat Nov 1 18:09:19 EST 2003

> > Splint only skips the ANSI standard headers if the library is used.  In
> > this case, it doesn't know that the +load .../standard.lcd is the standard
> > library, so it doesn't skip the standard headers.
> But shouldn't it skip the standard headers if I include the
> +skip-iso-headers (or +skip-ansi-headers) flag?  This does not
> seem to work:
>   $ splint +load /opt/splint-3.1.1/share/splint/lib/standard.lcd \
>     +skip-iso-headers foo.c
>   Command Line: Setting +skipisoheaders redundant with current value
>   foo.c:3:21: Cannot find include file stdbool.h on search path:
>       /usr/include;/opt/splint-3.1.1/include
>     Preprocessing error. (Use -preproc to inhibit warning)
>   Preprocessing error for file: /tmp/foo.c
>   *** Cannot continue.

No, it only skips the headers is the appropriate library is used.  The
+skipisoheaders flag is set by default, but only skips libraries if a
standard library is used.  It might make sense to change the meaning of
these flags, but that's what they mean now.

> As a further note, the library we are creating is just a small
> superset of the posix.lcd that comes with splint.  We create a
> posix-rte.h that has annotated POSIX.4 structures, constants, and
> prototypes, then we run the command:
>   splint -nolib standard.h posix.h posix-rte.h -dump posix-rte
> Then we use this library to check our code.  Using the
> +skip-posix-headers flag with this library generates the
> "redundant" complaint, and by and large seems to work fine.
> So far its just code that is including gcc-3.2.3's stdarg.h that
> exhibits this problem.

One (somewhat awkward) workaround would be to rename your posix-rte
library to replace the posix.lcd standard library, so it would skip the
headers like you want.  Another solution would be to change the lcllib.c
code to make the skip header flags behave like you want (remove the &&
context_usingAnsiLibrary ()) clause on line 169.

--- Dave

More information about the splint-discuss mailing list