Phases of translation
The compiler processes a source file into an executable
in eight conceptual steps, which are called phases of translation.
While some of these phases may actually be folded together,
the compiler behaves as if they occur separately, in sequence.
Output from certain phases may be saved and examined
by specifying option flags on the
are replaced by their single-character equivalents.
Trigraph sequences are explained in
Any source lines that end with a backslash and new-line
are spliced together with the next line
by deleting the backslash and new-line to form logical lines.
The source file is partitioned into preprocessing
tokens and sequences of white-space characters.
is, in effect, replaced by one space character.
Preprocessing tokens are explained in
are executed, and
Any files named in
are processed from phase 1 through phase 4, recursively.
are converted to their character equivalents.
Adjacent character string literals,
and wide character string literals, are concatenated.
Each preprocessing token is converted into a
The resulting tokens are syntactically and semantically analyzed and translated.
All external object and function references are resolved.
Libraries are linked
to satisfy external references not
defined in the current translation unit.
All translator output is collected into a program image
which contains information needed for execution.
The preprocessing token sequence resulting
from Phase 4 can be saved by using the following options:
Output from Phase 7 can be saved in a file with a .o
extension by using the -c option to cc.
The output of Phase 8 is the compilation system's final output
leaves preprocessed output in a file with a .i extension.
sends preprocessed output to the standard output.
Source files and tokenization
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003