[splint-discuss] Information cached between source files?

Mark Glines mark at glines.org
Tue Apr 24 11:42:52 EDT 2007


David, Brian, thanks for your help.  That's exactly what I needed.

On to the next problem... :)

I am running into a problem where specifying multiple source files on
the command line affects the preprocessor parsing those files.  Hmm,
that sentence didn't make a lot of sense.  Let me try an example:

File 1 (compilers/imcc/cfg.c) parses fine, when I run splint on it
alone.

File 2 (compilers/imcc/debug.c) parses fine, when I run splint on it
alone.

But if I put both filenames on the same splint command-line, the second
file gets a parse error.  Upon further investigation of the preprocessor
output, it seems that an important header-file didn't get included for
the second file, causing a parse error when using a typedef
(__sighandler_t) which never actually got typedeffed.

Is this expected behavior?  Is it a bug?

If I add a "+single-includes" to the command-line, the above problem
goes away.  But this flag breaks another source file down the line,
which expects different headerfile behavior due to having some extra
macro defined.  So I'm trying to understand exactly what
+single-includes does.

Here's my current splint command-line:

splint +keep -I./include  -DHAS_JIT -DI386 "-Isrc/pmc"
"-Icompilers/ast" -weak +showscan +showsummary -warnposixheaders
-abstract +aliasunique +ansireserved +ansireservedinternal
+assignexpose +bitwisesigned +boolcompare +booltype BOOLVAL -castfcnptr
-charint +continuecomment +controlnestdepth 15 +cppnames +declundef
+distinctinternalnames +evalorder +fielduse +forcehints -globs +imptype
+includenest 20 +incondefs +incondefslib +linelen 9999 +longintegral
+macroassign +macroempty +macroredef +matchanyintegral +nestedextern
+noeffect +readonlystrings +realcompare +shadow -type -isoreserved
-isoreservedinternal +single-includes

... followed by a couple hundred source filenames.

I guess my problem is that this source tree will not work with
+single-includes, without significant refactoring of the header
files...  But it seems to be required for specifying multiple C sources
on the same command-line.  Any other ideas for things I can try?  Is
there any alternative to breaking things up so splint runs once for each
source file?

Thanks,

Mark


More information about the splint-discuss mailing list