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

The pragma default settings are:
SYSTYPE OSSSYSTYPE GUARDIAN
N.A.N.A.TNS C compiler
N.A.N.A.G-series TNS c89 utility
EXTERN_DATA NO_GPEXTERN_DATA NO_GPTNS/R native C and C++ compilers
EXTERN_DATA NO_GPEXTERN_DATA NO_GPNative c89 utility
N.A.N.A.c99 utility
EXTERN_DATA NO_GPEXTERN_DATA NO_GPTNS/E native C and C++ compilers
Usage Guidelines
The EXTERN_DATA pragma can be entered on the compiler RUN command line or in the
source text. It can also be specified with the -Wextern_data flag of the c89 utility.
If no variable-name is given, the pragma sets the global default, which remains in effect
until the next EXTERN_DATA pragma. This form of the pragma can appear in source code,
in the compiler RUN command line, or in a c89 flag.
If a variable-name is given, the pragma sets the addressing type to use for only the specified
variable. This form of the pragma can appear only in the source. It must occur after the
declaration of variable-name.
EXTERN_DATA GP_OK is not compatible with generation of PIC (Position-Independent Code)
code. The TNS/R native compiler issues a warning if this pragma is combined with the SHARED
pragma or CALL_SHARED, and ignores the GP_OK directive. The TNS/E compiler ignores
this directive.
Specifying EXTERN_DATA GP_OK as the global default might prevent some ISO/ANSI C
Standard conforming programs from linking successfully. This might occur if the user program
uses SRL data but does not use the correct header file to declare the SRL data.
For example, the C run-time library is in an SRL, and all the data it exports (such as errno)
is SRL data. GP-addressing cannot be used to access SRL data. The nld utility issues an error
when an SRL data item is addressed through GP. You can correct this problem by doing one
of these:
Use the default value for EXTERN_DATA, which is NO_GP.
Use the correct header file to declare the SRL data.
Add a #pragma extern_data no_gp SRL-variable-name for each SRL data
object that the program explicitly declares.
EXTERN_DATA has no effect if the compilation specifies the SRL directive.
Examples
/* excerpt from <errno.h> */
#pragma push extern_data
#pragma extern_data no_gp
extern int errno; /* References to errno will not use
GP-relative addressing. */
#pragma pop extern_data
/* alternative form */
190 Compiler Pragmas