[Bug libstdc++/97044] Undefined format macros because of include order on AIX

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Sep 20 22:18:32 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97044

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Specifically, C99 7.8.1 footnote 182 says:

"C++ implementations should define these macros only when _ _STDC_FORMAT_MACROS
is defined before <inttypes.h> is included."

The footnote is not present in C11.

C++11 27.9.2 p3 says:

"Note: The macros defined by <cinttypes> are provided unconditionally. In
particular, the symbol __STDC_FORMAT_MACROS, mentioned in footnote 182 of the C
standard, plays no role in C++."

So requiring the macro to be defined by C++ programs before including
<inttypes.h> is an anachronism that is not compatible with any version of the
C++ standard.


More information about the Gcc-bugs mailing list