<!DOCTYPE html PUBLIC "‐//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">     <html
xmlns="http://www.w3.org/1999/xhtml"> <head>
    <link            rel="stylesheet"             type="text/css"
href="../../../style.css" title="style" />
    <link  rel="stylesheet"  type="text/css"  href="../style.css"
title="style" />
    <meta             http‐equiv="content‐type"              con‐
tent="text/html;charset=utf‐8" />

    <title>stdint.h.0p ‐ Linux manual page</title> </head>

<body>

<div        class="page‐top"><a       id="top_of_page"></a></div>
<!‐‐%%%TOP_BAR%%%‐‐> <!‐‐%%%PAGE_START%%%‐‐>

<table class="sec‐table"> <tr>
    <td>
        <p class="section‐dir"> <a href="#PROLOG">PROLOG</a> | <a
href="#NAME">NAME</a>  |  <a  href="#SYNOPSIS">SYNOPSIS</a>  | <a
href="#DESCRIPTION">DESCRIPTION</a> |  <a  href="#APPLICATION_US‐
AGE">APPLICATION&nbsp;USAGE</a>   |  <a  href="#RATIONALE">RATIO‐
NALE</a>   |   <a    href="#FUTURE_DIRECTIONS">FUTURE&nbsp;DIREC‐
TIONS</a>    |   <a   href="#SEE_ALSO">SEE&nbsp;ALSO</a>   |   <a
href="#COPYRIGHT">COPYRIGHT</a>
        </p>
    </td>
    <td class="search‐box">
        <div class="man‐search‐box">

            <form                method="get"                 ac‐
tion="http://www.google.com/search">
                <fieldset class="man‐search">
                    <input    type="text"    name="q"   size="10"
maxlength="255" value="" />
                    <input type="hidden"  name="sitesearch"  val‐
ue="man7.org/linux/man‐pages" />
                    <input  type="submit" name="sa" value="Search
online pages" />
                </fieldset>
            </form>

        </div>
    </td>
    <td> </td> </tr> </table>

<pre> <span class="headline">stdint.h(0P)              POSIX Pro‐
grammer’s  Manual              stdint.h(0P)</span>  </pre> <h2><a
id="PROLOG" href="#PROLOG"></a>PROLOG  &nbsp; &nbsp; &nbsp;  &nb‐
sp;        <a        href="#top_of_page"><span        class="top‐
link">top</span></a></h2><pre>
       This manual page is part of the POSIX Programmer’s Manual.
The Linux
       implementation of this interface may differ (consult the
       corresponding  Linux  manual page for details of Linux be‐
havior), or
       the interface may not be implemented on Linux.

       delim $$  </pre>  <h2><a  id="NAME"  href="#NAME"></a>NAME
&nbsp;   &nbsp;   &nbsp;   &nbsp;   <a  href="#top_of_page"><span
class="top‐link">top</span></a></h2><pre>
       stdint.h  —  integer  types  </pre>  <h2><a  id="SYNOPSIS"
href="#SYNOPSIS"></a>SYNOPSIS   &nbsp;  &nbsp;  &nbsp;  &nbsp; <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       #include  &lt;stdint.h&gt;  </pre> <h2><a id="DESCRIPTION"
href="#DESCRIPTION"></a>DESCRIPTION  &nbsp; &nbsp; &nbsp;  &nbsp;
<a              href="#top_of_page"><span             class="top‐
link">top</span></a></h2><pre>
       Some of the functionality described on this reference page
extends
       the  ISO  C standard. Applications shall define the appro‐
priate feature
       test  macro  (see  the   System   Interfaces   volume   of
POSIX.1‐2008, <i>Section</i>
       <i>2.2</i>,  <i>The Compilation Environment</i>) to enable
the visibility of these
       symbols in this header.

       The <i>&lt;stdint.h&gt;</i> header shall declare  sets  of
integer types having
       specified  widths,  and shall define corresponding sets of
macros. It
       shall also define macros that specify  limits  of  integer
types
       corresponding to types defined in other standard headers.

       <b>Note:      </b>The  ‘‘width’’ of an integer type is the
number of bits used
                 to store its value in a pure binary system;  the
actual type
                 may  use  more  bits  than  that (for example, a
28‐bit type
                 could be stored in 32 bits of  actual  storage).
An <i>N</i>‐bit
                 signed type has values in the range −2<i>N</i>−1
or 1−2<i>N</i>−1 to
                 2<i>N</i>−1−1, while  an  <i>N</i>‐bit  unsigned
type has values in the
                 range 0 to 2<i>N</i>−1.

       Types are defined in the following categories:

        *  Integer types having certain exact widths

        *  Integer types having at least certain specified widths

        *   Fastest  integer types having at least certain speci‐
fied widths

        *  Integer types wide enough to hold pointers to objects

        *  Integer types having greatest width

       (Some of these types may denote the same type.)

       Corresponding macros specify limits of the declared  types
and
       construct suitable constants.

       For  each  type  described  herein that the implementation
provides, the
       <i>&lt;stdint.h&gt;</i> header shall declare that <b>type‐
def </b>name and define the
       associated  macros.  Conversely,  for  each type described
herein that
       the    implementation    does     not     provide,     the
<i>&lt;stdint.h&gt;</i> header shall not
       declare  that <b>typedef </b>name, nor shall it define the
associated macros.
       An implementation shall provide those types  described  as
required,
       but  need  not provide any of the others (described as op‐
tional).

   <b>Integer Types</b>
       When <b>typedef </b>names differing only in the absence or
presence of the
       initial  <i>u</i>  are  defined,  they shall denote corre‐
sponding signed and
       unsigned types as described in the ISO/IEC 9899:1999 stan‐
dard,
       Section  6.2.5;  an  implementation providing one of these
corresponding
       types shall also provide the other.

       In the following descriptions, the symbol <i>N</i>  repre‐
sents an unsigned
       decimal  integer  with no leading zeros (for example, 8 or
24, but not
       04 or 048).

        *  Exact‐width integer types

           The   <b>typedef   </b>name    <b>int</b><i>N</i><b>_t
</b>designates a signed integer type with
           width  <i>N</i>,  no padding bits, and a two’s‐comple‐
ment representation.
           Thus, <b>int8_t </b>denotes a signed integer type with
a width of
           exactly 8 bits.

           The   <b>typedef   </b>name   <b>uint</b><i>N</i><b>_t
</b>designates an unsigned integer type with
           width <i>N</i>.  Thus, <b>uint24_t </b>denotes an  un‐
signed integer type with a
           width of exactly 24 bits.

           The following types are required:

           <b>int8_t</b>
           <b>int16_t</b>
           <b>int32_t</b>
           <b>uint8_t</b>
           <b>uint16_t</b>
           <b>uint32_t</b>

           If an implementation provides integer types with width
64 that
           meet these requirements, then the following types  are
required:
           <b>int64_t uint64_t</b>

           In  particular,  this  will  be the case if any of the
following are
           true:

           ‐‐      The      implementation      supports      the
_POSIX_V7_ILP32_OFFBIG
               programming environment and the application is be‐
ing built in
               the _POSIX_V7_ILP32_OFFBIG programming environment
(see the
               Shell   and   Utilities  volume  of  POSIX.1‐2008,
<i>c99</i>, Programming
               Environments).

           ‐‐      The      implementation      supports      the
_POSIX_V7_LP64_OFF64
               programming environment and the application is be‐
ing built in
               the _POSIX_V7_LP64_OFF64 programming environment.

           ‐‐   The  implementation  supports  the  _POSIX_V7_LP‐
BIG_OFFBIG
               programming environment and the application is be‐
ing built in
               the  _POSIX_V7_LPBIG_OFFBIG  programming  environ‐
ment.

           All other types of this form are optional.

        *  Minimum‐width integer types

           The  <b>typedef </b>name <b>int_least</b><i>N</i><b>_t
</b>designates a signed integer type
           with a width of at least <i>N</i>, such that no signed
integer type with
           lesser  size  has  at least the specified width. Thus,
<b>int_least32_t</b>
           denotes a signed integer type with a width of at least
32 bits.

           The <b>typedef </b>name <b>uint_least</b><i>N</i><b>_t
</b>designates an unsigned integer
           type with a width of at least <i>N</i>, such  that  no
unsigned integer
           type  with  lesser  size  has  at  least the specified
width. Thus,
           <b>uint_least16_t </b>denotes an unsigned integer type
with a width of
           at least 16 bits.

           The  following  types  are  required:  <b>int_least8_t
int_least16_t</b>
           <b>int_least32_t      int_least64_t      uint_least8_t
uint_least16_t</b>
           <b>uint_least32_t uint_least64_t</b>

           All other types of this form are optional.

        *  Fastest minimum‐width integer types

           Each of the following types designates an integer type
that is
           usually fastest to  operate  with  among  all  integer
types that have
           at least the specified width.

           The  designated  type  is not guaranteed to be fastest
for all
           purposes; if the implementation has no  clear  grounds
for choosing
           one  type over another, it will simply pick some inte‐
ger type
           satisfying the signedness and width requirements.

           The <b>typedef  </b>name  <b>int_fast</b><i>N</i><b>_t
</b>designates the fastest signed
           integer  type  with a width of at least <i>N</i>.  The
<b>typedef </b>name
           <b>uint_fast</b><i>N</i><b>_t    </b>designates    the
fastest unsigned integer type with a
           width of at least <i>N</i>.

           The   following  types  are  required:  <b>int_fast8_t
int_fast16_t</b>
           <b>int_fast32_t       int_fast64_t        uint_fast8_t
uint_fast16_t</b>
           <b>uint_fast32_t uint_fast64_t</b>

           All other types of this form are optional.

        *  Integer types capable of holding object pointers

           The  following  type  designates a signed integer type
with the
           property that any valid pointer to <b>void </b>can  be
converted to this
           type, then converted back to a pointer to <b>void</b>,
and the result
           will compare equal to the original  pointer:  <b>intp‐
tr_t</b>

           The following type designates an unsigned integer type
with the
           property that any valid pointer to <b>void </b>can  be
converted to this
           type, then converted back to a pointer to <b>void</b>,
and the result
           will compare equal to the original pointer:  <b>uintp‐
tr_t</b>

           On  XSI‐conformant  systems,  the  <b>intptr_t </b>and
<b>uintptr_t </b>types are
           required; otherwise, they are optional.

        *  Greatest‐width integer types

           The following type designates a  signed  integer  type
capable of
           representing  any  value  of  any signed integer type:
<b>intmax_t</b>

           The following type designates an unsigned integer type
capable of
           representing  any  value of any unsigned integer type:
<b>uintmax_t</b>

           These types are required.

       <b>Note:     </b>Applications can test for optional  types
by using the
                 corresponding  limit  macro  from  <i>Limits  of
Specified‐Width</i>
                 <i>Integer Types</i>.

   <b>Limits of Specified‐Width Integer Types</b>
       The following macros specify the minimum and maximum  lim‐
its of the
       types declared in the <i>&lt;stdint.h&gt;</i> header. Each
macro name corresponds
       to a similar type name in <i>Integer Types</i>.

       Each instance of any defined macro shall be replaced by  a
constant
       expression  suitable  for  use in <b>#if </b>preprocessing
directives, and this
       expression shall have the same type as would an expression
that is an
       object  of  the  corresponding type converted according to
the integer
       promotions.  Its  implementation‐defined  value  shall  be
equal to or
       greater in magnitude (absolute value) than the correspond‐
ing value
       given below, with the same sign, except where stated to be
exactly
       the given value.

        *  Limits of exact‐width integer types

           ‐‐   Minimum  values  of  exact‐width  signed  integer
types:

               {INT<i>N</i>_MIN}      Exactly −($2"^" N−1$)

           ‐‐   Maximum  values  of  exact‐width  signed  integer
types:

               {INT<i>N</i>_MAX}      Exactly $2"^" N−1$ −1

           ‐‐   Maximum  values  of  exact‐width unsigned integer
types:

               {UINT<i>N</i>_MAX}     Exactly $2"^" N$ −1

        *  Limits of minimum‐width integer types

           ‐‐  Minimum values  of  minimum‐width  signed  integer
types:

               {INT_LEAST<i>N</i>_MIN}
                               −($2"^" N−1$ −1)

           ‐‐   Maximum  values  of  minimum‐width signed integer
types:

               {INT_LEAST<i>N</i>_MAX}
                               $2"^" N−1$ −1

           ‐‐  Maximum values of minimum‐width  unsigned  integer
types:

               {UINT_LEAST<i>N</i>_MAX}
                               $2"^" N$ −1

        *  Limits of fastest minimum‐width integer types

           ‐‐  Minimum values of fastest minimum‐width signed in‐
teger types:

               {INT_FAST<i>N</i>_MIN} −($2"^" N−1$ −1)

           ‐‐  Maximum values of fastest minimum‐width signed in‐
teger types:

               {INT_FAST<i>N</i>_MAX} $2"^" N−1$ −1

           ‐‐   Maximum  values of fastest minimum‐width unsigned
integer
               types:

               {UINT_FAST<i>N</i>_MAX}
                               $2"^" N$ −1

        *  Limits of integer  types  capable  of  holding  object
pointers

           ‐‐   Minimum  value  of pointer‐holding signed integer
type:

               {INTPTR_MIN}    −($2"^" 15$ −1)

           ‐‐  Maximum value of  pointer‐holding  signed  integer
type:

               {INTPTR_MAX}    $2"^" 15$ −1

           ‐‐   Maximum value of pointer‐holding unsigned integer
type:

               {UINTPTR_MAX}   $2"^" 16$ −1

        *  Limits of greatest‐width integer types

           ‐‐  Minimum value  of  greatest‐width  signed  integer
type:

               {INTMAX_MIN}    −($2"^" 63$ −1)

           ‐‐   Maximum  value  of  greatest‐width signed integer
type:

               {INTMAX_MAX}    $2"^" 63$ −1

           ‐‐  Maximum value of greatest‐width  unsigned  integer
type:

               {UINTMAX_MAX}   $2"^" 64$ −1

   <b>Limits of Other Integer Types</b>
       The  following macros specify the minimum and maximum lim‐
its of
       integer types corresponding  to  types  defined  in  other
standard
       headers.

       Each  instance of these macros shall be replaced by a con‐
stant
       expression suitable for use  in  <b>#if  </b>preprocessing
directives, and this
       expression shall have the same type as would an expression
that is an
       object of the corresponding type  converted  according  to
the integer
       promotions.  Its  implementation‐defined  value  shall  be
equal to or
       greater in magnitude (absolute value) than the correspond‐
ing value
       given below, with the same sign.

        *  Limits of <b>ptrdiff_t</b>:

           {PTRDIFF_MIN}   −65535

           {PTRDIFF_MAX}   +65535

        *  Limits of <b>sig_atomic_t</b>:

           {SIG_ATOMIC_MIN}
                           See below.

           {SIG_ATOMIC_MAX}
                           See below.

        *  Limit of <b>size_t</b>:

           {SIZE_MAX}      65535

        *  Limits of <b>wchar_t</b>:

           {WCHAR_MIN}     See below.

           {WCHAR_MAX}     See below.

        *  Limits of <b>wint_t</b>:

           {WINT_MIN}      See below.

           {WINT_MAX}      See below.

       If  <b>sig_atomic_t  </b>(see  the <i>&lt;signal.h&gt;</i>
header) is defined as a signed
       integer type, the value of {SIG_ATOMIC_MIN}  shall  be  no
greater than
       −127  and  the  value of {SIG_ATOMIC_MAX} shall be no less
than 127;
       otherwise, <b>sig_atomic_t </b>shall be defined as an  un‐
signed integer type,
       and the value of {SIG_ATOMIC_MIN} shall be 0 and the value
of
       {SIG_ATOMIC_MAX} shall be no less than 255.

       If <b>wchar_t </b>(see the <i>&lt;stddef.h&gt;</i> header)
is defined as a signed integer
       type,  the  value  of {WCHAR_MIN} shall be no greater than
−127 and the
       value of {WCHAR_MAX} shall be no less than 127; otherwise,
<b>wchar_t</b>
       shall be defined as an unsigned integer type, and the val‐
ue of
       {WCHAR_MIN} shall be 0 and the value of {WCHAR_MAX}  shall
be no less
       than 255.

       If  <b>wint_t  </b>(see the <i>&lt;wchar.h&gt;</i> header)
is defined as a signed integer
       type, the value of {WINT_MIN} shall  be  no  greater  than
−32767 and the
       value  of  {WINT_MAX}  shall be no less than 32767; other‐
wise, <b>wint_t</b>
       shall be defined as an unsigned integer type, and the val‐
ue of
       {WINT_MIN} shall be 0 and the value of {WINT_MAX} shall be
no less
       than 65535.

   <b>Macros for Integer Constant Expressions</b>
       The following macros expand to  integer  constant  expres‐
sions suitable
       for  initializing  objects  that have integer types corre‐
sponding to
       types defined in the <i>&lt;stdint.h&gt;</i> header.  Each
macro name corresponds
       to a similar type name listed under <i>Minimum‐width inte‐
ger types</i> and
       <i>Greatest‐width integer types</i>.

       Each invocation of one of these macros shall expand to  an
integer
       constant expression suitable for use in <b>#if </b>prepro‐
cessing directives.
       The type of the expression shall have  the  same  type  as
would an
       expression  that  is  an  object of the corresponding type
converted
       according to the integer promotions. The value of the  ex‐
pression
       shall be that of the argument.

       The  argument  in any instance of these macros shall be an
unsuffixed
       integer constant with a value that  does  not  exceed  the
limits for the
       corresponding type.

        *  Macros for minimum‐width integer constant expressions

           The  macro <i>INTN_C</i>(<i>value</i>) shall expand to
an integer constant
           expression     corresponding     to      the      type
<b>int_least</b><i>N</i><b>_t</b>.  The macro
           <i>UINTN_C</i>(<i>value</i>)  shall expand to an inte‐
ger constant expression
           corresponding          to           the           type
<b>uint_least</b><i>N</i><b>_t</b>.  For example, if
           <b>uint_least64_t  </b>is  a  name for the type <b>un‐
signed long long</b>, then
           <i>UINT64_C</i>(0x123) might  expand  to  the  integer
constant 0x123ULL.

        *  Macros for greatest‐width integer constant expressions

           The following macro expands to an integer constant ex‐
pression
           having the value specified by  its  argument  and  the
type <b>intmax_t</b>:
           INTMAX_C(<i>value</i>)

           The following macro expands to an integer constant ex‐
pression
           having the value specified by  its  argument  and  the
type
           <b>uintmax_t</b>: UINTMAX_C(<i>value</i>)

       <i>The  following  sections  are  informative.</i>  </pre>
<h2><a  id="APPLICATION_USAGE"  href="#APPLICATION_USAGE"></a>AP‐
PLICATION    USAGE     &nbsp;    &nbsp;    &nbsp;    &nbsp;    <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       None.     </pre>   <h2><a   id="RATIONALE"   href="#RATIO‐
NALE"></a>RATIONALE    &nbsp;    &nbsp;    &nbsp;    &nbsp;    <a
href="#top_of_page"><span                             class="top‐
link">top</span></a></h2><pre>
       The <i>&lt;stdint.h&gt;</i> header  is  a  subset  of  the
<i>&lt;inttypes.h&gt;</i> header more
       suitable for use in freestanding environments, which might
not
       support the formatted I/O functions. In some environments,
if the
       formatted  conversion  support  is  not wanted, using this
header instead
       of the <i>&lt;inttypes.h&gt;</i>  header  avoids  defining
such a large number of
       macros.

       As  a  consequence  of adding <b>int8_t</b>, the following
are true:

        *  A byte is exactly 8 bits.

        *  {CHAR_BIT} has the value 8, {SCHAR_MAX} has the  value
127,
           {SCHAR_MIN}  has  the  value −128, and {UCHAR_MAX} has
the value
           255.

       (The POSIX standard explicitly  requires  8‐bit  char  and
two’s‐
       complement  arithmetic.)   </pre> <h2><a id="FUTURE_DIREC‐
TIONS"  href="#FUTURE_DIRECTIONS"></a>FUTURE  DIRECTIONS   &nbsp;
&nbsp;  &nbsp;  &nbsp;  <a  href="#top_of_page"><span class="top‐
link">top</span></a></h2><pre>
       <b>typedef </b>names beginning with <b>int </b>or  <b>uint
</b>and ending with _t may be
       added  to the types defined in the <i>&lt;stdint.h&gt;</i>
header. Macro names
       beginning with INT or UINT and ending with _MAX, _MIN,  or
_C may be
       added to the macros defined in the <i>&lt;stdint.h&gt;</i>
header.  </pre> <h2><a id="SEE_ALSO" href="#SEE_ALSO"></a>SEE AL‐
SO   &nbsp;  &nbsp;  &nbsp;  &nbsp;  <a href="#top_of_page"><span
class="top‐link">top</span></a></h2><pre>
       <a   href="../man0/inttypes.h.0p.html">inttypes.h(0p)</a>,
<a      href="../man0/signal.h.0p.html">signal.h(0p)</a>,      <a
href="../man0/stddef.h.0p.html">stddef.h(0p)</a>,              <a
href="../man0/wchar.h.0p.html">wchar.h(0p)</a>

       The  System  Interfaces volume of POSIX.1‐2008, <i>Section
2.2</i>, <i>The</i>
       <i>Compilation  Environment</i>  </pre>  <h2><a  id="COPY‐
RIGHT" href="#COPYRIGHT"></a>COPYRIGHT  &nbsp; &nbsp; &nbsp; &nb‐
sp;        <a        href="#top_of_page"><span        class="top‐
link">top</span></a></h2><pre>
       Portions  of  this  text  are  reprinted and reproduced in
electronic form
       from IEEE Std 1003.1, 2013 Edition, Standard for  Informa‐
tion
       Technology ‐‐ Portable Operating System Interface (POSIX),
The Open
       Group Base Specifications Issue 7, Copyright (C)  2013  by
the
       Institute of Electrical and Electronics Engineers, Inc and
The Open
       Group.  (This is POSIX.1‐2008 with the 2013 Technical Cor‐
rigendum 1
       applied.)  In  the  event  of any discrepancy between this
version and
       the original IEEE and The Open Group Standard, the  origi‐
nal IEEE and
       The Open Group Standard is the referee document. The orig‐
inal
       Standard    can    be    obtained     online     at     <a
href="http://www.unix.org/online.html">http://www.unix.org/on‐
line.html</a> .

       Any typographical or formatting errors that appear in this
page are
       most  likely to have been introduced during the conversion
of the
       source files to man page format. To  report  such  errors,
see
       <a      href="https://www.kernel.org/doc/man‐pages/report‐
ing_bugs.html">https://www.kernel.org/doc/man‐pages/report‐
ing_bugs.html</a> .

<span  class="footline">IEEE/The  Open Group                 2013
stdint.h(0P)</span> </pre>

<hr class="end‐man‐text" />

<hr class="start‐footer" />

<div class="footer">

<table class="colophon‐table">
    <tr>
    <td class="pub‐info">
        <p>
            HTML rendering created 2019‐08‐02
            by  <a  href="http://man7.org/mtk/index.html">Michael
Kerrisk</a>,
            author of
            <a  href="http://man7.org/tlpi/"><em>The  Linux  Pro‐
gramming Interface</em></a>,
            maintainer of the
            <a href="https://www.kernel.org/doc/man‐pages/">Linux
<em>man‐pages</em> project</a>.
        </p>
        <p>
            For details of in‐depth
            <strong>Linux/UNIX  system programming training cour‐
ses</strong>
            that I teach,  look  <a  href="http://man7.org/train‐
ing/">here</a>.
        </p>
        <p>
            Hosting    by    <a   href="http://www.jambit.com/in‐
dex_en.html">jambit GmbH</a>.
        </p>
        <p>
            <a href="http://validator.w3.org/check?uri=referer">
            <img src="http://www.w3.org/Icons/valid‐xhtml11"
                alt="Valid XHTML 1.1" height="31" width="88" />
            </a>
        </p>
    </td>
    <td class="colophon‐divider">
    </td>
    <td class="tlpi‐cover">
        <a                      href="http://man7.org/tlpi/"><img
src="http://man7.org/tlpi/cover/TLPI‐front‐cover‐vsmall.png"
alt="Cover of TLPI" /></a>
    </td>
    </tr> </table>

</div>

<hr class="end‐footer" />

</body> </html>