Commit 553a0668 by Zack Weinberg

cpp.texi: Revised and brought up to date.


* doc/cpp.texi: Revised and brought up to date.
* doc/cpp.1: Regenerate.

[[Split portion of a mixed commit.]]

From-SVN: r43395.2
parent f3c9b853
.\" Automatically generated by Pod::Man version 1.1 .\" Automatically generated by Pod::Man version 1.16
.\" Mon Feb 19 19:32:17 2001 .\" Fri Jun 15 00:04:02 2001
.\" .\"
.\" Standard preamble: .\" Standard preamble:
.\" ====================================================================== .\" ======================================================================
...@@ -138,67 +138,59 @@ ...@@ -138,67 +138,59 @@
.\" ====================================================================== .\" ======================================================================
.\" .\"
.IX Title "CPP 1" .IX Title "CPP 1"
.TH CPP 1 "gcc-3.1" "2001-02-19" "GNU" .TH CPP 1 "gcc-3.1" "2001-06-15" "GNU"
.UC .UC
.SH "NAME" .SH "NAME"
cpp \- The C Preprocessor cpp \- The C Preprocessor
.SH "SYNOPSIS" .SH "SYNOPSIS"
.IX Header "SYNOPSIS" .IX Header "SYNOPSIS"
cpp [\fB\-P\fR] [\fB\-C\fR] [\fB\-gcc\fR] [\fB\-traditional\fR] cpp [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
[\fB\-undef\fR] [\fB\-trigraphs\fR] [\fB\-pedantic\fR] [\fB\-I\fR\fIdir\fR...] [\fB\-W\fR\fIwarn\fR...]
[\fB\-W\fR\fIwarn\fR...] [\fB\-I\fR\fIdir\fR...] [\fB\-M\fR|\fB\-MM\fR] [\fB\-MG\fR] [\fB\-MF\fR \fIfilename\fR]
[\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR] [\fB\-MP\fR] [\fB\-MQ\fR \fItarget\fR...] [\fB\-MT\fR \fItarget\fR...]
[\fB\-A\fR\fIpredicate\fR(\fIanswer\fR)]
[\fB\-M\fR|\fB\-MM\fR][\fB\-MG\fR][\fB\-MF\fR\fIfilename\fR]
[\fB\-MP\fR][\fB\-MQ\fR\fItarget\fR...][\fB\-MT\fR\fItarget\fR...]
[\fB\-x\fR \fIlanguage\fR] [\fB\-std=\fR\fIstandard\fR] [\fB\-x\fR \fIlanguage\fR] [\fB\-std=\fR\fIstandard\fR]
\fIinfile\fR \fIoutfile\fR \fIinfile\fR \fIoutfile\fR
.PP .PP
Only the most useful options are listed here; see below for the remainder. Only the most useful options are listed here; see below for the remainder.
.SH "DESCRIPTION" .SH "DESCRIPTION"
.IX Header "DESCRIPTION" .IX Header "DESCRIPTION"
The C preprocessor is a \fImacro processor\fR that is used automatically The C preprocessor, often known as \fIcpp\fR, is a \fImacro processor\fR
by the C compiler to transform your program before actual compilation. that is used automatically by the C compiler to transform your program
It is called a macro processor because it allows you to define before compilation. It is called a macro processor because it allows
\&\fImacros\fR, which are brief abbreviations for longer constructs. you to define \fImacros\fR, which are brief abbreviations for longer
constructs.
.PP .PP
The C preprocessor is intended only for macro processing of C, \*(C+ and The C preprocessor is intended to be used only with C, \*(C+, and
Objective C source files. For macro processing of other files, you are Objective C source code. In the past, it has been abused as a general
strongly encouraged to use alternatives like M4, which will likely give text processor. It will choke on input which does not obey C's lexical
you better results and avoid many problems. For example, normally the C rules. For example, apostrophes will be interpreted as the beginning of
preprocessor does not preserve arbitrary whitespace verbatim, but character constants, and cause errors. Also, you cannot rely on it
instead replaces each sequence with a single space. preserving characteristics of the input which are not significant to
C-family languages. If a Makefile is preprocessed, all the hard tabs
will be removed, and the Makefile will not work.
.PP .PP
For use on C-like source files, the C preprocessor provides four Having said that, you can often get away with using cpp on things which
separate facilities that you can use as you see fit: are not C. Other Algol-ish programming languages are often safe
.Ip "\(bu" 4 (Pascal, Ada, etc.) So is assembly, with caution. \fB\-traditional\fR
Inclusion of header files. These are files of declarations that can be mode preserves more white space, and is otherwise more permissive. Many
substituted into your program. of the problems can be avoided by writing C or \*(C+ style comments
.Ip "\(bu" 4 instead of native language comments, and keeping macros simple.
Macro expansion. You can define \fImacros\fR, which are abbreviations .PP
for arbitrary fragments of C code, and then the C preprocessor will Wherever possible, you should use a preprocessor geared to the language
replace the macros with their definitions throughout the program. you are writing in. Modern versions of the \s-1GNU\s0 assembler have macro
.Ip "\(bu" 4 facilities. Most high level programming languages have their own
Conditional compilation. Using special preprocessing directives, you conditional compilation and inclusion mechanism. If all else fails,
can include or exclude parts of the program according to various try a true general text processor, such as \f(CW@docref\fR{M4}.
conditions.
.Ip "\(bu" 4
Line control. If you use a program to combine or rearrange 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.
.PP .PP
C preprocessors vary in some details. This manual discusses the \s-1GNU\s0 C C preprocessors vary in some details. This manual discusses the \s-1GNU\s0 C
preprocessor, which provides a small superset of the features of \s-1ISO\s0 preprocessor, which provides a small superset of the features of \s-1ISO\s0
Standard C. Standard C. In its default mode, the \s-1GNU\s0 C preprocessor does not do a
.PP few things required by the standard. These are features which are
In its default mode, the \s-1GNU\s0 C preprocessor does not do a few things rarely, if ever, used, and may cause surprising changes to the meaning
required by the standard. These are features which are rarely, if ever, of a program which does not expect them. To get strict \s-1ISO\s0 Standard C,
used, and may cause surprising changes to the meaning of a program which you should use the \fB\-std=c89\fR or \fB\-std=c99\fR options, depending
does not expect them. To get strict \s-1ISO\s0 Standard C, you should use the on which version of the standard you want. To get all the mandatory
\&\fB\-std=c89\fR or \fB\-std=c99\fR options, depending on which version diagnostics, you must also use \fB\-pedantic\fR.
of the standard you want. To get all the mandatory diagnostics, you
must also use \fB\-pedantic\fR.
.SH "OPTIONS" .SH "OPTIONS"
.IX Header "OPTIONS" .IX Header "OPTIONS"
The C preprocessor expects two file names as arguments, \fIinfile\fR and The C preprocessor expects two file names as arguments, \fIinfile\fR and
...@@ -211,353 +203,161 @@ Either \fIinfile\fR or \fIoutfile\fR may be \fB-\fR, which as ...@@ -211,353 +203,161 @@ Either \fIinfile\fR or \fIoutfile\fR may be \fB-\fR, which as
means to write to standard output. Also, if either file is omitted, it means to write to standard output. Also, if either file is omitted, it
means the same as if \fB-\fR had been specified for that file. means the same as if \fB-\fR had been specified for that file.
.PP .PP
Here is a table of command options accepted by the C preprocessor. All single-letter options which take an argument may have that argument
These options can also be given when compiling a C program; they are appear immediately after the option letter, or with a space between
passed along automatically to the preprocessor when it is invoked by the option and argument: \fB\-Ifoo\fR and \fB\-I foo\fR have the same
compiler. effect. Long options that take arguments require a space between option
.Ip "\fB\-P\fR" 4 and argument.
.IX Item "-P" .if n .Ip "\f(CW""\-D \f(CIname\f(CW""\fR" 4
Inhibit generation of \fB#\fR\-lines with line-number information in the .el .Ip "\f(CW\-D \f(CIname\f(CW\fR" 4
output from the preprocessor. This might be useful when running the .IX Item "-D name"
preprocessor on something that is not C code and will be sent to a Predefine \fIname\fR as a macro, with definition \fB1\fR.
program which might be confused by the \fB#\fR\-lines. .if n .Ip "\f(CW""\-D \f(CIname\f(CW=\f(CIdefinition\f(CW""\fR" 4
.Ip "\fB\-C\fR" 4 .el .Ip "\f(CW\-D \f(CIname\f(CW=\f(CIdefinition\f(CW\fR" 4
.IX Item "-C" .IX Item "-D name=definition"
Do not discard comments. All comments are passed through to the output Predefine \fIname\fR as a macro, with definition \fIdefinition\fR.
file, except for comments in processed directives, which are deleted There are no restrictions on the contents of \fIdefinition\fR, but if
along with the directive. Comments appearing in the expansion list of a you are invoking the preprocessor from a shell or shell-like program you
macro will be preserved, and appear in place wherever the macro is may need to use the shell's quoting syntax to protect characters such as
invoked. spaces that have a meaning in the shell syntax. If you use more than
.Sp one \fB\-D\fR for the same \fIname\fR, the rightmost definition takes
You should be prepared for side effects when using \fB\-C\fR; it causes effect.
the preprocessor to treat comments as tokens in their own right. For
example, macro redefinitions that were trivial when comments were
replaced by a single space might become significant when comments are
retained. Also, comments appearing at the start of what would be a
directive line have the effect of turning that line into an ordinary
source line, since the first token on the line is no longer a \fB#\fR.
.Ip "\fB\-traditional\fR" 4
.IX Item "-traditional"
Try to imitate the behavior of old-fashioned C, as opposed to \s-1ISO\s0 C.
.RS 4
.Ip "\(bu" 4
Traditional macro expansion pays no attention to single-quote or
double-quote characters; macro argument symbols are replaced by the
argument values even when they appear within apparent string or
character constants.
.Ip "\(bu" 4
Traditionally, it is permissible for a macro expansion to end in the
middle of a string or character constant. The constant continues into
the text surrounding the macro call.
.Ip "\(bu" 4
However, traditionally the end of the line terminates a string or
character constant, with no error.
.Ip "\(bu" 4
In traditional C, a comment is equivalent to no text at all. (In \s-1ISO\s0
C, a comment counts as whitespace.)
.Ip "\(bu" 4
Traditional C does not have the concept of a ``preprocessing number''.
It considers \fB1.0e+4\fR to be three tokens: \fB1.0e\fR, \fB+\fR,
and \fB4\fR.
.Ip "\(bu" 4
A macro is not suppressed within its own definition, in traditional C.
Thus, any macro that is used recursively inevitably causes an error.
.Ip "\(bu" 4
The character \fB#\fR has no special meaning within a macro definition
in traditional C.
.Ip "\(bu" 4
In traditional C, the text at the end of a macro expansion can run
together with the text after the macro call, to produce a single token.
(This is impossible in \s-1ISO\s0 C.)
.Ip "\(bu" 4
None of the \s-1GNU\s0 extensions to the preprocessor are available in
\&\fB\-traditional\fR mode.
.RE
.RS 4
.Sp
Use the \fB\-traditional\fR option when preprocessing Fortran code, so
that single-quotes and double-quotes within Fortran comment lines (which
are generally not recognized as such by the preprocessor) do not cause
diagnostics about unterminated character or string constants.
.Sp
However, this option does not prevent diagnostics about unterminated
comments when a C-style comment appears to start, but not end, within
Fortran-style commentary.
.Sp
So, the following Fortran comment lines are accepted with
\&\fB\-traditional\fR:
.Sp
.Vb 3
\& C This isn't an unterminated character constant
\& C Neither is "20000000000, an octal constant
\& C in some dialects of Fortran
.Ve
However, this type of comment line will likely produce a diagnostic, or
at least unexpected output from the preprocessor, due to the
unterminated comment:
.Sp .Sp
.Vb 2 If you wish to define a function-like macro on the command line, write
\& C Some Fortran compilers accept /* as starting its argument list with surrounding parentheses before the equals sign
\& C an inline comment. (if any). Parentheses are meaningful to most shells, so you will need
.Ve to quote the option. With \fBsh\fR and \fBcsh\fR,
Note that \f(CW\*(C`g77\*(C'\fR automatically supplies the \fB\-traditional\fR \&\fB\-D'\fR\fIname\fR\fB(\fR\fIargs...\fR\fB)=\fR\fIdefinition\fR\fB'\fR works.
option when it invokes the preprocessor. However, a future version of .if n .Ip "\f(CW""\-U \f(CIname\f(CW""\fR" 4
\&\f(CW\*(C`g77\*(C'\fR might use a different, more-Fortran-aware preprocessor in .el .Ip "\f(CW\-U \f(CIname\f(CW\fR" 4
place of \f(CW\*(C`cpp\*(C'\fR. .IX Item "-U name"
.RE Cancel any previous definition of \fIname\fR, either built in or
.Ip "\fB\-trigraphs\fR" 4 provided with a \fB\-D\fR option.
.IX Item "-trigraphs"
Process \s-1ISO\s0 standard trigraph sequences. These are three-character
sequences, all starting with \fB??\fR, that are defined by \s-1ISO\s0 C to
stand for single characters. For example, \fB??/\fR stands for
\&\fB\e\fR, so \fB'??/n'\fR is a character constant for a newline. By
default, \s-1GCC\s0 ignores trigraphs, but in standard-conforming modes it
converts them. See the \fB\-std\fR option.
.Sp .Sp
The nine trigraph sequences are All \fB\-imacros\fR \fIfile\fR and \fB\-include\fR \fIfile\fR options
.RS 4 are processed after all \fB\-D\fR and \fB\-U\fR options.
.Ip "\fB??(\fR" 4 .if n .Ip "\f(CW""\-undef""\fR" 4
.IX Item "??(" .el .Ip "\f(CW\-undef\fR" 4
-> \fB[\fR .IX Item "-undef"
.Ip "\fB??)\fR" 4 Do not predefine any system-specific macros. The common predefined
.IX Item "??)" macros remain defined.
-> \fB]\fR .if n .Ip "\f(CW""\-I \f(CIdir\f(CW""\fR" 4
.Ip "\fB??<\fR" 4 .el .Ip "\f(CW\-I \f(CIdir\f(CW\fR" 4
.IX Item "??<" .IX Item "-I dir"
-> \fB{\fR Add the directory \fIdir\fR to the list of directories to be searched
.Ip "\fB??>\fR" 4 for header files. Directories named by \fB\-I\fR
.IX Item "??>" are searched before the standard system include directories.
-> \fB}\fR
.Ip "\fB??=\fR" 4
.IX Item "??="
-> \fB#\fR
.Ip "\fB??/\fR" 4
.IX Item "??/"
-> \fB\e\fR
.Ip "\fB??'\fR" 4
.IX Item "??'"
-> \fB^\fR
.Ip "\fB??!\fR" 4
.IX Item "??!"
-> \fB|\fR
.Ip "\fB??-\fR" 4
.IX Item "??-"
-> \fB~\fR
.RE
.RS 4
.Sp .Sp
Trigraph support is not popular, so many compilers do not implement it It is dangerous to specify a standard system include directory in an
properly. Portable code should not rely on trigraphs being either \&\fB\-I\fR option. This defeats the special treatment of system
converted or ignored. headers. It can also defeat the repairs to
.RE buggy system headers which \s-1GCC\s0 makes when it is installed.
.Ip "\fB\-pedantic\fR" 4 .if n .Ip "\f(CW""\-o \f(CIfile\f(CW""\fR" 4
.IX Item "-pedantic" .el .Ip "\f(CW\-o \f(CIfile\f(CW\fR" 4
Issue warnings required by the \s-1ISO\s0 C standard in certain cases such .IX Item "-o file"
as when text other than a comment follows \fB#else\fR or \fB#endif\fR. Write output to \fIfile\fR. This is the same as specifying \fIfile\fR
.Ip "\fB\-pedantic-errors\fR" 4 as the second non-option argument to \fBcpp\fR. \fBgcc\fR has a
.IX Item "-pedantic-errors" different interpretation of a second non-option argument, so you must
Like \fB\-pedantic\fR, except that errors are produced rather than use \fB\-o\fR to specify the output file.
warnings. .if n .Ip "\f(CW""\-Wall""\fR" 4
.Ip "\fB\-Wcomment\fR" 4 .el .Ip "\f(CW\-Wall\fR" 4
.IX Item "-Wall"
Turns on all optional warnings which are desirable for normal code. At
present this is \fB\-Wcomment\fR and \fB\-Wtrigraphs\fR. Note that
many of the preprocessor's warnings are on by default and have no
options to control them.
.if n .Ip "\f(CW""\-Wcomment""\fR" 4
.el .Ip "\f(CW\-Wcomment\fR" 4
.IX Item "-Wcomment" .IX Item "-Wcomment"
.PD 0 .PD 0
.Ip "\fB\-Wcomments\fR" 4 .if n .Ip "\f(CW""\-Wcomments""\fR" 4
.el .Ip "\f(CW\-Wcomments\fR" 4
.IX Item "-Wcomments" .IX Item "-Wcomments"
.PD .PD
(Both forms have the same effect).
Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
comment, or whenever a backslash-newline appears in a \fB//\fR comment. comment, or whenever a backslash-newline appears in a \fB//\fR comment.
.Ip "\fB\-Wtrigraphs\fR" 4 (Both forms have the same effect.)
.if n .Ip "\f(CW""\-Wtrigraphs""\fR" 4
.el .Ip "\f(CW\-Wtrigraphs\fR" 4
.IX Item "-Wtrigraphs" .IX Item "-Wtrigraphs"
Warn if any trigraphs are encountered. This option used to take effect Warn if any trigraphs are encountered. This option used to take effect
only if \fB\-trigraphs\fR was also specified, but now works only if \fB\-trigraphs\fR was also specified, but now works
independently. Warnings are not given for trigraphs within comments, as independently. Warnings are not given for trigraphs within comments, as
we feel this is obnoxious. they do not affect the meaning of the program.
.Ip "\fB\-Wwhite-space\fR" 4 .if n .Ip "\f(CW""\-Wtraditional""\fR" 4
.IX Item "-Wwhite-space" .el .Ip "\f(CW\-Wtraditional\fR" 4
Warn about possible white space confusion, e.g. white space between a
backslash and a newline.
.Ip "\fB\-Wall\fR" 4
.IX Item "-Wall"
Requests \fB\-Wcomment\fR, \fB\-Wtrigraphs\fR, and \fB\-Wwhite-space\fR
(but not \fB\-Wtraditional\fR or \fB\-Wundef\fR).
.Ip "\fB\-Wtraditional\fR" 4
.IX Item "-Wtraditional" .IX Item "-Wtraditional"
Warn about certain constructs that behave differently in traditional and Warn about certain constructs that behave differently in traditional and
\&\s-1ISO\s0 C. \&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C
.RS 4 equivalent, and problematic constructs which should be avoided.
.Ip "\(bu" 4 .if n .Ip "\f(CW""\-Wimport""\fR" 4
Macro parameters that appear within string literals in the macro body. .el .Ip "\f(CW\-Wimport\fR" 4
In traditional C macro replacement takes place within string literals, .IX Item "-Wimport"
but does not in \s-1ISO\s0 C. Warn the first time \fB#import\fR is used.
.Ip "\(bu" 4 .if n .Ip "\f(CW""\-Wundef""\fR" 4
In traditional C, some preprocessor directives did not exist. .el .Ip "\f(CW\-Wundef\fR" 4
Traditional preprocessors would only consider a line to be a directive
if the \fB#\fR appeared in column 1 on the line. Therefore
\&\fB\-Wtraditional\fR warns about directives that traditional C
understands but would ignore because the \fB#\fR does not appear as the
first character on the line. It also suggests you hide directives like
\&\fB#pragma\fR not understood by traditional C by indenting them. Some
traditional implementations would not recognise \fB#elif\fR, so it
suggests avoiding it altogether.
.Ip "\(bu" 4
A function-like macro that appears without arguments.
.Ip "\(bu" 4
The unary plus operator.
.Ip "\(bu" 4
The `U' integer constant suffix. (Traditonal C does support the `L'
suffix on integer constants.) Note, these suffixes appear in macros
defined in the system headers of most modern systems, e.g. the _MIN/_MAX
macros in limits.h. Use of these macros can lead to spurious warnings
as they do not necessarily reflect whether the code in question is any
less portable to traditional C given that suitable backup definitions
are provided.
.RE
.RS 4
.RE
.Ip "\fB\-Wundef\fR" 4
.IX Item "-Wundef" .IX Item "-Wundef"
Warn if an undefined identifier is evaluated in an \fB#if\fR directive. Warn whenever an identifier which is not a macro is encountered in an
.Ip "\fB\-I\fR \fIdirectory\fR" 4 \&\fB#if\fR directive, outside of \fBdefined\fR. Such identifiers are
.IX Item "-I directory" replaced with zero.
Add the directory \fIdirectory\fR to the head of the list of .if n .Ip "\f(CW""\-Werror""\fR" 4
directories to be searched for header files. .el .Ip "\f(CW\-Werror\fR" 4
This can be used to override a system header file, substituting your .IX Item "-Werror"
own version, since these directories are searched before the system Make all warnings into hard errors. Source code which triggers warnings
header file directories. If you use more than one \fB\-I\fR option, will be rejected.
the directories are scanned in left-to-right order; the standard .if n .Ip "\f(CW""\-Wsystem\-headers""\fR" 4
system directories come after. .el .Ip "\f(CW\-Wsystem\-headers\fR" 4
.Ip "\fB\-I-\fR" 4 .IX Item "-Wsystem-headers"
.IX Item "-I-" Issue warnings for code in system headers. These are normally unhelpful
Any directories specified with \fB\-I\fR options before the \fB\-I-\fR in finding bugs in your own code, therefore suppressed. If you are
option are searched only for the case of \fB#include "\fR\fIfile\fR\fB"\fR; responsible for the system library, you may want to see them.
they are not searched for \fB#include <\fR\fIfile\fR\fB>\fR. .if n .Ip "\f(CW""\-w""\fR" 4
.Sp .el .Ip "\f(CW\-w\fR" 4
If additional directories are specified with \fB\-I\fR options after .IX Item "-w"
the \fB\-I-\fR, these directories are searched for all \fB#include\fR Suppress all warnings, including those which \s-1GNU\s0 \s-1CPP\s0 issues by default.
directives. .if n .Ip "\f(CW""\-pedantic""\fR" 4
.Sp .el .Ip "\f(CW\-pedantic\fR" 4
In addition, the \fB\-I-\fR option inhibits the use of the current .IX Item "-pedantic"
directory as the first search directory for \fB#include "\fR\fIfile\fR\fB"\fR. Issue all the mandatory diagnostics listed in the C standard. Some of
Therefore, the current directory is searched only if it is requested them are left out by default, since they trigger frequently on harmless
explicitly with \fB\-I.\fR. Specifying both \fB\-I-\fR and \fB\-I.\fR code.
allows you to control precisely which directories are searched before .if n .Ip "\f(CW""\-pedantic\-errors""\fR" 4
the current one and which are searched after. .el .Ip "\f(CW\-pedantic\-errors\fR" 4
.Ip "\fB\-nostdinc\fR" 4 .IX Item "-pedantic-errors"
.IX Item "-nostdinc" Issue all the mandatory diagnostics, and make all mandatory diagnostics
Do not search the standard system directories for header files. into errors. This includes mandatory diagnostics that \s-1GCC\s0 issues
Only the directories you have specified with \fB\-I\fR options without \fB\-pedantic\fR but treats as warnings.
(and the current directory, if appropriate) are searched. .if n .Ip "\f(CW""\-M""\fR" 4
.Sp .el .Ip "\f(CW\-M\fR" 4
By using both \fB\-nostdinc\fR and \fB\-I-\fR, you can limit the include-file
search path to only those directories you specify explicitly.
.Ip "\fB\-nostdinc++\fR" 4
.IX Item "-nostdinc++"
Do not search for header files in the \*(C+\-specific standard directories,
but do still search the other standard directories. (This option is
used when building the \*(C+ library.)
.Ip "\fB\-remap\fR" 4
.IX Item "-remap"
When searching for a header file in a directory, remap file names if a
file named \fIheader.gcc\fR exists in that directory. This can be used
to work around limitations of file systems with file name restrictions.
The \fIheader.gcc\fR file should contain a series of lines with two
tokens on each line: the first token is the name to map, and the second
token is the actual name to use.
.Ip "\fB\-D\fR \fIname\fR" 4
.IX Item "-D name"
Predefine \fIname\fR as a macro, with definition \fB1\fR.
.Ip "\fB\-D\fR \fIname\fR\fB=\fR\fIdefinition\fR" 4
.IX Item "-D name=definition"
Predefine \fIname\fR as a macro, with definition \fIdefinition\fR.
There are no restrictions on the contents of \fIdefinition\fR, but if
you are invoking the preprocessor from a shell or shell-like program you
may need to use the shell's quoting syntax to protect characters such as
spaces that have a meaning in the shell syntax. If you use more than
one \fB\-D\fR for the same \fIname\fR, the rightmost definition takes
effect.
.Sp
Any \fB\-D\fR and \fB\-U\fR options on the command line are processed in
order, and always before \fB\-imacros\fR \fIfile\fR, regardless of the
order in which they are written.
.Ip "\fB\-U\fR \fIname\fR" 4
.IX Item "-U name"
Do not predefine \fIname\fR.
.Sp
Any \fB\-D\fR and \fB\-U\fR options on the command line are processed in
order, and always before \fB\-imacros\fR \fIfile\fR, regardless of the
order in which they are written.
.Ip "\fB\-undef\fR" 4
.IX Item "-undef"
Do not predefine any nonstandard macros.
.Ip "\fB\-gcc\fR" 4
.IX Item "-gcc"
Define the macros \fI_\|_GNUC_\|_\fR, \fI_\|_GNUC_MINOR_\|_\fR and
\&\fI_\|_GNUC_PATCHLEVEL_\|_\fR. These are defined automatically when you use
\&\fBgcc \-E\fR; you can turn them off in that case with \fB\-no-gcc\fR.
.Ip "\fB\-A\fR \fIpredicate\fR\fB=\fR\fIanswer\fR" 4
.IX Item "-A predicate=answer"
Make an assertion with the predicate \fIpredicate\fR and answer
\&\fIanswer\fR. This form is preferred to the older form \fB\-A\fR
\&\fIpredicate\fR\fB(\fR\fIanswer\fR\fB)\fR, which is still supported, because
it does not use shell special characters.
.Ip "\fB\-A -\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4
.IX Item "-A -predicate=answer"
Disable an assertion with the predicate \fIpredicate\fR and answer
\&\fIanswer\fR. Specifying no predicate, by \fB\-A-\fR or \fB\-A -\fR,
disables all predefined assertions and all assertions preceding it on
the command line; and also undefines all predefined macros and all
macros preceding it on the command line.
.Ip "\fB\-dM\fR" 4
.IX Item "-dM"
Instead of outputting the result of preprocessing, output a list of
\&\fB#define\fR directives for all the macros defined during the
execution of the preprocessor, including predefined macros. This gives
you a way of finding out what is predefined in your version of the
preprocessor; assuming you have no file \fBfoo.h\fR, the command
.Sp
.Vb 1
\& touch foo.h; cpp -dM foo.h
.Ve
will show the values of any predefined macros.
.Ip "\fB\-dD\fR" 4
.IX Item "-dD"
Like \fB\-dM\fR except in two respects: it does \fInot\fR include the
predefined macros, and it outputs \fIboth\fR the \fB#define\fR
directives and the result of preprocessing. Both kinds of output go to
the standard output file.
.Ip "\fB\-dN\fR" 4
.IX Item "-dN"
Like \fB\-dD\fR, but emit only the macro names, not their expansions.
.Ip "\fB\-dI\fR" 4
.IX Item "-dI"
Output \fB#include\fR directives in addition to the result of
preprocessing.
.Ip "\fB\-M\fR" 4
.IX Item "-M" .IX Item "-M"
Instead of outputting the result of preprocessing, output a rule Instead of outputting the result of preprocessing, output a rule
suitable for \f(CW\*(C`make\*(C'\fR describing the dependencies of the main source suitable for \f(CW\*(C`make\*(C'\fR describing the dependencies of the main source
file. The preprocessor outputs one \f(CW\*(C`make\*(C'\fR rule containing the file. The preprocessor outputs one \f(CW\*(C`make\*(C'\fR rule containing the
object file name for that source file, a colon, and the names of all the object file name for that source file, a colon, and the names of all the
included files, including those coming from \fB\-include\fR or included files, including those coming from \fB\-include\fR or
\&\fB\-imacros\fR command line options. Unless specified explicitly (with \&\fB\-imacros\fR command line options.
\&\fB\-MT\fR or \fB\-MQ\fR), the object file name consists of the basename .Sp
of the source file with any suffix replaced with object file suffix. Unless specified explicitly (with \fB\-MT\fR or \fB\-MQ\fR), the
If there are many included files object file name consists of the basename of the source file with any
then the rule is split into several lines using \fB\e\fR\-newline. suffix replaced with object file suffix. If there are many included
.Ip "\fB\-MM\fR" 4 files then the rule is split into several lines using \fB\e\fR\-newline.
The rule has no commands.
.if n .Ip "\f(CW""\-MM""\fR" 4
.el .Ip "\f(CW\-MM\fR" 4
.IX Item "-MM" .IX Item "-MM"
Like \fB\-M\fR, but mention only the files included with \fB#include Like \fB\-M\fR, but mention only the files included with \fB#include
"\fR\fIfile\fR\fB"\fR or with \fB\-include\fR or \fB\-imacros\fR command line "\fR\fIfile\fR\fB"\fR or with \fB\-include\fR or \fB\-imacros\fR command line
options. System header files included with \fB#include <\fR\fIfile\fR\fB>\fR options. System header files included with \fB#include <\fR\fIfile\fR\fB>\fR
are omitted. are omitted.
.Ip "\fB\-MF\fR \fIfile\fR" 4 .if n .Ip "\f(CW""\-MF \f(CIfile\f(CW""\fR" 4
.el .Ip "\f(CW\-MF \f(CIfile\f(CW\fR" 4
.IX Item "-MF file" .IX Item "-MF file"
When used with \fB\-M\fR or \fB\-MM\fR, specifies a file to write the When used with \fB\-M\fR or \fB\-MM\fR, specifies a file to write the
dependencies to. This allows the preprocessor to write the preprocessed dependencies to. This allows the preprocessor to write the preprocessed
file to stdout normally. If no \fB\-MF\fR switch is given, \s-1CPP\s0 sends file to stdout normally. If no \fB\-MF\fR switch is given, \s-1CPP\s0 sends
the rules to stdout and suppresses normal preprocessed output. the rules to stdout and suppresses normal preprocessed output.
.Ip "\fB\-MG\fR" 4 .if n .Ip "\f(CW""\-MG""\fR" 4
.el .Ip "\f(CW\-MG\fR" 4
.IX Item "-MG" .IX Item "-MG"
When used with \fB\-M\fR or \fB\-MM\fR, \fB\-MG\fR says to treat missing When used with \fB\-M\fR or \fB\-MM\fR, \fB\-MG\fR says to treat missing
header files as generated files and assume they live in the same header files as generated files and assume they live in the same
...@@ -565,94 +365,76 @@ directory as the source file. It suppresses preprocessed output, as a ...@@ -565,94 +365,76 @@ directory as the source file. It suppresses preprocessed output, as a
missing header file is ordinarily an error. missing header file is ordinarily an error.
.Sp .Sp
This feature is used in automatic updating of makefiles. This feature is used in automatic updating of makefiles.
.Ip "\fB\-MP\fR" 4 .if n .Ip "\f(CW""\-MP""\fR" 4
.el .Ip "\f(CW\-MP\fR" 4
.IX Item "-MP" .IX Item "-MP"
This option instructs \s-1CPP\s0 to add a phony target for each dependency This option instructs \s-1CPP\s0 to add a phony target for each dependency
other than the main file, causing each to depend on nothing. These other than the main file, causing each to depend on nothing. These
dummy rules work around errors \f(CW\*(C`make\*(C'\fR gives if you remove header dummy rules work around errors \f(CW\*(C`make\*(C'\fR gives if you remove header
files without updating the \f(CW\*(C`Makefile\*(C'\fR to match. files without updating the \f(CW\*(C`Makefile\*(C'\fR to match.
.Sp .Sp
This is typical output:\- This is typical output:
.Sp .Sp
.Vb 1 .Vb 1
\& /tmp/test.o: /tmp/test.c /tmp/test.h \& test.o: test.c test.h
.Ve .Ve
.Vb 1 .Vb 1
\& /tmp/test.h: \& test.h:
.Ve .Ve
.Ip "\fB\-MQ\fR \fItarget\fR" 4 .if n .Ip "\f(CW""\-MT \f(CItarget\f(CW""\fR" 4
.IX Item "-MQ target" .el .Ip "\f(CW\-MT \f(CItarget\f(CW\fR" 4
.PD 0
.Ip "\fB\-MT\fR \fItarget\fR" 4
.IX Item "-MT target" .IX Item "-MT target"
.PD Change the target of the rule emitted by dependency generation. By
By default \s-1CPP\s0 uses the main file name, including any path, and appends default \s-1CPP\s0 takes the name of the main input file, including any path,
the object suffix, normally ``.o'', to it to obtain the name of the deletes any file suffix such as \fB.c\fR, and appends the platform's
target for dependency generation. With \fB\-MT\fR you can specify a usual object suffix. The result is the target.
target yourself, overriding the default one.
.Sp .Sp
If you want multiple targets, you can specify them as a single argument An \fB\-MT\fR option will set the target to be exactly the string you
to \fB\-MT\fR, or use multiple \fB\-MT\fR options. specify. If you want multiple targets, you can specify them as a single
argument to \fB\-MT\fR, or use multiple \fB\-MT\fR options.
.Sp .Sp
The targets you specify are output in the order they appear on the For example, \fB\-MT\ '$(objpfx)foo.o'\fR might give
command line. \fB\-MQ\fR is identical to \fB\-MT\fR, except that the
target name is quoted for Make, but with \fB\-MT\fR it isn't. For
example, \-MT '$(objpfx)foo.o' gives
.Sp .Sp
.Vb 1 .Vb 1
\& $(objpfx)foo.o: /tmp/foo.c \& $(objpfx)foo.o: foo.c
.Ve .Ve
but \-MQ '$(objpfx)foo.o' gives .if n .Ip "\f(CW""\-MQ \f(CItarget\f(CW""\fR" 4
.el .Ip "\f(CW\-MQ \f(CItarget\f(CW\fR" 4
.IX Item "-MQ target"
Same as \fB\-MT\fR, but it quotes any characters which are special to
Make. \fB\-MQ\ '$(objpfx)foo.o'\fR gives
.Sp .Sp
.Vb 1 .Vb 1
\& $$(objpfx)foo.o: /tmp/foo.c \& $$(objpfx)foo.o: foo.c
.Ve .Ve
The default target is automatically quoted, as if it were given with The default target is automatically quoted, as if it were given with
\&\fB\-MQ\fR. \&\fB\-MQ\fR.
.Ip "\fB\-H\fR" 4 .if n .Ip "\f(CW""\-MD \f(CIfile\f(CW""\fR" 4
.IX Item "-H" .el .Ip "\f(CW\-MD \f(CIfile\f(CW\fR" 4
Print the name of each header file used, in addition to other normal .IX Item "-MD file"
activities. .PD 0
.Ip "\fB\-imacros\fR \fIfile\fR" 4 .if n .Ip "\f(CW""\-MMD \f(CIfile\f(CW""\fR" 4
.IX Item "-imacros file" .el .Ip "\f(CW\-MMD \f(CIfile\f(CW\fR" 4
Process \fIfile\fR as input, discarding the resulting output, before .IX Item "-MMD file"
processing the regular input file. Because the output generated from .PD
\&\fIfile\fR is discarded, the only effect of \fB\-imacros\fR \fIfile\fR \&\fB\-MD\fR \fIfile\fR is equivalent to \fB\-M \-MF\fR \fIfile\fR, and
is to make the macros defined in \fIfile\fR available for use in the \&\fB\-MMD\fR \fIfile\fR is equivalent to \fB\-MM \-MF\fR \fIfile\fR.
main input. .Sp
.Ip "\fB\-include\fR \fIfile\fR" 4 Due to limitations in the compiler driver, you must use these switches
.IX Item "-include file" when you want to generate a dependency file as a side-effect of normal
Process \fIfile\fR as input, and include all the resulting output, compilation.
before processing the regular input file. .if n .Ip "\f(CW""\-x c""\fR" 4
.Ip "\fB\-idirafter\fR \fIdir\fR" 4 .el .Ip "\f(CW\-x c\fR" 4
.IX Item "-idirafter dir"
Add the directory \fIdir\fR to the second include path. The directories
on the second include path are searched when a header file is not found
in any of the directories in the main include path (the one that
\&\fB\-I\fR adds to).
.Ip "\fB\-iprefix\fR \fIprefix\fR" 4
.IX Item "-iprefix prefix"
Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
options. If the prefix represents a directory, you should include the
final \fB/\fR.
.Ip "\fB\-iwithprefix\fR \fIdir\fR" 4
.IX Item "-iwithprefix dir"
Add a directory to the second include path. The directory's name is
made by concatenating \fIprefix\fR and \fIdir\fR, where \fIprefix\fR was
specified previously with \fB\-iprefix\fR.
.Ip "\fB\-isystem\fR \fIdir\fR" 4
.IX Item "-isystem dir"
Add a directory to the beginning of the second include path, marking it
as a system directory, so that it gets the same special treatment as
is applied to the standard system directories.
.Ip "\fB\-x c\fR" 4
.IX Item "-x c" .IX Item "-x c"
.PD 0 .PD 0
.Ip "\fB\-x c++\fR" 4 .if n .Ip "\f(CW""\-x c++""\fR" 4
.el .Ip "\f(CW\-x c++\fR" 4
.IX Item "-x c++" .IX Item "-x c++"
.Ip "\fB\-x objective-c\fR" 4 .if n .Ip "\f(CW""\-x objective\-c""\fR" 4
.el .Ip "\f(CW\-x objective\-c\fR" 4
.IX Item "-x objective-c" .IX Item "-x objective-c"
.Ip "\fB\-x assembler-with-cpp\fR" 4 .if n .Ip "\f(CW""\-x assembler\-with\-cpp""\fR" 4
.el .Ip "\f(CW\-x assembler\-with\-cpp\fR" 4
.IX Item "-x assembler-with-cpp" .IX Item "-x assembler-with-cpp"
.PD .PD
Specify the source language: C, \*(C+, Objective-C, or assembly. This has Specify the source language: C, \*(C+, Objective-C, or assembly. This has
...@@ -668,10 +450,12 @@ generic mode. ...@@ -668,10 +450,12 @@ generic mode.
which selected both the language and the standards conformance level. which selected both the language and the standards conformance level.
This option has been removed, because it conflicts with the \fB\-l\fR This option has been removed, because it conflicts with the \fB\-l\fR
option. option.
.Ip "\fB\-std=\fR\fIstandard\fR" 4 .if n .Ip "\f(CW""\-std=\f(CIstandard\f(CW""\fR" 4
.el .Ip "\f(CW\-std=\f(CIstandard\f(CW\fR" 4
.IX Item "-std=standard" .IX Item "-std=standard"
.PD 0 .PD 0
.Ip "\fB\-ansi\fR" 4 .if n .Ip "\f(CW""\-ansi""\fR" 4
.el .Ip "\f(CW\-ansi\fR" 4
.IX Item "-ansi" .IX Item "-ansi"
.PD .PD
Specify the standard to which the code should conform. Currently cpp Specify the standard to which the code should conform. Currently cpp
...@@ -729,18 +513,243 @@ The 1999 C standard plus \s-1GNU\s0 extensions. ...@@ -729,18 +513,243 @@ The 1999 C standard plus \s-1GNU\s0 extensions.
.RE .RE
.RS 4 .RS 4
.RE .RE
.Ip "\fB\-ftabstop=NUMBER\fR" 4 .if n .Ip "\f(CW""\-I\-""\fR" 4
.IX Item "-ftabstop=NUMBER" .el .Ip "\f(CW\-I\-\fR" 4
Set the distance between tab stops. This helps the preprocessor .IX Item "-I-"
report correct column numbers in warnings or errors, even if tabs appear Split the include path. Any directories specified with \fB\-I\fR
on the line. Values less than 1 or greater than 100 are ignored. The options before \fB\-I-\fR are searched only for headers requested with
default is 8. \&\fB#include\ "\f(BIfile\fB"\fR; they are not searched for
.Ip "\fB\-$\fR" 4 \&\fB#include\ <\f(BIfile\fB>\fR. If additional directories are
specified with \fB\-I\fR options after the \fB\-I-\fR, those
directories are searched for all \fB#include\fR directives.
.Sp
In addition, \fB\-I-\fR inhibits the use of the directory of the current
file directory as the first search directory for \fB#include\ "\f(BIfile\fB"\fR.
.if n .Ip "\f(CW""\-nostdinc""\fR" 4
.el .Ip "\f(CW\-nostdinc\fR" 4
.IX Item "-nostdinc"
Do not search the standard system directories for header files.
Only the directories you have specified with \fB\-I\fR options
(and the directory of the current file, if appropriate) are searched.
.if n .Ip "\f(CW""\-nostdinc++""\fR" 4
.el .Ip "\f(CW\-nostdinc++\fR" 4
.IX Item "-nostdinc++"
Do not search for header files in the \*(C+\-specific standard directories,
but do still search the other standard directories. (This option is
used when building the \*(C+ library.)
.if n .Ip "\f(CW""\-include \f(CIfile\f(CW""\fR" 4
.el .Ip "\f(CW\-include \f(CIfile\f(CW\fR" 4
.IX Item "-include file"
Process \fIfile\fR as if \f(CW\*(C`#include "file"\*(C'\fR appeared as the first
line of the primary source file. However, the first directory searched
for \fIfile\fR is the preprocessor's working directory \fIinstead of\fR
the directory containing the main source file. If not found there, it
is searched for in the remainder of the \f(CW\*(C`#include "..."\*(C'\fR search
chain as normal.
.Sp
If multiple \fB\-include\fR options are given, the files are included
in the order they appear on the command line.
.if n .Ip "\f(CW""\-imacros \f(CIfile\f(CW""\fR" 4
.el .Ip "\f(CW\-imacros \f(CIfile\f(CW\fR" 4
.IX Item "-imacros file"
Exactly like \fB\-include\fR, except that any output produced by
scanning \fIfile\fR is thrown away. Macros it defines remain defined.
This allows you to acquire all the macros from a header without also
processing its declarations.
.Sp
All files specified by \fB\-imacros\fR are processed before all files
specified by \fB\-include\fR.
.if n .Ip "\f(CW""\-idirafter \f(CIdir\f(CW""\fR" 4
.el .Ip "\f(CW\-idirafter \f(CIdir\f(CW\fR" 4
.IX Item "-idirafter dir"
Search \fIdir\fR for header files, but do it \fIafter\fR all
directories specified with \fB\-I\fR and the standard system directories
have been exhausted. \fIdir\fR is treated as a system include directory.
.if n .Ip "\f(CW""\-iprefix \f(CIprefix\f(CW""\fR" 4
.el .Ip "\f(CW\-iprefix \f(CIprefix\f(CW\fR" 4
.IX Item "-iprefix prefix"
Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
options. If the prefix represents a directory, you should include the
final \fB/\fR.
.if n .Ip "\f(CW""\-iwithprefix \f(CIdir\f(CW""\fR" 4
.el .Ip "\f(CW\-iwithprefix \f(CIdir\f(CW\fR" 4
.IX Item "-iwithprefix dir"
.PD 0
.if n .Ip "\f(CW""\-iwithprefixbefore \f(CIdir\f(CW""\fR" 4
.el .Ip "\f(CW\-iwithprefixbefore \f(CIdir\f(CW\fR" 4
.IX Item "-iwithprefixbefore dir"
.PD
Append \fIdir\fR to the prefix specified previously with
\&\fB\-iprefix\fR, and add the resulting directory to the include search
path. \fB\-iwithprefixbefore\fR puts it in the same place \fB\-I\fR
would; \fB\-iwithprefix\fR puts it where \fB\-idirafter\fR would.
.Sp
Use of these options is discouraged.
.if n .Ip "\f(CW""\-isystem \f(CIdir\f(CW""\fR" 4
.el .Ip "\f(CW\-isystem \f(CIdir\f(CW\fR" 4
.IX Item "-isystem dir"
Search \fIdir\fR for header files, after all directories specified by
\&\fB\-I\fR but before the standard system directories. Mark it
as a system directory, so that it gets the same special treatment as
is applied to the standard system directories.
.if n .Ip "\f(CW""\-fpreprocessed""\fR" 4
.el .Ip "\f(CW\-fpreprocessed\fR" 4
.IX Item "-fpreprocessed"
Indicate to the preprocessor that the input file has already been
preprocessed. This suppresses things like macro expansion, trigraph
conversion, escaped newline splicing, and processing of most directives.
In this mode the integrated preprocessor is little more than a tokenizer
for the front ends.
.Sp
\&\fB\-fpreprocessed\fR is implicit if the input file has one of the
extensions \fB.i\fR, \fB.ii\fR or \fB.mi\fR. These are the
extensions that \s-1GCC\s0 uses for preprocessed files created by
\&\fB\-save-temps\fR.
.if n .Ip "\f(CW""\-ftabstop=\f(CIwidth\f(CW""\fR" 4
.el .Ip "\f(CW\-ftabstop=\f(CIwidth\f(CW\fR" 4
.IX Item "-ftabstop=width"
Set the distance between tab stops. This helps the preprocessor report
correct column numbers in warnings or errors, even if tabs appear on the
line. If the value is less than 1 or greater than 100, the option is
ignored. The default is 8.
.if n .Ip "\f(CW""\-fno\-show\-column""\fR" 4
.el .Ip "\f(CW\-fno\-show\-column\fR" 4
.IX Item "-fno-show-column"
Do not print column numbers in diagnostics. This may be necessary if
diagnostics are being scanned by a program that does not understand the
column numbers, such as \f(CW\*(C`dejagnu\*(C'\fR.
.if n .Ip "\f(CW""\-A \f(CIpredicate\f(CW=\f(CIanswer\f(CW""\fR" 4
.el .Ip "\f(CW\-A \f(CIpredicate\f(CW=\f(CIanswer\f(CW\fR" 4
.IX Item "-A predicate=answer"
Make an assertion with the predicate \fIpredicate\fR and answer
\&\fIanswer\fR. This form is preferred to the older form \fB\-A\fR
\&\fIpredicate\fR\fB(\fR\fIanswer\fR\fB)\fR, which is still supported, because
it does not use shell special characters.
.if n .Ip "\f(CW""\-A \-\f(CIpredicate\f(CW=\f(CIanswer\f(CW""\fR" 4
.el .Ip "\f(CW\-A \-\f(CIpredicate\f(CW=\f(CIanswer\f(CW\fR" 4
.IX Item "-A -predicate=answer"
Cancel an assertion with the predicate \fIpredicate\fR and answer
\&\fIanswer\fR.
.if n .Ip "\f(CW""\-A\-""\fR" 4
.el .Ip "\f(CW\-A\-\fR" 4
.IX Item "-A-"
Cancel all predefined assertions and all assertions preceding it on
the command line. Also, undefine all predefined macros and all
macros preceding it on the command line. (This is a historical wart and
may change in the future.)
.if n .Ip "\f(CW""\-dM""\fR" 4
.el .Ip "\f(CW\-dM\fR" 4
.IX Item "-dM"
Instead of the normal output, generate a list of \fB#define\fR
directives for all the macros defined during the execution of the
preprocessor, including predefined macros. This gives you a way of
finding out what is predefined in your version of the preprocessor.
Assuming you have no file \fBfoo.h\fR, the command
.Sp
.Vb 1
\& touch foo.h; cpp -dM foo.h
.Ve
will show all the predefined macros.
.if n .Ip "\f(CW""\-dD""\fR" 4
.el .Ip "\f(CW\-dD\fR" 4
.IX Item "-dD"
Like \fB\-dM\fR except in two respects: it does \fInot\fR include the
predefined macros, and it outputs \fIboth\fR the \fB#define\fR
directives and the result of preprocessing. Both kinds of output go to
the standard output file.
.if n .Ip "\f(CW""\-dN""\fR" 4
.el .Ip "\f(CW\-dN\fR" 4
.IX Item "-dN"
Like \fB\-dD\fR, but emit only the macro names, not their expansions.
.if n .Ip "\f(CW""\-dI""\fR" 4
.el .Ip "\f(CW\-dI\fR" 4
.IX Item "-dI"
Output \fB#include\fR directives in addition to the result of
preprocessing.
.if n .Ip "\f(CW""\-P""\fR" 4
.el .Ip "\f(CW\-P\fR" 4
.IX Item "-P"
Inhibit generation of linemarkers 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
linemarkers.
.if n .Ip "\f(CW""\-C""\fR" 4
.el .Ip "\f(CW\-C\fR" 4
.IX Item "-C"
Do not discard comments. All comments are passed through to the output
file, except for comments in processed directives, which are deleted
along with the directive. Comments appearing in the expansion list of a
macro will be preserved, and appear in place wherever the macro is
invoked.
.Sp
You should be prepared for side effects when using \fB\-C\fR; it causes
the preprocessor to treat comments as tokens in their own right. For
example, macro redefinitions that were trivial when comments were
replaced by a single space might become significant when comments are
retained. Also, comments appearing at the start of what would be a
directive line have the effect of turning that line into an ordinary
source line, since the first token on the line is no longer a \fB#\fR.
.if n .Ip "\f(CW""\-gcc""\fR" 4
.el .Ip "\f(CW\-gcc\fR" 4
.IX Item "-gcc"
Define the macros _\|_GNUC_\|_, _\|_GNUC_MINOR_\|_ and
_\|_GNUC_PATCHLEVEL_\|_. These are defined automatically when you use
\&\fBgcc \-E\fR; you can turn them off in that case with \fB\-no-gcc\fR.
.if n .Ip "\f(CW""\-traditional""\fR" 4
.el .Ip "\f(CW\-traditional\fR" 4
.IX Item "-traditional"
Try to imitate the behavior of old-fashioned C, as opposed to \s-1ISO\s0
C.
.if n .Ip "\f(CW""\-trigraphs""\fR" 4
.el .Ip "\f(CW\-trigraphs\fR" 4
.IX Item "-trigraphs"
Process trigraph sequences.
.if n .Ip "\f(CW""\-remap""\fR" 4
.el .Ip "\f(CW\-remap\fR" 4
.IX Item "-remap"
Enable special code to work around file systems which only permit very
short file names, such as \s-1MS-DOS\s0.
.if n .Ip "\f(CW""\-$""\fR" 4
.el .Ip "\f(CW\-$\fR" 4
.IX Item "-$" .IX Item "-$"
Forbid the use of \fB$\fR in identifiers. The C standard allows Forbid the use of \fB$\fR in identifiers. The C standard allows
implementations to define extra characters that can appear in implementations to define extra characters that can appear in
identifiers. By default the \s-1GNU\s0 C preprocessor permits \fB$\fR, a identifiers. By default the \s-1GNU\s0 C preprocessor permits \fB$\fR, a
common extension. common extension.
.if n .Ip "\f(CW""\-h""\fR" 4
.el .Ip "\f(CW\-h\fR" 4
.IX Item "-h"
.PD 0
.if n .Ip "\f(CW""\-\-help""\fR" 4
.el .Ip "\f(CW\-\-help\fR" 4
.IX Item "--help"
.if n .Ip "\f(CW""\-\-target\-help""\fR" 4
.el .Ip "\f(CW\-\-target\-help\fR" 4
.IX Item "--target-help"
.PD
Print text describing all the command line options instead of
preprocessing anything.
.if n .Ip "\f(CW""\-v""\fR" 4
.el .Ip "\f(CW\-v\fR" 4
.IX Item "-v"
Verbose mode. Print out \s-1GNU\s0 \s-1CPP\s0's version number at the beginning of
execution, and report the final form of the include path.
.if n .Ip "\f(CW""\-H""\fR" 4
.el .Ip "\f(CW\-H\fR" 4
.IX Item "-H"
Print the name of each header file used, in addition to other normal
activities. Each name is indented to show how deep in the
\&\fB#include\fR stack it is.
.if n .Ip "\f(CW""\-version""\fR" 4
.el .Ip "\f(CW\-version\fR" 4
.IX Item "-version"
.PD 0
.if n .Ip "\f(CW""\-\-version""\fR" 4
.el .Ip "\f(CW\-\-version\fR" 4
.IX Item "--version"
.PD
Print out \s-1GNU\s0 \s-1CPP\s0's version number. With one dash, proceed to
preprocess as normal. With two dashes, exit immediately.
.SH "SEE ALSO" .SH "SEE ALSO"
.IX Header "SEE ALSO" .IX Header "SEE ALSO"
\&\fIgcc\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIcpp\fR, \fIgcc\fR, and \&\fIgcc\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIcpp\fR, \fIgcc\fR, and
...@@ -751,14 +760,10 @@ Copyright (c) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, ...@@ -751,14 +760,10 @@ Copyright (c) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
1997, 1998, 1999, 2000, 2001 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc. Free Software Foundation, Inc.
.PP .PP
Permission is granted to make and distribute verbatim copies of Permission is granted to copy, distribute and/or modify this document
this manual provided the copyright notice and this permission notice under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or
are preserved on all copies. any later version published by the Free Software Foundation. A copy of
.PP the license is included in the accompanying manual for \s-1GNU\s0 \s-1CC\s0, in the
Permission is granted to copy and distribute modified versions of this section ``\s-1GNU\s0 Free Documentation License''.
manual under the conditions for verbatim copying, provided also that This manual contains no Invariant Sections, and has no Front-Cover Texts
the entire resulting derived work is distributed under the terms of a or Back-Cover Texts.
permission notice identical to this one.
.PP
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment