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

Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
13-27
EXTENSIONS
°
In an initializer, a pointer constant value can be cast to an integral type if the
integral type is large enough to contain it.
°
long float is accepted as a synonym for double. (C and C++ behavior is
the same.)
°
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, as follows:
#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 */
}