home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
gnu
/
gcc-2.6.3-bin.lha
/
GNU
/
man
/
cat1
/
cccp.0
next >
Wrap
Text File
|
1994-02-08
|
17KB
|
463 lines
cpp(1) GNU Tools cpp(1)
NAME
cccp, cpp - The GNU C-Compatible Compiler Preprocessor.
SYNOPSIS
cccp [-$] [-A_p_r_e_d_i_c_a_t_e[(_v_a_l_u_e)]] [-C] [-D_n_a_m_e[=_d_e_f_i_n_i_t_i_o_n]]
[-dD] [-dM] [-I _d_i_r_e_c_t_o_r_y] [-H] [-I-] [-imacros _f_i_l_e]
[-include _f_i_l_e] [-idirafter _d_i_r] [-iprefix _p_r_e_f_i_x]
[-iwithprefix _d_i_r] [-lang-c] [-lang-c++] [-lang-objc]
[-lang-objc++] [-lint] [-M] [-MD] [-MM] [-MMD]
[-nostdinc] [-nostdinc++] [-P] [-pedantic]
[-pedantic-errors] [-traditional] [-trigraphs] [-U_n_a_m_e]
[-undef] [-Wtrigraphs] [-Wcomment] [-Wall]
[-Wtraditional]
[_i_n_f_i_l_e|-] [_o_u_t_f_i_l_e|-]
DESCRIPTION
The C preprocessor is a _m_a_c_r_o _p_r_o_c_e_s_s_o_r that is used au-
tomatically by the C compiler to transform your program be-
fore actual compilation. It is called a macro processor be-
cause it allows you to define _m_a_c_r_o_s, which are brief abbre-
viations for longer constructs.
The C preprocessor provides four separate facilities that
you can use as you see fit:
o+ Inclusion of header files. These are files of declara-
tions that can be substituted into your program.
o+ Macro expansion. You can define _m_a_c_r_o_s, which are ab-
breviations for arbitrary fragments of C code, and then
the C preprocessor will replace the macros with their
definitions throughout the program.
o+ Conditional compilation. Using special preprocessor
commands, you can include or exclude parts of the pro-
gram according to various conditions.
o+ Line control. If you use a program to combine or rear-
range source files into an intermediate file which is
then compiled, you can use line control to inform the
compiler of where each source line originally came
from.
C preprocessors vary in some details. For a full explana-
tion of the GNU C preprocessor, see the info file
`cpp.info', or the manual _T_h_e _C _P_r_e_p_r_o_c_e_s_s_o_r. Both of these
are built from the same documentation source file,
`cpp.texinfo'. The GNU C preprocessor provides a superset
of the features of ANSI Standard C.
ANSI Standard C requires the rejection of many harmless con-
structs commonly used by today's C programs. Such incompa-
GNU Tools Last change: 30apr1993 1
cpp(1) GNU Tools cpp(1)
tibility would be inconvenient for users, so the GNU C
preprocessor is configured to accept these constructs by de-
fault. Strictly speaking, to get ANSI Standard C, you must
use the options `-trigraphs', `-undef' and `-pedantic', but
in practice the consequences of having strict ANSI Standard
C make it undesirable to do this.
Most often when you use the C preprocessor you will not have
to invoke it explicitly: the C compiler will do so automati-
cally. However, the preprocessor is sometimes useful indi-
vidually.
When you call the preprocessor individually, either name
(cpp or cccp) will do-they are completely synonymous.
The C preprocessor expects two file names as arguments, _i_n_-
_f_i_l_e and _o_u_t_f_i_l_e. The preprocessor reads _i_n_f_i_l_e together
with any other files it specifies with `#include'. All the
output generated by the combined input files is written in
_o_u_t_f_i_l_e.
Either _i_n_f_i_l_e or _o_u_t_f_i_l_e may be `-', which as _i_n_f_i_l_e means
to read from standard input and as _o_u_t_f_i_l_e means to write to
standard output. Also, if _o_u_t_f_i_l_e or both file names are
omitted, the standard output and standard input are used for
the omitted file names.
OPTIONS
Here is a table of command options accepted by the C prepro-
cessor. These options can also be given when compiling a C
program; they are passed along automatically to the prepro-
cessor when it is invoked by the compiler.
-P Inhibit generation of `#'-lines with line-number infor-
mation in the output from the preprocessor. This might
be useful when running the preprocessor on something
that is not C code and will be sent to a program which
might be confused by the `#'-lines.
-C Do not discard comments: pass them through to the out-
put file. Comments appearing in arguments of a macro
call will be copied to the output before the expansion
of the macro call.
-traditional
Try to imitate the behavior of old-fashioned C, as op-
posed to ANSI C.
-trigraphs
Process ANSI standard trigraph sequences. These are
three-character sequences, all starting with `??', that
are defined by ANSI C to stand for single characters.
GNU Tools Last change: 30apr1993 2
cpp(1) GNU Tools cpp(1)
For example, `??/' stands for `\', so `'??/n'' is a
character constant for a newline. Strictly speaking,
the GNU C preprocessor does not support all programs in
ANSI Standard C unless `-trigraphs' is used, but if you
ever notice the difference it will be with relief.
You don't want to know any more about trigraphs.
-pedantic
Issue warnings required by the ANSI C standard in cer-
tain cases such as when text other than a comment fol-
lows `#else' or `#endif'.
-pedantic-errors
Like `-pedantic', except that errors are produced rath-
er than warnings.
-Wtrigraphs
Warn if any trigraphs are encountered (assuming they
are enabled).
-Wcomment
-Wcomments
Warn whenever a comment-start sequence `/*' appears in
a comment. (Both forms have the same effect).
-Wall
Requests both `-Wtrigraphs' and `-Wcomment' (but not
`-Wtraditional').
-Wtraditional
Warn about certain constructs that behave differently
in traditional and ANSI C.
-I _d_i_r_e_c_t_o_r_y
Add the directory _d_i_r_e_c_t_o_r_y to the end of the list of
directories to be searched for header files. This can
be used to override a system header file, substituting
your own version, since these directories are searched
before the system header file directories. If you use
more than one `-I' option, the directories are scanned
in left-to-right order; the standard system directories
come after.
-I- Any directories specified with `-I' options before the
`-I-' option are searched only for the case of `#in-
clude _f_i_l_e"'; they are not searched for `#include
<_f_i_l_e>'.
If additional directories are specified with `-I' op-
tions after the `-I-', these directories are searched
GNU Tools Last change: 30apr1993 3
cpp(1) GNU Tools cpp(1)
for all `#include' directives.
In addition, the `-I-' option inhibits the use of the
current directory as the first search directory for
`#include _f_i_l_e"'. Therefore, the current directory is
searched only if it is requested explicitly with `-I.'.
Specifying both `-I-' and `-I.' allows you to control
precisely which directories are searched before the
current one an