On Tue, 21 Oct 2003, David Evans wrote: > On Mon, 20 Oct 2003, Jay A. St. Pierre wrote: > > > I have the following piece of code: > > > > #include <stdarg.h> > > #include <stdio.h> > > #include <stdbool.h> > > ... > > > > When I run splint with no arguments, I get: > > > > $ splint foo.c > > Splint 3.1.1 --- 20 May 2003 > > > > Finished checking --- no warnings > > > > Now, when I run it using the -load flag to tell it to load the > > standard.lcd file that comes with splint, I get: > > > > $ splint +load /opt/splint-3.1.1/share/splint/lib/standard.lcd foo.c > > Splint 3.1.1 --- 20 May 2003 > > > > 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. > > > > 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. > Note that when you generate a library running splint on your > code with the standard library, the generated library includes > this information that it was produced using the standard > library (or unix, posix library as the case may be) and will > skip the appropriate headers. So, I'm not sure I understand > why you are running into this problem when you generate your > libraries with the POSIX real time extendions. The > standard.lcd doesn't include that information (since it wasn't > generated from a splint run that used the standard library), > but it probably should so the behavior is the same whether you > load it explicitly or normally. Referring to the above example, if its not skipping the iso headers because I'm explicitly loading standard.lcd, why does it complain "+skipisoheaders redundant with current value" when I use the +skip-iso-headers flag? Am I not understanding the +skip-iso-headers flag correctly? 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. Thanks for your time. -Jay _______________________________________________ splint-discuss mailing list [EMAIL PROTECTED] http://www.splint.org/mailman/listinfo/splint-discuss