[Bug libstdc++/52764] Including <cstdint> after <stdint.h> fails to define limit macros
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 29 10:02:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52764
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-03-29
Ever Confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-03-29 09:58:58 UTC ---
Including <stdint.h> alone should declare the macros, <cstdint> isn't needed to
demonstrate the bug.
The problem is that <stdint.h> has this:
/* The ISO C99 standard specifies that in C++ implementations these
macros should only be defined if explicitly requested. */
#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
Which is indeed what C99 says, but C99 doesn't get to dictate rules to C++, and
C11 doesn't include that useless footnote.
GCC's own <stdint-gcc.h> should be fixed and glibc's <stdint.h> should be
fixed, and GCC's <stdint.h> should probably include
#ifdef __cplusplus
# define __STDC_LIMIT_MACROS
#endif
if GCC detects that glibc requires it in order to function correctly.
In short: not a libstdc++ bug!
More information about the Gcc-bugs
mailing list