The
ANSI/ISO C standard specifies that C must support four signed and
four unsigned integer data types: char,
short, int,
and long. There
are few requirements imposed by the ANSI standard on the sizes of
these data types. According to the standard, int
and short should
be at least 16 bits; and long
should be at least as long as int,
but not smaller than 32 bits.
Traditionally, Kernighan and Ritchie (K&R) C assumes
int is the most
efficient or fastest integer data type on a
machine. ANSI C, with its integral promotion rule, continues this
assumption.
The HP-UX 32-bit data model is called ILP32
because ints,
longs, and pointers
are 32 bits.
The HP-UX 64-bit data model is called LP64
because longs
and pointers are 64 bits. In this model, ints
remain 32 bits.
 |
 |  |
 |
 | NOTE: The LP64 data model is the emerging standard on 64-bit
UNIX systems provided by leading system vendors. Applications that
transition to the LP64 data model on HP-UX systems are highly portable
to other LP64 vendor platforms. |
 |
 |  |
 |
Data Type Sizes |
 |
The
size of the base HP C data types under the HP-UX implementation
of ILP32 and LP64 are shown in Table 3-1 “HP C/HP-UX 32-bit and 64-bit Base Data
Types ”:
Table 3-1 HP C/HP-UX 32-bit and 64-bit Base Data
Types
Data Type | ILP32 Size (bits) | LP64 Size (bits) |
|---|
char | 8 | 8 |
short | 16 | 16 |
int | 32 | 32 |
long | 32 | 64 |
long long
[1] | 64 | 64 |
pointer | 32 | 64 |
float | 32 | 32 |
double | 64 | 64 |
long double | 128 | 128 |
enum
[2] | 32 | 32 |