Lots of bugs in <limits.h> ?

Neil Booth neil@daikokuya.co.uk
Mon Dec 30 14:47:00 GMT 2002


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.



More information about the Gcc mailing list