C/C++ Programmer's Guide (G06.25+)

Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
13-112
WIDE
WIDE
The WIDE pragma specifies the data model, which defines the size of the data type
int. The WIDE pragma specifies the 32-bit data model. NOWIDE specifies the 16-bit
data model. (The 32-bit data model is also referred to as the wide-data model.)
The pragma default settings are:
Usage Guidelines
The WIDE pragma can be entered on the compiler RUN command line or in the
source text.
The TNS C++ translator, Cfront, is WIDE by default. The TNS C compiler is
effectively NOWIDE by default. To compile TNS C++ programs for the Guardian
environment that use the 32-bit data model, specify pragma WIDE in the C++
source file or on the TNS C++ preprocessor, Cprep, run command line.
In source text, the WIDE pragma must be specified before any declarations or
source code statements.
The native C and C++ compilers do not support these pragmas. Native compilers
generate only programs that use the 32-bit data model.
The WIDE pragma compiles only under the large-memory model. The combination
of the WIDE and NOXMEM pragmas is diagnosed as an error.
All translation units of a program must specify the same data model.
Programs composed of Guardian modules (modules compiled for the Guardian
environment) and OSS modules (modules compiled for the OSS environment)
must use the 32-bit data model.
For more information about the two data models, see Two Data Models: 16-Bit and
32-Bit on page 19-9.
The preprocessor variable __INT32 is defined when the WIDE pragma is in effect.
[NO]WIDE
SYSTYPE GUARDIAN SYSTYPE OSS
TNS C compiler Not set WIDE
G-series TNS c89 utility WIDE WIDE
TNS/R native C and C++ compilers N.A N.A.
Native c89 utility N.A N.A
TNS/E native C and C++ compilers N.A N.A