This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Lots of bugs in <limits.h> ?
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 30 Dec 2002 20:26:03 +0000
- Subject: Lots of bugs in <limits.h> ?
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)".
My attention was drawn to this fact by a comment on Dinkumware's
website about Glibc's not being standards conforming because if such
macros are passed to other macros like UINT64_C they produce
preprocessor or parser errors because suffixes like "LL" are appended
to the original macros. My reading of the C standard is that it is
indeed intended that this should be possible.
Do others agree?
If so, for GCC we need to fix <limits.h>, as well as some bits of
c-common.c.
Neil.