Debian Codegraph @

upstream/debian-trixie/man3/intptr_t.3type

raw
1 .\" Copyright (c) 2020-2022 by Alejandro Colomar <[email protected]>
2 .\" and Copyright (c) 2020 by Michael Kerrisk <[email protected]>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\"
7 .TH intptr_t 3type 2024-05-02 "Linux man-pages 6.9.1"
8 .SH NAME
9 intptr_t, uintptr_t \- integer types wide enough to hold pointers
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc )
13 .SH SYNOPSIS
14 .nf
15 .B #include <stdint.h>
16 .P
17 .BR typedef " /* ... */ " intptr_t;
18 .BR typedef " /* ... */ " uintptr_t;
19 .P
20 .BR "#define INTPTR_WIDTH" " /* ... */"
21 .B #define UINTPTR_WIDTH INTPTR_WIDTH
22 .P
23 .BR "#define INTPTR_MAX" " /* 2**(INTPTR_WIDTH \- 1) \- 1 */"
24 .BR "#define INTPTR_MIN" " /* \- 2**(INTPTR_WIDTH \- 1) */"
25 .BR "#define UINTPTR_MAX" " /* 2**UINTPTR_WIDTH \- 1 */"
26 .fi
27 .SH DESCRIPTION
28 .I intptr_t
29 is a signed integer type
30 such that any valid
31 .RI ( "void *" )
32 value can be converted to this type and then converted back.
33 It is capable of storing values in the range
34 .RB [ INTPTR_MIN ,
35 .BR INTPTR_MAX ].
36 .P
37 .I uintptr_t
38 is an unsigned integer type
39 such that any valid
40 .RI ( "void *" )
41 value can be converted to this type and then converted back.
42 It is capable of storing values in the range
43 .RB [ 0 ,
44 .BR INTPTR_MAX ].
45 .P
46 The macros
47 .RB [ U ] INTPTR_WIDTH
48 expand to the width in bits of these types.
49 .P
50 The macros
51 .RB [ U ] INTPTR_MAX
52 expand to the maximum value that these types can hold.
53 .P
54 The macro
55 .B INTPTR_MIN
56 expands to the minimum value that
57 .I intptr_t
58 can hold.
59 .P
60 The length modifiers for the
61 .RI [ u ] intptr_t
62 types
63 for the
64 .BR printf (3)
65 family of functions
66 are expanded by the macros
67 .BR PRIdPTR ,
68 .BR PRIiPTR ,
69 and
70 .B PRIuPTR
71 (defined in
72 .IR <inttypes.h> );
73 resulting commonly in
74 .B %"PRIdPTR"
75 or
76 .B %"PRIiPTR"
77 for printing
78 .I intptr_t
79 values.
80 The length modifiers for the
81 .IR [ u ] intptr_t
82 types
83 for the
84 .BR scanf (3)
85 family of functions
86 are expanded by the macros
87 .BR SCNdPTR ,
88 .BR SCNiPTR ,
89 and
90 .B SCNuPTR
91 (defined in
92 .IR <inttypes.h> );
93 resulting commonly in
94 .B %"SCNuPTR"
95 for scanning
96 .I uintptr_t
97 values.
98 .SH STANDARDS
99 C11, POSIX.1-2008.
100 .SH HISTORY
101 C99, POSIX.1-2001.
102 .SH NOTES
103 The following header also provides these types:
104 .IR <inttypes.h> .
105 .SH SEE ALSO
106 .BR intmax_t (3type),
107 .BR void (3)