C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

To use this macro, the name of your C++ source file must end in the letter “c.” For example, the
command syntax to compile a C++ program located in file helloc is:
cplus hello
If the name of your C++ source file does not end in the letter “c,” you should either rename your
source file or modify the cplus macro.
C Preprocessor Cprep
Cprep is a general-purpose C preprocessor. Cprep performs these functions:
Expands all preprocessor directives
Uses certain C compiler pragmas and passes the rest to Cfront for the C compiler
Generates #line directives specifying original C++ source file and edit line number
Produces a TNS C++ source file that is the input for Cfront
Expansion of Preprocessor Directives
Cprep includes files as directed by #include directives and SSV compiler pragmas. If any SSV
compiler pragmas are specified, they must appear on the Cprep run command line. In addition,
Cprep expands all the preprocessor directives.
C Compiler Pragmas Used by Cprep
Cprep recognizes certain C compiler pragmas. These pragmas are used by Cprep and where
relevant they are passed through. These pragmas must appear on the Cprep run command line
or in the C++ source code. Cprep recognizes these pragmas. Table 38 lists the C compiler pragmas
used by Cprep.
Table 38 C Compiler Pragmas Used by Cprep
RUNNABLE[NO]CHECK
SECTION (source code only)COLUMNS
SSV (command line only)ERRORS
[NO]WARN[NO]NEST
[NO]WIDE[NO]OLDCALLS
All other C compiler pragmas are passed through to the file created by Cprep and are used by
the C compiler.
The TNS C++ translator, Cfront, is WIDE by default. The TNS C compiler is effectively NOWIDE by
default. To compile TNS C++ programs that use the 32-bit data model for the Guardian environment,
specify pragma WIDE in the C++ source file or on the TNS C++ preprocessor, Cprep, run command
line.
For a complete description of all the C compiler pragmas, see Chapter 13: Compiler Pragmas.
Generation of #line Directives
Cprep generates #line directives indicating the original C++ source file, edit line number, and
timestamp. These #line directives appear in the output from Cprep and are also propagated
through to the output of Cfront. These #line directives are generated to support source-level
debugging and to support generation of error messages from Cfront. The symbolic debuggers use
the #line directive information to map from object code to the corresponding location in the
C++ source code.
The first time a file is referenced, the #line directive has the form:
#line edit-line-number "source-file-name timestamp"
274 Compiling, Binding, and Accelerating TNS C++ Programs