This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Lots of bugs in <limits.h> ?
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Mon, 30 Dec 2002 20:41:59 +0000 (GMT)
- Subject: Re: Lots of bugs in <limits.h> ?
On Mon, 30 Dec 2002, Neil Booth wrote:
> Reading the C standard carefully leads me to believe that the macros
> like
>
> UINT_MAX, LONG_MIN
>
> etc. should be values, and not typed integer constants like "65535U"
> nor expressions like "(-LONG_MAX - 1)".
They are "constant expressions suitable for use in #if preprocessing
directives", "expressions that have the same type as would an expression
that is an object of the corresponding type converted according to the
integer promotions", as required by C99. As I've already pointed out on
libc-alpha
<http://sources.redhat.com/ml/libc-alpha/2002-12/msg00088.html>,
Dinkumware's page is simply wrong about the requirements for the
<stdint.h> macros, which are specified as applying to constants (not
constant expressions), both before and after TC1.
--
Joseph S. Myers
jsm28@cam.ac.uk