C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)
◦ For a TNS/R C++ version 2 program, CPPINIT2 (Guardian) or cppinit2.o (On OSS
environment or PC)
◦ For TNS/R C++ version 3 program, CPPINIT4 (Guardian) or cppinit4.o (On OSS
environment or PC)
• The CALL_SHARED and SHARED pragmas cannot be used with the SRL or NON_SHARED
pragmas. A warning is issued if these pragmas are combined.
• EXTERN_DATA gp_ok is not compatible with generation of shared code. The compiler issues
a warning if this pragma is combined with the SHARED pragma or CALL_SHARED, and ignores
the GP_OK directive.
• For complete information about programming with DLLs and linker options for DLLs, see the:
DLL Programmer’s Guide for TNS/R Systems◦
◦ DLL Programmer’s Guide for TNS/E Systems
◦ eld Manual
◦ ld Manual
◦ rld Manual
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.
[NO]CHECK
The pragma default settings are:
SYSTYPE OSSSYSTYPE GUARDIAN
NOCHECKCHECKTNS C compiler
NOCHECKCHECKG-series TNS c89 utility
N.A.N.A.TNS/R native C and C++ compilers
N.A.N.A.Native c89 and c99 utilities
N.A.N.A.TNS/E native C and C++ compilers
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
178 Compiler Pragmas