Title
Are <cstddint> macros optional?
Status
dup
Section
[cstdint.syn]
Submitter
Thomas Koeppe

Created on 2016-08-10.00:00:00 last changed 94 months ago

Messages

Date: 2017-03-15.00:00:00

[ 2017-03-04, Kona ]

Close as a duplicate of 2820 per Thomas' request.

Date: 2016-09-09.00:00:00

[ 2016-09-09 Issues Resolution Telecon ]

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

Date: 2016-08-15.00:00:00

[ 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?

Date: 2016-08-10.00:00:00

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.)

History
Date User Action Args
2017-03-14 03:14:09adminsetmessages: + msg9104
2017-03-14 03:14:09adminsetstatus: new -> dup
2016-09-12 04:36:33adminsetmessages: + msg8506
2016-08-11 18:42:24adminsetmessages: + msg8480
2016-08-10 00:00:00admincreate