C/C++ Programmer's Guide (G06.25+)
Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
13-14
CHECK
CHECK
The CHECK pragma controls the inclusion of run-time error-checking code in the object
file. The CHECK pragma directs the TNS C compiler to include these run-time checks,
and NOCHECK directs it to omit them.
The pragma default settings are:
Usage Guidelines
•
In the Guardian environment, the CHECK pragma must be entered on the compiler
RUN command line. In the OSS environment, the CHECK pragma must be
entered in the source file.
•
If one of the run-time checks controlled by the CHECK pragma discovers an
inconsistency, it prints a stack trace to the standard error file and terminates
program execution.
•
The run-time checks diagnose several inconsistencies, including:
°
Attempted conversion of a byte pointer to a word pointer when the byte pointer
points to an odd byte address
°
Attempted conversion of a 32-bit pointer to a 16-bit pointer when the 32-bit
pointer points to an address in extended memory
°
Library calls that do not specify valid values for arguments
•
The run-time checks provided by the CHECK pragma can slow the execution of
your program. Consequently, you should use CHECK only when developing and
debugging your program.
•
The native C and C++ compilers do not support these pragmas. The native C run-
time library does not provide the additional parameter checking provided by the
TNS C run-time library.
[NO]CHECK
SYSTYPE GUARDIAN SYSTYPE OSS
TNS C compiler CHECK NOCHECK
G-series TNS c89 utility CHECK NOCHECK
TNS/R native C and C++ compilers N.A. N.A.
Native c89 utility N.A. N.A.
TNS/E native C and C++ compilers N.A. N.A.