5.2 KiB
[cstdint.syn]
17 Language support library [support]
17.4 Arithmetic types [support.arith.types]
17.4.1 Header synopsis [cstdint.syn]
The header supplies integer types having specified widths, and macros that specify limits of integer types.
// all freestanding#define STDC_VERSION_STDINT_H 202311Lnamespace std {using int8_t = signed integer type; // optionalusing int16_t = signed integer type; // optionalusing int32_t = signed integer type; // optionalusing int64_t = signed integer type; // optionalusing intN_t = see below; // optionalusing int_fast8_t = signed integer type; using int_fast16_t = signed integer type; using int_fast32_t = signed integer type; using int_fast64_t = signed integer type; using int_fastN_t = see below; // optionalusing int_least8_t = signed integer type; using int_least16_t = signed integer type; using int_least32_t = signed integer type; using int_least64_t = signed integer type; using int_leastN_t = see below; // optionalusing intmax_t = signed integer type; using intptr_t = signed integer type; // optionalusing uint8_t = unsigned integer type; // optionalusing uint16_t = unsigned integer type; // optionalusing uint32_t = unsigned integer type; // optionalusing uint64_t = unsigned integer type; // optionalusing uintN_t = see below; // optionalusing uint_fast8_t = unsigned integer type; using uint_fast16_t = unsigned integer type; using uint_fast32_t = unsigned integer type; using uint_fast64_t = unsigned integer type; using uint_fastN_t = see below; // optionalusing uint_least8_t = unsigned integer type; using uint_least16_t = unsigned integer type; using uint_least32_t = unsigned integer type; using uint_least64_t = unsigned integer type; using uint_leastN_t = see below; // optionalusing uintmax_t = unsigned integer type; using uintptr_t = unsigned integer type; // optional}#define INTN_MIN see below#define INTN_MAX see below#define UINTN_MAX see below#define INTN_WIDTH see below#define UINTN_WIDTH see below#define INT_FASTN_MIN see below#define INT_FASTN_MAX see below#define UINT_FASTN_MAX see below#define INT_FASTN_WIDTH see below#define UINT_FASTN_WIDTH see below#define INT_LEASTN_MIN see below#define INT_LEASTN_MAX see below#define UINT_LEASTN_MAX see below#define INT_LEASTN_WIDTH see below#define UINT_LEASTN_WIDTH see below#define INTMAX_MIN see below#define INTMAX_MAX see below#define UINTMAX_MAX see below#define INTMAX_WIDTH see below#define UINTMAX_WIDTH see below#define INTPTR_MIN see below // optional#define INTPTR_MAX see below // optional#define UINTPTR_MAX see below // optional#define INTPTR_WIDTH see below // optional#define UINTPTR_WIDTH see below // optional#define PTRDIFF_MIN see below#define PTRDIFF_MAX see below#define PTRDIFF_WIDTH see below#define SIZE_MAX see below#define SIZE_WIDTH see below#define SIG_ATOMIC_MIN see below#define SIG_ATOMIC_MAX see below#define SIG_ATOMIC_WIDTH see below#define WCHAR_MIN see below#define WCHAR_MAX see below#define WCHAR_WIDTH see below#define WINT_MIN see below#define WINT_MAX see below#define WINT_WIDTH see below#define INTN_C(value) see below#define UINTN_C(value) see below#define INTMAX_C(value) see below#define UINTMAX_C(value) see below
The header defines all types and macros the same as the C standard library header <stdint.h>.
The types denoted by intmax_t and uintmax_t are not required to be able to represent all values of extended integer types wider than long long and unsigned long long, respectively.
See also: ISO/IEC 9899:2024, 7.22
All types that use the placeholder N are optional when N is not 8, 16, 32, or 64.
The exact-width typesintN_t and uintN_t for N = 8, 16, 32, and 64 are also optional; however, if an implementation defines integer types with the corresponding width and no padding bits, it defines the corresponding typedef-names.
Each of the macros listed in this subclause is defined if and only if the implementation defines the corresponding typedef-name.
[Note 1:
The macros INTN_C and UINTN_C correspond to the typedef-namesint_leastN_t and uint_leastN_t, respectively.
â end note]