CPP(1) | General Commands Manual | CPP(1) |
cpp
— C
preprocessor
cpp |
[-ACEMPtVv ] [-D
macro[=value]]
[-d flags]
[-I path]
[-i file]
[-S path]
[-U macro]
[infile | -]
[outfile] |
The cpp
utility is a macro preprocessor
used by the pcc(1) compiler. It is mainly used to include
header files, expand macro definitions, discard comments, and perform
conditional compilation. cpp
is written to comply
with the ISO/IEC 9899:1999
(“ISO C99”) specification.
The infile input file is optional. If not
provided or the file name is "-" (dash),
cpp
reads its initial file from standard input. The
outfile output file is also optional, with output
written to standard output if not provided.
The options are as follows:
-A
-C
-D
macro[=value]#define
macro value
directive had appeared in the source. If value is not set on the command-line, then a value of 1 is used.
-d
flagsany unknown flags are ignored.
-E
-I
path-S
option). -I
may be
specified multiple times and is cumulative.-i
file#include
"file"
directive had appeared in the source.
-i
may be specified multiple times to include
several files.
-M
-P
-S
path-S
option may be specified multiple times and is cumulative.-t
__TIME__
, __DATE__
,
__STDC__
, and
__STDC_VERSION__
macros.-U
macro#undef
macro
directive had appeared in the source.
-V
-V
can be repeated for
greater detail. (This is only available if the cpp
program was built with PCC_DEBUG
defined, which is
the default).-v
The -D
, -i
and
-U
options are processed in the order that they
appear on the command line, before any input is read but after the command
line options have been scanned.
Files referenced by the “#include” directive as
"...", are first looked for in the current directory, then as per
⟨...⟩ files, which are first looked for in the list of
directories provided by any -I
options, then in the
list of system directories provided by any -S
options. Note that cpp
does not define any include
directories by default; if no -I
or
-S
options are given, then only the current
directory will be searched and no system files will be found.
A few macros are interpreted inside the
cpp
program:
cpp
conforms to ISO/IEC 9899:1999
(“ISO C99”).Also see the -t
option.
The cpp
utility exits with one of the
following values:
-E
option was given, and warnings were
issued.The cpp
command comes from the original
Portable C Compiler by S. C. Johnson, written in the
late 70's. The code originates from the V6 preprocessor with some additions
from V7 cpp and ansi/c99 support.
A lot of the PCC code was rewritten by Anders Magnusson.
This product includes software developed or owned by Caldera International, Inc.
February 26, 2013 | Debian |