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

The NOXMEM pragma compiles only under the 16-bit data model. The combination of the WIDE
and NOXMEM pragmas is diagnosed as an error.
All translation units of a program must specify the same memory model. For more information
about the two memory models, see Two Memory Models: Large and Small (page 323).
The preprocessor variable __XMEM is defined when the XMEM pragma is in effect.
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.
[NO]XVAR
The pragma default settings are:
SYSTYPE OSSSYSTYPE GUARDIAN
XVARXVARTNS C compiler
XVARXVARG-series TNS c89 utility
N.A.N.A.TNS/R native C and C++ compilers
N.A.N.A.Native c89 and c99 utilities
N.A.N.A.TNS/E native C and C++ compilers
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.
All translation units of a program must specify the same data model. For more information,
see the discussion of memory models in Two Memory Models: Large and Small (page 323).
The native C and C++ compilers do not support the XVAR pragma. The native process memory
architecture makes them unnecessary.
NOTE: For more information about using the cross compilers to compile programs with embedded
SQL, see HP NonStop SQL/MX Release 3.2 Programming Manual for C and COBOL.
260 Compiler Pragmas