A data model defines the sizes assigned to standard data types. These data models are typically named using a XXXn pattern where X referes to a C type and n refers to a size (typically 32 or 64). ILP64, for example, means that int, long and pointer types are 64 bits wide, LP32 means that long and pointer are 32 bits wide, and LLP64 means that long long and pointer are 64 bits wide.
Data Type |
LP32 |
ILP32 |
ILP64 |
LLP64 |
LP64 |
|---|---|---|---|---|---|
char |
8 |
8 |
8 |
8 |
8 |
short |
16 |
16 |
16 |
16 |
16 |
int |
16 |
32 |
64 |
32 |
32 |
long |
32 |
32 |
64 |
32 |
64 |
long long |
|
|
|
64 |
|
pointer |
32 |
32 |
64 |
64 |
64 |
The following observations are derived from the Development Tutorial by Marco van de Voort \[van de Voort 07\]: |
long in C was that there are both codebases that expect pointer and long to have the same size, whileint and long to be the same size. The compability model LLP64 was designed tolong<->{{int}}compability by introducing a new type to remain compatible with pointer (long long)long long is only defined for LLP64.long and int, but looses type compability between long and pointer types. Any cast between a pointer and an existing type requires modification.van de Voort 07 Marco van de Voort. Development Tutorial (a.k.a Build FAQ). January 29, 2007. http://www.stack.nl/~marcov/buildfaq.pdf![]()
Open Group 97 Go Solo 2 - The Authorized Guide to Version 2 of the Single UNIX Specification. ISBN 0-13-575689-8. May 1997. http://www.unix.org/whitepapers/64bit.html![]()