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

Table Of Contents
Running and Debugging C and C++ Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
19-10
Selecting Memory and Data Models
Note that the small-memory model and the 32-bit data model cannot be selected
together.
The default memory and data models used by the C compiler are determined by the
environment in which the C compiler runs and the SYSTYPE pragma setting, as shown
in Table 19-5. (The SYSTYPE pragma determines whether a program’s target is the
NonStop environment.) To change the default settings, specify any valid combination of
the XMEM, NOXMEM, WIDE, and NOWIDE pragmas.
The C compiler running in the OSS environment supports only the large-memory
model and 32-bit data model.
The memory model and data model selected determines the model-dependent library
file that you bind into a program. For more details, see Section 14, Compiling, Binding,
and Accelerating TNS C Programs, and Section 15, Compiling, Binding, and
Accelerating TNS C++ Programs.
Table 19-4. Relationship Between Memory Models and Data Models
Memory
Model Data Model
C Compiler
Pragmas
Size of
Pointer Size of Type int
Small 16-bit NOXMEM, NOWIDE 16-bit 16 bits
Small 32-bit or wide Not available 16-bit 32 bits
Large 16-bit XMEM, NOWIDE 32-bit 16 bits
Large 32-bit or wide XMEM, WIDE 32-bit 32 bits
Table 19-5. Default Memory and Data Models
Compiler
Environment SYSTYPE Pragma
Memory
Model
Data
Model
Pragma
Settings
Guardian GUARDIAN Large 16-bit XMEM, NOWIDE
Guardian OSS Large 32-bit XMEM, WIDE
OSS GUARDIAN Large 32-bit XMEM, WIDE
OSS OSS Large 32-bit XMEM, WIDE