xref: /freebsd/share/man/man7/stdint.7 (revision ae83180158c4c937f170e31eff311b18c0286a93)
1.\" Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd April 6, 2002
28.Dt STDINT 7
29.Os
30.Sh NAME
31.Nm stdint
32.Nd "integer types"
33.Sh SYNOPSIS
34.In stdint.h
35.Sh DESCRIPTION
36The
37.Aq Pa stdint.h
38header provides source-portable integer types of a specific
39size, smallest memory footprint with a minimum size, fastest
40access speed with a minimum size, and largest integer size.
41.Pp
42The types
43.Vt int8_t ,
44.Vt int16_t ,
45.Vt int32_t ,
46and
47.Vt int64_t
48provide a signed integer type of width 8, 16, 32, or 64 bits, respectively.
49The types
50.Vt uint8_t ,
51.Vt uint16_t ,
52.Vt uint32_t ,
53and
54.Vt uint64_t
55provide an unsigned integer type of width 8, 16, 32, or 64 bits, respectively.
56These integer types should be used when a specific size is required.
57.Pp
58The types
59.Vt int_fast8_t ,
60.Vt int_fast16_t ,
61.Vt int_fast32_t ,
62and
63.Vt int_fast64_t
64provide the fastest signed integer type with a width
65of at least 8, 16, 32, or 64 bits, respectively.
66The types
67.Vt uint_fast8_t ,
68.Vt uint_fast16_t ,
69.Vt uint_fast32_t ,
70and
71.Vt uint_fast64_t
72provide the fastest unsigned integer type with a width
73of at least 8, 16, 32, or 64 bits, respectively.
74These types should be used when access speed is
75paramount, and when a specific size is not required.
76.Pp
77The types
78.Vt int_least8_t ,
79.Vt int_least16_t ,
80.Vt int_least32_t ,
81and
82.Vt int_least64_t
83provide the smallest memory footprint signed integer type with
84a width of at least 8, 16, 32, or 64 bits, respectively.
85The types
86.Vt uint_least8_t ,
87.Vt uint_least16_t ,
88.Vt uint_least32_t ,
89and
90.Vt uint_least64_t
91provide the smallest memory footprint unsigned integer type with
92a width of at least 8, 16, 32, or 64 bits, respectively.
93These types should be used when memory storage is of
94concern, and when a specific size is not required.
95.Pp
96The type
97.Vt intmax_t
98provides a signed integer type large
99enough to hold any other signed integer.
100The type
101.Vt uintmax_t
102provides an unsigned integer type large
103enough to hold any other unsigned integer.
104These types are generally the largest signed and unsigned
105integer types available on a specific architecture.
106.Sh STANDARDS
107The
108.Aq Pa stdint.h
109header conforms to
110.St -isoC-99
111and
112.St -p1003.1-2001 .
113.Sh HISTORY
114The
115.Aq Pa stdint.h
116header was first introduced in
117.Fx 5.0 .
118.Sh BUGS
119Not all of the
120.Aq Pa stdint.h
121header's features are documented.
122