[splint-discuss] 'splint' and sys/types.h
Michael Wojcik
Michael.Wojcik at MicroFocus.com
Thu Oct 26 09:28:23 EDT 2006
> From: splint-discuss-bounces at cs.virginia.edu
> [mailto:splint-discuss-bounces at cs.virginia.edu] On Behalf Of
> Roman Mashak
> Sent: Thursday, 26 October, 2006 01:27
>
> MW> I'd start by checking for missing predefines in the Splint
> MW> configuration. If that doesn't reveal the problem, try
pre-processing
> MW> the source with gcc ... and finding
> MW> out just where u_int8_t actually gets defined for this program.
Then
> MW> you'll know where to put your skipposixheaders annotations.
>
> I ran preprocessor (gcc -E) and found 'u_int8_t' has been
> really defined in sys/types.h:
>
> typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
>
> I put this line directly into the code, removed inclusion of
sys/types.h and
> this made splint happy. The problem seems to be different.
No, I'm afraid that doesn't demonstrate anything of the sort. First,
what you wrote above doesn't demonstrate that sys/types.h is actually
defining u_int8_t *at the point where you explicitly include it in your
program*. It may be, but as I wrote previously, sys/types.h may be
included by some earlier header, rendering your Splint annotation moot.
Second, there's no guarantee that the result of preprocessing with gcc
will be the same as what the Splint parser sees. You still have to find
out why you get that definition from sys/types.h when you preprocess
with gcc, and not when you parse with Splint.
Again, conditional compilation and a different set of predefined macros
is the most likely explanation.
(Richard O'Keefe wrote in another note that this issue has been
discussed on the list before, so you might want to download the archives
- follow the link at the bottom of every list message - and search
through them. Unfortunately, that's hardly convenient.)
--
Michael Wojcik
Principal Software Systems Developer, Micro Focus
More information about the splint-discuss
mailing list