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

Table Of Contents
Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
13-27
EXTERN_DATA
°
The #assert preprocessing extensions of AT&T System V release 4 are
allowed. These allow definition and testing of predicate names. Such names
are in a namespace distinct from all other names, including macro names.
A predicate name is given a definition by a preprocessing directive of the form:
#assert name
#assert name (token-sequence)
which defines the predicate name. In the first form, the predicate is not given a
value. In the second form, it is given the value token-sequence. Such a
predicate can be tested in an #if expression:
#name (token-sequence)
which has the value 1 if a #assert of that name with that token-sequence
has appeared, and 0 otherwise. A predicate can be given more than one value
at a given time.
A predicate can be deleted by a preprocessing directive of the form:
#unassert name
#unassert name (token-sequence)
The first form removes all definitions of the indicated prediate name; the
second form removes just the indicated definition, leaving any others there
might be.
°
External entities declared in other scopes are visible. A warning is issued when
compiled with extensions. When compiled without extensions, an error is
issued. (This is not allowed in C++.)
void f1(void) {
extern void f();
}
void f2() {
f(); /* Using out of scope declaration */
}
EXTERN_DATA
The EXTERN_DATA pragma specifies whether external data references (object
declared extern) can use GP-relative addressing.
EXTERN_DATA value [variable-name [,variable-name]]
value:
{ GP_OK | NO_GP }