1 .\" Copyright (c) 2020-2022 by Alejandro Colomar <alx@kernel.org>
2 .\" and Copyright (c) 2020 by Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .TH intN_t 3type (date) "Linux man-pages (unreleased)"
9 intN_t, int8_t, int16_t, int32_t, int64_t,
10 uintN_t, uint8_t, uint16_t, uint32_t, uint64_t
11 \- fixed-width basic integer types
17 .B #include <stdint.h>
19 .BR typedef " /* ... */ " int8_t;
20 .BR typedef " /* ... */ " int16_t;
21 .BR typedef " /* ... */ " int32_t;
22 .BR typedef " /* ... */ " int64_t;
24 .BR typedef " /* ... */ " uint8_t;
25 .BR typedef " /* ... */ " uint16_t;
26 .BR typedef " /* ... */ " uint32_t;
27 .BR typedef " /* ... */ " uint64_t;
29 .B "#define INT8_WIDTH 8"
30 .B "#define INT16_WIDTH 16"
31 .B "#define INT32_WIDTH 32"
32 .B "#define INT64_WIDTH 64"
34 .B "#define UINT8_WIDTH 8"
35 .B "#define UINT16_WIDTH 16"
36 .B "#define UINT32_WIDTH 32"
37 .B "#define UINT64_WIDTH 64"
39 .BR "#define INT8_MAX " "/* 2**(INT8_WIDTH - 1) - 1 */"
40 .BR "#define INT16_MAX " "/* 2**(INT16_WIDTH - 1) - 1 */"
41 .BR "#define INT32_MAX " "/* 2**(INT32_WIDTH - 1) - 1 */"
42 .BR "#define INT64_MAX " "/* 2**(INT64_WIDTH - 1) - 1 */"
44 .BR "#define INT8_MIN " "/* - 2**(INT8_WIDTH - 1) */"
45 .BR "#define INT16_MIN " "/* - 2**(INT16_WIDTH - 1) */"
46 .BR "#define INT32_MIN " "/* - 2**(INT32_WIDTH - 1) */"
47 .BR "#define INT64_MIN " "/* - 2**(INT64_WIDTH - 1) */"
49 .BR "#define UINT8_MAX " "/* 2**INT8_WIDTH - 1 */"
50 .BR "#define UINT16_MAX " "/* 2**INT16_WIDTH - 1 */"
51 .BR "#define UINT32_MAX " "/* 2**INT32_WIDTH - 1 */"
52 .BR "#define UINT64_MAX " "/* 2**INT64_WIDTH - 1 */"
54 .BI "#define INT8_C(" c ") " c " ## " "\fR/* ... */\fP"
55 .BI "#define INT16_C(" c ") " c " ## " "\fR/* ... */\fP"
56 .BI "#define INT32_C(" c ") " c " ## " "\fR/* ... */\fP"
57 .BI "#define INT64_C(" c ") " c " ## " "\fR/* ... */\fP"
59 .BI "#define UINT8_C(" c ") " c " ## " "\fR/* ... */\fP"
60 .BI "#define UINT16_C(" c ") " c " ## " "\fR/* ... */\fP"
61 .BI "#define UINT32_C(" c ") " c " ## " "\fR/* ... */\fP"
62 .BI "#define UINT64_C(" c ") " c " ## " "\fR/* ... */\fP"
68 of a fixed width of exactly N bits,
70 being the value specified in its type name.
71 They are be capable of storing values in the range
72 .RB [ INT \fIN\fP _MIN ,
73 .BR INT \fIN\fP _MAX ],
76 by the appropriate number.
80 unsigned integer types
81 of a fixed width of exactly N bits,
82 N being the value specified in its type name.
83 They are capable of storing values in the range
85 .BR UINT \fIN\fP _MAX ],
88 by the appropriate number.
97 are only required in implementations that provide integer types with width 64;
98 and all other types of this form are optional.
101 .RB [ U ] INT \fIN\fP _WIDTH
102 expand to the width in bits of these types
106 .RB [ U ] INT \fIN\fP _MAX
107 expand to the maximum value that these types can hold.
111 expand to the minimum value that these types can hold.
114 .RB [ U ] INT \fIN\fP _C ()
115 expand their argument to an integer constant of type
118 The length modifiers for the
123 are expanded by macros of the forms
131 resulting for example in
138 The length modifiers for the
143 are expanded by macros of the forms
151 resulting for example in
164 .RB [ U ] INT \fIN\fP _WIDTH
165 macros were added in C23.
167 The following header also provides these types:
175 .BR intmax_t (3type),
176 .BR intptr_t (3type),