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

Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
13-114
XVAR
XVAR
The XVAR pragma controls whether the TNS C compiler places subsequent global or
static aggregates in extended memory or in the user data segment. The XVAR pragma
causes the TNS C compiler to allocate space in extended memory for any global or
static aggregates that follow the pragma. NOXVAR causes the compiler to allocate
space in the user data segment for any subsequent global or static aggregates.
The default for the large-memory model and the 32-bit or wide-data model is XVAR. To
place a single global or static aggregate in the user data segment, precede it by
#pragma NOXVAR and follow it by #pragma XVAR.
The pragma default settings are:
Usage Guidelines
The XVAR pragma can be entered on the compiler RUN command line or in the
source text.
The TNS c89 utility does not support NOXVAR for Guardian or OSS modules.
The XVAR pragma has no affect unless the XMEM or WIDE pragma is also in effect.
You can use XVAR selectively, turning it on or off around declarations of different
variables, but you must apply it consistently for each declaration of the same
variable.
Buffers used in certain Guardian procedure calls must be forced into the user data
segment by use of NOXVAR so that they will be 16-bit addressable.
For more details, see the discussion of memory models in Two Memory Models:
Large and Small on page 19-7.
The native C and C++ compilers do not support the XVAR pragma. The native
process memory architecture makes them unnecessary.
[NO]XVAR
SYSTYPE
GUARDIAN SYSTYPE OSS
TNS C compiler XVAR XVAR
G-series TNS c89 utility XVAR XVAR
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.