stdint.h(3)
β¨ NAME β¨
stdint.h β the header that gives you integer types with actual guaranteed widths, bestie π
π SYNOPSIS π
Macros
πΈ Limits of specified-width integer types
okay so real talk: if you're writing C++ you should only define these macros when __STDC_LIMIT_MACROS is defined before <stdint.h> gets included. iykyk π
#define INT8_MAX 0x7f
#define INT8_MIN (-INT8_MAX - 1)
#define UINT8_MAX (INT8_MAX * 2 + 1)
#define INT16_MAX 0x7fff
#define INT16_MIN (-INT16_MAX - 1)
#define UINT16_MAX (__CONCAT(INT16_MAX, U) * 2U + 1U)
#define INT32_MAX 0x7fffffffL
#define INT32_MIN (-INT32_MAX - 1L)
#define UINT32_MAX (__CONCAT(INT32_MAX, U) * 2UL + 1UL)
#define INT64_MAX 0x7fffffffffffffffLL
#define INT64_MIN (-INT64_MAX - 1LL)
#define UINT64_MAX (__CONCAT(INT64_MAX, U) * 2ULL + 1ULL)
π¦ Limits of minimum-width integer types
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST8_MIN INT8_MIN
#define UINT_LEAST8_MAX UINT8_MAX
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST16_MIN INT16_MIN
#define UINT_LEAST16_MAX UINT16_MAX
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST32_MIN INT32_MIN
#define UINT_LEAST32_MAX UINT32_MAX
#define INT_LEAST64_MAX INT64_MAX
#define INT_LEAST64_MIN INT64_MIN
#define UINT_LEAST64_MAX UINT64_MAX
π Limits of fastest minimum-width integer types
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST8_MIN INT8_MIN
#define UINT_FAST8_MAX UINT8_MAX
#define INT_FAST16_MAX INT16_MAX
#define INT_FAST16_MIN INT16_MIN
#define UINT_FAST16_MAX UINT16_MAX
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST32_MIN INT32_MIN
#define UINT_FAST32_MAX UINT32_MAX
#define INT_FAST64_MAX INT64_MAX
#define INT_FAST64_MIN INT64_MIN
#define UINT_FAST64_MAX UINT64_MAX
π«Ά Limits of integer types capable of holding object pointers
#define INTPTR_MAX INT16_MAX
#define INTPTR_MIN INT16_MIN
#define UINTPTR_MAX UINT16_MAX
β Limits of greatest-width integer types
#define INTMAX_MAX INT64_MAX
#define INTMAX_MIN INT64_MIN
#define UINTMAX_MAX UINT64_MAX
π Limits of other integer types
again, C++ girlies: only define these when __STDC_LIMIT_MACROS is defined before <stdint.h> is included. not optional, fr fr
#define PTRDIFF_MAX INT16_MAX
#define PTRDIFF_MIN INT16_MIN
#define SIG_ATOMIC_MAX INT8_MAX
#define SIG_ATOMIC_MIN INT8_MIN
#define SIZE_MAX UINT16_MAX
#define WCHAR_MAX __WCHAR_MAX__
#define WCHAR_MIN __WCHAR_MIN__
#define WINT_MAX __WINT_MAX__
#define WINT_MIN __WINT_MIN__
π§ Macros for integer constants
C++ besties, same deal: only define these macros when __STDC_CONSTANT_MACROS is defined before <stdint.h> is included.
these definitions are valid for integer constants without suffix, and for macros defined as integer constant without suffix π
#define INT8_C(value) ((int8_t) value)
#define UINT8_C(value) ((uint8_t) __CONCAT(value, U))
#define INT16_C(value) value
#define UINT16_C(value) __CONCAT(value, U)
#define INT32_C(value) __CONCAT(value, L)
#define UINT32_C(value) __CONCAT(value, UL)
#define INT64_C(value) __CONCAT(value, LL)
#define UINT64_C(value) __CONCAT(value, ULL)
#define INTMAX_C(value) __CONCAT(value, LL)
#define UINTMAX_C(value) __CONCAT(value, ULL)
Typedefs
π Exact-width integer types
integer types that are exactly the width it says on the tin. no surprises, no drama, iconic behavior π
typedef signed char int8_t
typedef unsigned char uint8_t
typedef signed int int16_t
typedef unsigned int uint16_t
typedef signed long int int32_t
typedef unsigned long int uint32_t
typedef signed long long int int64_t
typedef unsigned long long int uint64_t
π₯ Integer types capable of holding object pointers
these ones let you declare variables the same size as a pointer. matching energy, always π«Ά
typedef int16_t intptr_t
typedef uint16_t uintptr_t
πΈ Minimum-width integer types
integer types that have at least the width specified. floor's the floor, she can go higher π
typedef int8_t int_least8_t
typedef uint8_t uint_least8_t
typedef int16_t int_least16_t
typedef uint16_t uint_least16_t
typedef int32_t int_least32_t
typedef uint32_t uint_least32_t
typedef int64_t int_least64_t
typedef uint64_t uint_least64_t
β¨ Fastest minimum-width integer types
integer types that are usually the fastest while still having at least the width specified. speed AND range, main character combo π
typedef int8_t int_fast8_t
typedef uint8_t uint_fast8_t
typedef int16_t int_fast16_t
typedef uint16_t uint_fast16_t
typedef int32_t int_fast32_t
typedef uint32_t uint_fast32_t
typedef int64_t int_fast64_t
typedef uint64_t uint_fast64_t
π Greatest-width integer types
types that designate integer data capable of representing any value of any integer type in the corresponding signed or unsigned category. they hold everything, they're the moment, periodt β
typedef int64_t intmax_t
typedef uint64_t uintmax_t
π Author π
Generated automatically by Doxygen for avr-libc from the source code. (not me writing it by hand, the robots did that part π)
ok that's the whole page bestie, go forth and #include <stdint.h> responsibly π
avr-libc version 2.1.0 β dated Sat Jan 29 2022 β mwah, love u, bye π©·
π¦ where this page comes from
- fedora 43: avr-libc 2.2.1-3.fc43 Β· BSD-3-Clause
- fedora 44: avr-libc 2.2.1-5.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: avr-libc 2.1.0-bp160.1.33 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms