<stdint.h>: Standard Integer Types


Integer types capable of holding object pointers

These allow you to declare variables of the same size as a pointer.

typedef int16_t intptr_t
typedef uint16_t uintptr_t

Minimum-width integer types

Integer types having at least the specified width

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

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

typedef int64_t intmax_t
typedef uint64_t uintmax_t

Limits of specified-width integer types

C++ implementations should define these macros only when __STDC_LIMIT_MACROS is defined before <stdint.h> is included

#define INT8_MAX   0x7f
#define INT8_MIN   (-INT8_MAX - 1)
#define UINT8_MAX   (__CONCAT(INT8_MAX, U) * 2U + 1U)
#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

C++ implementations should define these macros only when __STDC_LIMIT_MACROS is defined before <stdint.h> is included

#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   (__CONCAT(INT16_MAX, U))

Macros for integer constants

C++ implementations should define these macros only 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)

Detailed Description

 #include <stdint.h> 

Use [u]intN_t if you need exactly N bits.

Since these typedefs are mandated by the C99 standard, they are preferred over rolling your own typedefs.


Define Documentation

#define INT16_C ( value   )     value

define a constant of type int16_t

Definition at line 629 of file stdint.h.

#define INT16_MAX   0x7fff

largest positive value an int16_t can hold.

Definition at line 327 of file stdint.h.

#define INT16_MIN   (-INT16_MAX - 1)

smallest negative value an int16_t can hold.

Definition at line 332 of file stdint.h.

#define INT32_C ( value   )     __CONCAT(value, L)

define a constant of type int32_t

Definition at line 639 of file stdint.h.

#define INT32_MAX   0x7fffffffL

largest positive value an int32_t can hold.

Definition at line 342 of file stdint.h.

#define INT32_MIN   (-INT32_MAX - 1L)

smallest negative value an int32_t can hold.

Definition at line 347 of file stdint.h.

#define INT64_C ( value   )     __CONCAT(value, LL)

define a constant of type int64_t

Definition at line 651 of file stdint.h.

#define INT64_MAX   0x7fffffffffffffffLL

largest positive value an int64_t can hold.

Definition at line 359 of file stdint.h.

#define INT64_MIN   (-INT64_MAX - 1LL)

smallest negative value an int64_t can hold.

Definition at line 364 of file stdint.h.

#define INT8_C ( value   )     ((int8_t) value)

define a constant of type int8_t

Definition at line 609 of file stdint.h.

#define INT8_MAX   0x7f

largest positive value an int8_t can hold.

Definition at line 300 of file stdint.h.

#define INT8_MIN   (-INT8_MAX - 1)

smallest negative value an int8_t can hold.

Definition at line 305 of file stdint.h.

#define INT_FAST16_MAX   INT16_MAX

largest positive value an int_fast16_t can hold.

Definition at line 460 of file stdint.h.

#define INT_FAST16_MIN   INT16_MIN

smallest negative value an int_fast16_t can hold.

Definition at line 465 of file stdint.h.

#define INT_FAST32_MAX   INT32_MAX

largest positive value an int_fast32_t can hold.

Definition at line 475 of file stdint.h.

#define INT_FAST32_MIN   INT32_MIN

smallest negative value an int_fast32_t can hold.

Definition at line 480 of file stdint.h.

#define INT_FAST64_MAX   INT64_MAX

largest positive value an int_fast64_t can hold.

Definition at line 490 of file stdint.h.

#define INT_FAST64_MIN   INT64_MIN

smallest negative value an int_fast64_t can hold.

Definition at line 495 of file stdint.h.

#define INT_FAST8_MAX   INT8_MAX

largest positive value an int_fast8_t can hold.

Definition at line 445 of file stdint.h.

#define INT_FAST8_MIN   INT8_MIN

smallest negative value an int_fast8_t can hold.

Definition at line 450 of file stdint.h.

#define INT_LEAST16_MAX   INT16_MAX

largest positive value an int_least16_t can hold.

Definition at line 394 of file stdint.h.

#define INT_LEAST16_MIN   INT16_MIN

smallest negative value an int_least16_t can hold.

Definition at line 399 of file stdint.h.

#define INT_LEAST32_MAX   INT32_MAX

largest positive value an int_least32_t can hold.

Definition at line 409 of file stdint.h.

#define INT_LEAST32_MIN   INT32_MIN

smallest negative value an int_least32_t can hold.

Definition at line 414 of file stdint.h.

#define INT_LEAST64_MAX   INT64_MAX

largest positive value an int_least64_t can hold.

Definition at line 424 of file stdint.h.

#define INT_LEAST64_MIN   INT64_MIN

smallest negative value an int_least64_t can hold.

Definition at line 429 of file stdint.h.

#define INT_LEAST8_MAX   INT8_MAX

largest positive value an int_least8_t can hold.

Definition at line 379 of file stdint.h.

#define INT_LEAST8_MIN   INT8_MIN

smallest negative value an int_least8_t can hold.

Definition at line 384 of file stdint.h.

#define INTMAX_C ( value   )     __CONCAT(value, LL)

define a constant of type intmax_t

Definition at line 661 of file stdint.h.

#define INTMAX_MAX   INT64_MAX

largest positive value an intmax_t can hold.

Definition at line 532 of file stdint.h.

#define INTMAX_MIN   INT64_MIN

smallest negative value an intmax_t can hold.

Definition at line 537 of file stdint.h.

#define INTPTR_MAX   INT16_MAX

largest positive value an intptr_t can hold.

Definition at line 511 of file stdint.h.

#define INTPTR_MIN   INT16_MIN

smallest negative value an intptr_t can hold.

Definition at line 516 of file stdint.h.

#define PTRDIFF_MAX   INT16_MAX

largest positive value a ptrdiff_t can hold.

Definition at line 555 of file stdint.h.

#define PTRDIFF_MIN   INT16_MIN

smallest negative value a ptrdiff_t can hold.

Definition at line 560 of file stdint.h.

#define SIG_ATOMIC_MAX   INT8_MAX

largest positive value a sig_atomic_t can hold.

Definition at line 569 of file stdint.h.

#define SIG_ATOMIC_MIN   INT8_MIN

smallest negative value a sig_atomic_t can hold.

Definition at line 574 of file stdint.h.

#define SIZE_MAX   (__CONCAT(INT16_MAX, U))

largest value a size_t can hold.

Definition at line 580 of file stdint.h.

#define UINT16_C ( value   )     __CONCAT(value, U)

define a constant of type uint16_t

Definition at line 634 of file stdint.h.

#define UINT16_MAX   (__CONCAT(INT16_MAX, U) * 2U + 1U)

largest value an uint16_t can hold.

Definition at line 337 of file stdint.h.

#define UINT32_C ( value   )     __CONCAT(value, UL)

define a constant of type uint32_t

Definition at line 644 of file stdint.h.

#define UINT32_MAX   (__CONCAT(INT32_MAX, U) * 2UL + 1UL)

largest value an uint32_t can hold.

Definition at line 352 of file stdint.h.

#define UINT64_C ( value   )     __CONCAT(value, ULL)

define a constant of type uint64_t

Definition at line 656 of file stdint.h.

#define UINT64_MAX   (__CONCAT(INT64_MAX, U) * 2ULL + 1ULL)

largest value an uint64_t can hold.

Definition at line 369 of file stdint.h.

#define UINT8_C ( value   )     ((uint8_t) __CONCAT(value, U))

define a constant of type uint8_t

Definition at line 614 of file stdint.h.

#define UINT8_MAX   (__CONCAT(INT8_MAX, U) * 2U + 1U)

largest value an uint8_t can hold.

Definition at line 310 of file stdint.h.

#define UINT_FAST16_MAX   UINT16_MAX

largest value an uint_fast16_t can hold.

Definition at line 470 of file stdint.h.

#define UINT_FAST32_MAX   UINT32_MAX

largest value an uint_fast32_t can hold.

Definition at line 485 of file stdint.h.

#define UINT_FAST64_MAX   UINT64_MAX

largest value an uint_fast64_t can hold.

Definition at line 500 of file stdint.h.

#define UINT_FAST8_MAX   UINT8_MAX

largest value an uint_fast8_t can hold.

Definition at line 455 of file stdint.h.

#define UINT_LEAST16_MAX   UINT16_MAX

largest value an uint_least16_t can hold.

Definition at line 404 of file stdint.h.

#define UINT_LEAST32_MAX   UINT32_MAX

largest value an uint_least32_t can hold.

Definition at line 419 of file stdint.h.

#define UINT_LEAST64_MAX   UINT64_MAX

largest value an uint_least64_t can hold.

Definition at line 434 of file stdint.h.

#define UINT_LEAST8_MAX   UINT8_MAX

largest value an uint_least8_t can hold.

Definition at line 389 of file stdint.h.

#define UINTMAX_C ( value   )     __CONCAT(value, ULL)

define a constant of type uintmax_t

Definition at line 666 of file stdint.h.

#define UINTMAX_MAX   UINT64_MAX

largest value an uintmax_t can hold.

Definition at line 542 of file stdint.h.

#define UINTPTR_MAX   UINT16_MAX

largest value an uintptr_t can hold.

Definition at line 521 of file stdint.h.


Typedef Documentation

typedef int16_t int_fast16_t

fastest signed int with at least 16 bits.

Definition at line 223 of file stdint.h.

typedef int32_t int_fast32_t

fastest signed int with at least 32 bits.

Definition at line 233 of file stdint.h.

typedef int64_t int_fast64_t

fastest signed int with at least 64 bits.

Note:
This type is not available when the compiler option -mint8 is in effect.

Definition at line 246 of file stdint.h.

typedef int8_t int_fast8_t

fastest signed int with at least 8 bits.

Definition at line 213 of file stdint.h.

typedef int16_t int_least16_t

signed int with at least 16 bits.

Definition at line 169 of file stdint.h.

typedef int32_t int_least32_t

signed int with at least 32 bits.

Definition at line 179 of file stdint.h.

typedef int64_t int_least64_t

signed int with at least 64 bits.

Note:
This type is not available when the compiler option -mint8 is in effect.

Definition at line 192 of file stdint.h.

typedef int8_t int_least8_t

signed int with at least 8 bits.

Definition at line 159 of file stdint.h.

typedef int64_t intmax_t

largest signed int available.

Definition at line 273 of file stdint.h.

typedef int16_t intptr_t

Signed pointer compatible type.

Definition at line 142 of file stdint.h.

typedef uint16_t uint_fast16_t

fastest unsigned int with at least 16 bits.

Definition at line 228 of file stdint.h.

typedef uint32_t uint_fast32_t

fastest unsigned int with at least 32 bits.

Definition at line 238 of file stdint.h.

typedef uint64_t uint_fast64_t

fastest unsigned int with at least 64 bits.

Note:
This type is not available when the compiler option -mint8 is in effect.

Definition at line 253 of file stdint.h.

typedef uint8_t uint_fast8_t

fastest unsigned int with at least 8 bits.

Definition at line 218 of file stdint.h.

typedef uint16_t uint_least16_t

unsigned int with at least 16 bits.

Definition at line 174 of file stdint.h.

typedef uint32_t uint_least32_t

unsigned int with at least 32 bits.

Definition at line 184 of file stdint.h.

typedef uint64_t uint_least64_t

unsigned int with at least 64 bits.

Note:
This type is not available when the compiler option -mint8 is in effect.

Definition at line 199 of file stdint.h.

typedef uint8_t uint_least8_t

unsigned int with at least 8 bits.

Definition at line 164 of file stdint.h.

typedef uint64_t uintmax_t

largest unsigned int available.

Definition at line 278 of file stdint.h.

typedef uint16_t uintptr_t

Unsigned pointer compatible type.

Definition at line 147 of file stdint.h.


Generated on Sun Aug 31 13:31:33 2008 for FrankenRTOS by  doxygen 1.5.6