This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Dup status.

2764. Are <cstddint> macros optional?

Section: 17.4.1 [cstdint.syn] Status: Dup Submitter: Thomas Koeppe Opened: 2016-08-10 Last modified: 2017-03-21

Priority: 3

View all other issues in [cstdint.syn].

View all issues with Dup status.

Discussion:

Are the macros INT[8, 16, 32, 64]_MAX etc. optional?

The entire <cstddint> header is specified to have all types and macros "defined the same as in C". But C is also unclear about this: the fixed-width types like int32_t are optional in C and in C++. The corresponding macro INT32_MAX is defined in terms of an expression of the same type as the "corresponding type converted according to the integral promotions". But if the "corresponding type" does not exist, then surely the macro too cannot exist? It seems that the macros should also be optional.

Suggested resolution: See e.g. here, or equivalent wording to the effect that the macros INT*_MAX etc are defined if and only if the corresponding integer type is defined.

(Note that the types intptr_t and uintptr_t are also optional.)

[2016-08-11, Richard comments]

C allows other values for N in addition to 8, 16, 32, 64, whereas it appears that C++ does not. Is the difference intentional?

[2016-09-09 Issues Resolution Telecon]

We need to answer Richard's question before making this ready

[2017-03-04, Kona]

Close as a duplicate of 2820(i) per Thomas' request.

Proposed resolution: