Topic: Crash" during preprocess check of 'limit.h' - help!


Author: dwr@cci632.cci.com (Donald W. Rouse II)
Date: Mon, 8 Feb 1993 19:15:02 GMT
Raw View
In article <1993Feb5.191331.23261@daimi.aau.dk> sabroe@daimi.aau.dk (Morten Sabroe Mortensen) writes:
> [...]
>#if USHRT_MAX==4294967295                            //WARNING!
>#elif UINT_MAX==4294967295                           //WARNING!
>#if SHRT_MIN==-2147483648 && SHRT_MAX==2147483647    //WARNING!
>#elif INT_MIN==-2147483648 && INT_MAX==2147483647    //WARNING!
>
>I've *never* had problems with it - that is, until now.
> [...]
>fnd.h:47: warning: integer constant is so large that it is unsigned
>fnd.h:49: warning: integer constant is so large that it is unsigned
>fnd.h:78: warning: integer constant is so large that it is unsigned
>fnd.h:80: warning: integer constant is so large that it is unsigned
>These four lines are in the above code marked "WARNING". Why in the world
>does the preprocessor know anything about the size of an integer???
>Why doesn't it just compare strings of arbitrary size?

PP must know about integers to be able to evaluate expressions.
To prevent problems, postfix the the 4294967295s with 'U',
the -2147483648s with 'L', and the 2147483647s with 'LU'.

PS. This is a language question, not a standards question,
and thus should be posted to comp.lang.c++.
Followups to there.