C/C++ Programmer's Guide (G06.25+)

Compiling, Binding, and Accelerating TNS C++
Programs
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
15-7
Working in the Guardian Environment
Cfront Run Command Syntax
You use the following syntax to run Cfront:
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.
NOWARN(134, 135) 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 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.
SEARCH 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 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 / IN intermediate-file1, OUT intermediate-file2 /
Pragma Use (continued)