|  |  15.1.2 C Data Type Sizes 
The C language defines data types in terms of a minimum size, rather
than an exact size.  As of this writing, this mainly matters for the
types intandlong.  A variable of typeintmust be
at least 16 bits, and is often 32 bits.  A variable of typelongmust be at least 32 bits, and is sometimes 64 bits. 
The range of a 16 bit number is -32768 to 32767 for a signed number, or
0 to 65535 for an unsigned number.  If a variable may hold numbers
larger than 16 bits, use longrather thanint.  Never
assume thatintorlonghave a specific size, or that they
will overflow at a particular point.  When appropriate, use variables of
system defined types rather thanintorlong: 
 
size_tUse this to hold the size of an object, as returned by sizeof.ptrdiff_tUse this to hold the difference between two pointers into the same
array.
time_tUse this to hold a time value as returned by the timefunction.off_tOn a Unix system, use this to hold a file position as returned by
lseek.ssize_tUse this to hold the result of the Unix readorwritefunctions. 
Some books on C recommend using typedefs to specify types of particular
sizes, and then adjusting those typedefs on specific systems.
GNU Autotools supports this using the `AC_CHECK_SIZEOF' macro.
However, while we agree with using typedefs for clarity, we do not
recommend using them purely for portability.  It is safest to rely only
on the minimum size assumptions made by the C language, rather than to
assume that a type of a specific size will always be available.  Also,
most C compilers will define intto be the most efficient type
for the system, so it is normally best to simply useintwhen
possible. 
 |