CHAR_BIT must be <i>at least</i> 8 bits, but is not a &quot;byte&quot; as used by the original comment.  The C standard defines &quot;byte&quot; differently from current common usage.  To get exactly 8 bits of the desired signedness, which may not be possible on systems with CHAR_BIT greater than 8, one must use <i>[u]int8_t</i>.<p>----<p>From a draft version of the C standard:<p>The typedef name intN_t designates a signed integer type with width N , no padding
bits, and a two’s complement representation. Thus, int8_t denotes such a signed
integer type with a width of exactly 8 bits.<p>The typedef name uintN_t designates an unsigned integer type with width N and no
padding bits. Thus, uint24_t denotes such an unsigned integer type with a width of
exactly 24 bits.<p>These types are optional. However, if an implementation provides integer types with
widths of 8, 16, 32, or 64 bits, no padding bits, and (for the signed types) that have a
two’s complement representation, it shall define the corresponding typedef names.