C/C++ Programmer's Guide (G06.25+)
Compiling, Binding, and Accelerating TNS C++
Programs
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
15-9
Working in the Guardian Environment
Object
specifies the file to which the TNS C compiler writes the TNS object code. If you do
not specify an object file, the TNS C compiler writes the TNS object code to the file
OBJECT in your current default volume and subvolume. If OBJECT cannot be
created, the compiler writes the object code to the file ZZBInnnn (where nnnn is a
unique four-digit number) in your current default volume and subvolume.
pragma
is a C compiler pragma.
The following TNS C compiler pragmas are intended for Cprep and can appear
only in this Cprep run command syntax or in the C++ source code:
Pragmas NOXMEM and SQL are invalid for C++. If either of these pragmas appear,
Cfront issues a warning and ignores the pragma.
Usage Guideline:
•
You can place pragmas intended for the TNS C compiler on the TNS C compiler
run command line. However, this practice is a likely source of errors in consistency
and configuration management, because these same pragmas can also appear on
the Cprep run command line. Therefore, whenever possible, you should place
pragmas in the original C++ source code or on the Cprep run command line. Cprep
passes the pragmas intended for the TNS C compiler through to Cfront for the TNS
C compiler.
Example:
•
In this example, the intermediate file intfile2, which was previously created by
Cfront, is now input to the TNS C compiler. The TNS C compiler produces the TNS
object file progo that you can now use to bind together with other TNS object files
to produce an executable TNS object file for the C++ program.
C/ IN intfile2, OUT $s.#hold/progo
File Formats
The input to Cprep is a C++ source file of a form acceptable to the TNS C run-time
library:
•
EDIT disk files, which are file type 101
•
C disk files, which are odd-unstructured files and are file type 180
•
Processes
[NO]CHECK RUNNABLE
COLUMNS SECTION (source code only)
ERRORS SSV (command line only)
[NO]NEST [NO]WARN
[NO]OLDCALLS [NO]WIDE