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-74
PAGE
The pragma default settings are:
Usage Guidelines
The OVERFLOW_TRAPS pragma can be entered on the compiler RUN command
line or in the source text. It can also be specified with the -Woverflow_traps
flag of the c89 utility.
Multiple pragmas can be placed in the source code to turn on and off the
generation of code that traps on arithmetic overflow.
The OVERFLOW_TRAPS pragma in C mimics the overflow trapping code in pTAL
and the trapping behavior of the TNS C compiler. Code that traps on integer
overflow is generated only for signed arithmetic operations. Unsigned arithmetic
operations always truncate. Therefore, if your code uses only unsigned arithmetic
operations, the code does not trap on integer overflow.
For more details on arithmetic overflow and signals, see the Guardian
Programmers Guide
Example
#pragma NOOVERFLOW_TRAPS
void NoTraps (void) {
/* No trapping code generated */
}
#pragma OVERFLOW_TRAPS
void Traps (void) {
/* Generates trapping code */
}
#pragma NOOVERFLOW_TRAPS
/* Again, no trapping code generated */
PAGE
The PAGE pragma causes a page eject in the compiler listing and prints a page
heading. The page eject occurs only when the output is being directed to a printer or
spooler device.
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 NOOVERFLOW_TRAPS NOOVERFLOW_TRAPS
Native c89 utility NOOVERFLOW_TRAPS NOOVERFLOW_TRAPS
TNS/E native C and C++ compilers NOOVERFLOW_TRAPS NOOVERFLOW_TRAPS
PAGE [ "title-string" ]