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

UsePragma
disables the TNS C compiler from generating warning messages 134 and 135.
C compiler messages 134 and 135 warn that a function was used before it was
NOWARN(134, 135)
declared. Cfront turns off these warning messages because the #include
preprocessor directives in your C++ source code that declare the standard
C header files are expanded by Cprep. Therefore, the C compiler would not see
the #include directives and would emit warning messages anytime your
program calls a standard C function.
directs the TNS C compiler to search a given object file when attempting to resolve
external references. If your program has multiple compilation units, use Binder to
SEARCH
combine the C object files produced by the TNS C compiler into one executable
C++ object file. If your program comprises a single compilation unit, you can use
the RUNNABLE pragma in the C++ source file or on the Cprep run command line
to direct the C compiler to produce an executable C++ object file without having
to run the Binder.When you specify the RUNNABLE pragma, Cfront automatically
generates the SEARCH pragma with either the C++ run-time library file libca or
libla specified. Because Cfront generates the SEARCH pragma, you do not
have to run Binder and specify the Binder SEARCH command for these files.
Cfront Run Command Syntax
You use this syntax to run Cfront:
CFRONT / IN intermediate-file1, OUT intermediate-file2 /
IN intermediate-file1
specifies the name of the file that contains the C++ source code that was output by Cprep.
OUT intermediate-file2
specifies the file to which Cfront writes the C source file. If you omit the OUT option, the output
goes to your current default output file, usually the terminal.
Usage Guidelines
Remember that the output that is produced from running Cfront is kept in an intermediate file.
Each time that you run Cfront, the output is added to the end of the file. Therefore, if
intermediate files exist, purge them before running Cfront again. The easiest way to do this
is to purge all intermediate files before running Cprep.
Cprep and Cfront both send error and warning messages to stderr. The default location
for stderr is the terminal. You can assign stderr to a specific file and collect all Cprep
and Cfront error and warning messages there.
To send error and warning messages to a file, assign stderr to the desired file name prior
to invoking Cprep. You assign stderr to a file name:
ASSIGN STDERR, file-name
To return to the default location, enter:
CLEAR ASSIGN STDERR
Example
In this example, the intermediate file intfile1, which was previously created by Cprep, is now
input to Cfront. An intermediate file, intfile2, is created by Cfront for later use by the C compiler.
CFRONT/ IN intfile1, OUT intfile2 /
TNS C Compiler Run Command Syntax
The TNS C compiler compiles the output from Cfront and produces a compiler listing and a TNS
object file, provided that the compiler encounters no errors during the compilation.
Working in the Guardian Environment 277