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

**Section:** 17.4.1 [cstdint.syn] **Status:** NAD Editorial
**Submitter:** Martin Sebor **Opened:** 2008-05-17 **Last modified:** 2016-01-28

**Priority: **Not Prioritized

**View all other** issues in [cstdint.syn].

**View all issues with** NAD Editorial status.

**Discussion:**

In specifying the names of macros and types defined in
header `<stdint.h>`

, C99 makes use of the
symbol

to accommodate unusual platforms with
word sizes that aren't powers of two. C99
permits *N*

to take on any positive integer value
(including, for example, 24).
*N*

In [stdint.sy] Header `<cstdint>`

synopsis, C++ on the other hand, fixes the value
of

to 8, 16, 32, and 64, and specifies only
types with these exact widths.
*N*

In addition, paragraph 1 of the same section makes use of a rather
informal shorthand notation to specify sets of macros. When
interpreted strictly, the notation specifies macros such
as `INT_8_MIN`

that are not intended to be specified.

Finally, the section is missing the usual table of symbols defined in that header, making it inconsistent with the rest of the specification.

**Proposed resolution:**

I propose to use the same approach in the C++ spec as C99 uses, that
is, to specify the header synopsis in terms of "exposition only" types
that make use of the symbol

to denote one or
more of a theoretically unbounded set of widths.
*N*

Further, I propose to add a new table to section listing the symbols defined in the header using a more formal notation that avoids introducing inconsistencies.

To this effect, in [stdint.sy]
Header `<cstdint>`

synopsis, replace both the
synopsis and paragraph 1 with the following text:

- In the names defined in the
`<cstdint>`

header, the symbol`represents a positive decimal integer with no leading zeros (e.g., 8 or 24, but not 0, 04, or 048). With the exception of exact-width types, macros and types for values of`

N`in the set of 8, 16, 32, and 64 are required. Exact-width types, and any macros and types for values of`

N`other than 8, 16, 32, and 64 are optional. However, if an implementation provides integer types with widths of 8, 16, 32, or 64 bits, the corresponding exact-width types and macros are required.`

Nnamespace std { // required types // Fastest minimum-width integer types typedefsigned integer typeint_fast8_t; typedefsigned integer typeint_fast16_t; typedefsigned integer typeint_fast32_t; typedefsigned integer typeint_fast64_t; typedefunsigned integer typeuint_fast8_t; typedefunsigned integer typeuint_fast16_t; typedefunsigned integer typeuint_fast32_t; typedefunsigned integer typeuint_fast64_t; // Minimum-width integer types typedefsigned integer typeint_least8_t; typedefsigned integer typeint_least16_t; typedefsigned integer typeint_least32_t; typedefsigned integer typeint_least64_t; typedefunsigned integer typeuint_least8_t; typedefunsigned integer typeuint_least16_t; typedefunsigned integer typeuint_least32_t; typedefunsigned integer typeuint_least64_t; // Greatest-width integer types typedefsigned integer typeintmax_t; typedefunsigned integer typeuintmax_t; // optionally defined types // Exact-width integer types typedefsigned integer typeintN_t; typedefunsigned integer typeuintN_t; // Fastest minimum-width integer types for values // ofNother than 8, 16, 32, and 64 typedefsigned integer typeuint_fastN_t; typedefunsigned integer typeuint_fastN_t; // Minimum-width integer types for values // ofNother than 8, 16, 32, and 64 typedefsigned integer typeuint_leastN_t; typedefunsigned integer typeuint_leastN_t; // Integer types capable of holding object pointers typedefsigned integer typeintptr_t; typedefsigned integer typeintptr_t; }

[Note to editor: Remove all of the existing paragraph 1 from [stdint.sy].]

Table ??: Header

`<cstdint>`

synopsis

Type Name(s) Macros:`INT`

N_MIN`INT`

N_MAX`UINT`

N_MAX`INT_FAST`

N_MIN`INT_FAST`

N_MAX`UINT_FAST`

N_MAX`INT_LEAST`

N_MIN`INT_LEAST`

N_MAX`UINT_LEAST`

N_MAX`INTPTR_MIN`

`INTPTR_MAX`

`UINTPTR_MAX`

`INTMAX_MIN`

`INTMAX_MAX`

`UINTMAX_MAX`

`PTRDIFF_MIN`

`PTRDIFF_MAX`

`PTRDIFF_MAX`

`SIG_ATOMIC_MIN`

`SIG_ATOMIC_MAX`

`SIZE_MAX`

`WCHAR_MIN`

`WCHAR_MAX`

`WINT_MIN`

`WINT_MAX`

`INT`

N_C()`UINT`

N_C()`INTMAX_C()`

`UINTMAX_C()`

Types:`int`

N_t`uint`

N_t`int_fast`

N_t`uint_fast`

N_t`int_least`

N_t`uint_least`

N_t`intptr_t`

`uintptr_t`

`intmax_t`

`uintmax_t`