stdint.h(3avr)
π stdint.h π
okay bestie, welcome to the group chat where we talk about stdint.h β and yeah, this page lives in the manual set called 3avr, so if you see stdint.h(3avr) floating around, that's just this β¨
π NAME π
stdint.h β the header that hands you integer types with actual guaranteed widths, and all the #defines that go with them. no cap, it's the glow-up your int wishlist. π¦
β¨ SYNOPSIS β¨
π Macros
πΈ Limits of specified-width integer types
heads up for the C++ girlies: C++ implementations should define these macros only when__STDC_LIMIT_MACROSis defined before<stdint.h>is included. like, define it first or it's not happening π
#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
at-least-that-many-bits energy, and honestly? iconic π
#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
same width vibe, but usually the fastest one your machine's got π₯
#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
pointer-sized ints, bestie. they can hold an object pointer, no drama π«Ά
#define INTPTR_MAX INT16_MAX
#define INTPTR_MIN INT16_MIN
#define UINTPTR_MAX UINT16_MAX
π Limits of greatest-width integer types
the biggest of the big. the final boss. the main character π
#define INTMAX_MAX INT64_MAX
#define INTMAX_MIN INT64_MIN
#define UINTMAX_MAX UINT64_MAX
π Limits of other integer types
C++ besties again: C++ implementations should define these macros only when__STDC_LIMIT_MACROSis defined before<stdint.h>is included. say it with me: before. π
#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
β¨ another C++ note, sorry not sorry: C++ implementations should define these macros only when__STDC_CONSTANT_MACROSis defined before<stdint.h>is included. π
and fr fr, listen: these definitions are valid for integer constants without suffix and for macros defined as integer constant without suffix. that's the whole lore π§
#define INT8_C(value)
#define UINT8_C(value)
#define INT16_C(value)
#define UINT16_C(value)
#define INT32_C(value)
#define UINT32_C(value)
#define INT64_C(value)
#define UINT64_C(value)
#define INTMAX_C(value)
#define UINTMAX_C(value)
π«Ά Typedefs
β Exact-width integer types
integer types having exactly the specified width. exactly. not approximately. not "it depends". exactly π
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 let you declare variables of the same size as a pointer. yes bestie, that's the whole point π¦
typedef int16_t intptr_t
typedef uint16_t uintptr_t
πΈ Minimum-width integer types
integer types having at least the specified width. at least, okay? be flexible π
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 being usually fastest having at least the specified width. "usually" is doing a lot of heavy lifting here but she ate π₯
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 designating integer data capable of representing any value of any integer type in the corresponding signed or unsigned category. genuinely the moment. π
typedef int64_t intmax_t
typedef uint64_t uintmax_t
π Author π
generated automatically by Doxygen for AVR-LibC from the source code. the robots wrote it, and honestly? slay π€β¨
okay that's the whole page, you made it, I'm so proud of you π₯Ήπ
this was AVR-LibC, Version 2.2.1, coming at you from the stdint.h(3avr) manual page. go forth and #include <stdint.h> responsibly, bestie. periodt. π
ππ¦
π¦ where this page comes from
- ubuntu resolute: avr-libc 1:2.2.1-1build1 Β· BSD-3-Clause
- ubuntu stonking: avr-libc 1:2.2.1-1build1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms