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

Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
13-28
EXTERN_DATA
EXTERN_DATA
The EXTERN_DATA pragma specifies whether external data references (object
declared extern) can use GP-relative addressing.
GP_OK
means that GP-relative addressing is allowed. This value is not valid for the TNS/E
compilers.
NO_GP
means that GP-relative addressing must not be used. This is the value that
typically indicates that the data is exported by an SRL.
variable-name
identifies a variable that has previously been declared.
The pragma default settings are:
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
EXTERN_DATA value [variable-name [,variable-name]]
value:
{ GP_OK | NO_GP }
SYSTYPE GUARDIAN SYSTYPE OSS
TNS C compiler N.A. N.A.
G-series TNS c89 utility N.A. N.A.
TNS/R native C and C++ compilers EXTERN_DATA NO_GP EXTERN_DATA NO_GP
Native c89 utility EXTERN_DATA NO_GP EXTERN_DATA NO_GP
TNS/E native C and C++ compilers EXTERN_DATA NO_GP EXTERN_DATA NO_GP