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-11
Working in the Guardian Environment
cfront/in intfile1, out intfile2/
c/in intfile2, out $s.#hold/progo
To run this program, enter:
run progo
The program will respond with the following:
Hello World
Error Messages in the Guardian Environment
This subsection provides information on the compile-time and run-time error messages
that are generated in the Guardian environment.
Compile-Time Error Messages
Cprep and Cfront generate completion codes and send error and warning messages to
stderr.
Cprep and Cfront each follow the standard HP convention of generating completion
codes to indicate the presence of error or warning messages. The completion codes
have the following significance:
If you are running Cprep or Cfront interactively, these completion codes appear on your
terminal screen as a source of information. For example, if Cfront encounters errors
and stops processing, it will emit the following message:
2: Process terminated with fatal errors or diagnostics
If you are running in batch mode, Cprep and Cfront sends completion codes to the
command interpreter. You can use TACL to check for these completion codes. For an
example of how to check for these completion codes, see the TACL macro in
Appendix B, TNS C++ Implementation-Defined Behavior.
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. The messages
generated by Cfront contain (CFRONT): at the start of the message.
The total count of errors and warnings appears as a comment after the error and
warning messages.
Cprep's error and warning messages that appear in stderr are a subset of those of
the TNS C compiler. For descriptions of the TNS C compiler error and warning
messages, see Section 20, TNS C Compiler Messages.
Completion Code Significance
1 Compilation completed with warnings, but no errors.
2 Errors occurred, and processing terminated.