984. Does <cinttypes> have macro guards?

Section: 30.12 [c.files] Status: C++11 Submitter: Howard Hinnant Opened: 2009-02-12 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [c.files].

View all issues with C++11 status.

Discussion:

The C standard says about <inttypes.h>:

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

The C standard has a similar note about <stdint.h>. For <cstdint> we adopted a "thanks but no thanks" policy and documented that fact in 21.4.1 [cstdint.syn]:

... [Note: The macros defined by <stdint> are provided unconditionally. In particular, the symbols __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS (mentioned in C99 footnotes 219, 220, and 222) play no role in C++. — end note]

I recommend we put a similar note in 30.12 [c.files] regarding <cinttypes>.

[ Batavia (2009-05): ]

We agree with the proposed resolution. Move to Tentatively Ready.

Proposed resolution:

Add to 30.12 [c.files]:

Table 112 describes header <cinttypes>. [Note: The macros defined by <cintypes> are provided unconditionally. In particular, the symbol __STDC_FORMAT_MACROS (mentioned in C99 footnote 182) plays no role in C++. — end note]