This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]