On Thu, 4 Aug 2005, Alecs King wrote:
>
> ./commit.c:89:14: warning: undefined identifier '__LONG_MAX__'
> ./apply.c:335:50: warning: undefined identifier '__LONG_MAX__'
> ./apply.c:342:50: warning: undefined identifier '__LONG_MAX__'
>
> Thats triggered by using the macro 'ULONG_MAX'. Why does sparse frown
> at it (while gcc -E can handle it properly)?
The header files that come with gcc tends to have something like this:
limits.h:#define LONG_MAX __LONG_MAX__
limits.h:#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
and then __LONG_MAX__ just happens to be one of the magic things gcc fills
out. sparse doesn't, mainly because this seems to be new to newer gcc's..
I should add those to the default defs, I guess. You can use
"cgcc -no-compile"
which will fill those things in for you, but the fact is, even that won't
fill in some things like __BIG_ENDIAN__ etc magic #defines that gcc also
has.
For a full list of just _what_ gcc defines with something like
echo | gcc -dD -E -
which gives you some idea of just how much crap gcc has built in. And yes,
gcc and glibc header files tend to depend on pretty much all of it, and
sparse doesn't pre-define quite that much..
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html