C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

23 LP64 Data Model
Support for the LP64 Data Model
In H06.24 and later H-series RVUs and in J06.13 and later J-series RVUs, OSS supports a new
LP64 data model, along with the existing default ILP32 data model. The LP64 data model is used
to create 64-bit OSS user processes. The C/C++ compiler allows the user to compile an OSS
application in ILP32 as well as in LP64 mode.
In the ILP32 data model, the data types: int, long, and pointers are 32-bit in size. Whereas,
in the LP64 data model, the data types: long and pointers are 64-bit and ints continue to
be 32-bit in size. Table 59 summarizes the size (in bits) of the various C/C++ data types.
Table 59 Size (in bits) for the various C/C++ Data Types
LP64 data modelILP32 data modelData Types
88char
1616short
3232int
6432long
6464long long
6432void *
3232enum
6432& (address of)
1
3232float
6464double
1
The address taken from an item referenced via a 64-bit pointer produces a 64-bit address.
Selecting the Data Model on the Command-Line
The default data model is ILP32. You can override the default with the following command-line
directives
-Wlp64
is the OSS and Windows command-line directive to specify the LP64 data model.
LP64
is the Guardian command-line directive to specify the LP64 data model.
-Wilp32
is the OSS and Windows command-line directive to specify the ILP32 data model, this is the default
option.
ILP32
is the Guardian command-line directive to specify the ILP32 data model, this is the default option.
Command Line Restrictions
The LP64 data model does not support the following CCOMP options :
SQL
SYSTYPE GUARDIAN
The LP64 data model does not support the following CPPCOMP options :
VERSION2
Support for the LP64 Data Model 391