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

HP C Implementation-Defined Behavior
HP C/C++ Programmer’s Guide for NonStop Systems429301-008
A-15
G.3.1 Translation
corresponds to Annex G.3 of the ISO C standard or Appendix F of the ANSI C
standard.
G.3.1 Translation
Each nonempty sequence of white-space characters, other than newline, is retained.
The form of the diagnostic messages displayed by the TNS compiler is such that the
source line is displayed first, followed by a line of the form: file name line diagnostic-
type: diagnostic message. For example:
100 foo ();
**** \prune.$data.test.testc 100 Warning 95:
prototype function declaration not in scope: “foo”
There are different classes of messages. They are:
ERROR
WARNING
The translator return status code for each class of message is:
0 = Normal, voluntary termination with no errors or warnings.
1 = Normal, voluntary termination with warning diagnostics.
2 = Abnormal, voluntary termination with warning diagnostics.
The level of diagnostic can be controlled. Control takes the following form:
For ERROR, the ERRORS pragma directs the compiler to terminate compilation if it
detects more than a specified number of errors. If the ERRORS pragma is not used,
the compiler completes a compilation regardless of the number of errors it
diagnoses.
For WARNING, the WARN pragma controls the generation of all or selected warning
messages. The WARN pragma enables the compiler to generate all or a selected
set of warning messages, and the NOWARN pragma disables the compiler from
generating all or a selected set of warning messages. The compiler defaults to
WARN, which enables all warning messages.
G.3.2 Environment
No library facilities are available to a freestanding program.
In a freestanding environment, program termination is as follows:
The program termination phase of execution begins when a program returns from
the function main, calls the exit() library function, or calls the
terminate_program() library function. In each case, the C library flushes all file
buffers, closes all open files, and causes the process to complete with a certain
completion code, depending on what caused the termination.
When the process returns from main with no return value, the process stops with a
completion code of 0, normal termination.