Thu Apr 30 00:45:47 2009 UTC ()
Convert CPP man page to mdoc(7) using othersrc/usr.bin/pod2mdoc.
Do some manual post-processing and use that as new cpp(1).
The original version is included to add as base for three-way merges.


(joerg)
diff -r0 -r1.1 src/gnu/usr.bin/gcc4/cpp/cpp-contrib.1
diff -r1.1 -r1.2 src/gnu/usr.bin/gcc4/cpp/cpp.1

File Added: src/gnu/usr.bin/gcc4/cpp/Attic/cpp-contrib.1
.\" $NetBSD: cpp-contrib.1,v 1.1 2009/04/30 00:45:47 joerg Exp $
.Dd April 30, 2009
.Dt CPP 1
.Os
.Sh NAME
cpp - The C Preprocessor
.Sh SYNOPSIS
cpp
.Op Fl D Ns Ar macro Ns = Ns Ar defn...
.Op Fl U Ns Ar macro
.Op Fl I Ns Ar dir...
.Op Fl iquote Ns Ar dir...
.Op Fl W Ns Ar warn...
.Oo Fl M
|
.Fl MM Oc
.Op Fl MG
.Op Fl MF Ar filename
.Op Fl MP
.Op Fl MQ Ar target...
.Op Fl MT Ar target...
.Op Fl P
.Op Fl fno-working-directory
.Op Fl x Ar language
.Op Fl std= Ns Ar standard
.Em infile
.Em outfile
.Pp
Only the most useful options are listed here; see below for the remainder.
.Sh DESCRIPTION
The C preprocessor, often known as
.Em cpp ,
is a
.Em macro processor
that is used automatically by the C compiler to transform your program before compilation.
It is called a macro processor because it allows you to define
.Em macros ,
which are brief abbreviations for longer constructs.
.Pp
The C preprocessor is intended to be used only with C, C++, and Objective-C source code.
In the past, it has been abused as a general text processor.
It will choke on input which does not obey C's lexical rules.
For example, apostrophes will be interpreted as the beginning of character constants, and cause errors.
Also, you cannot rely on it 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
Having said that, you can often get away with using cpp on things which are not C.
Other Algol-ish programming languages are often safe (Pascal, Ada, etc.) So is assembly, with caution.
.Fl traditional-cpp
mode preserves more white space, and is otherwise more permissive.
Many of the problems can be avoided by writing C or C++ style comments instead of native language comments, and keeping macros simple.
.Pp
Wherever possible, you should use a preprocessor geared to the language you are writing in.
Modern versions of the GNU assembler have macro facilities.
Most high level programming languages have their own conditional compilation and inclusion mechanism.
If all else fails, try a true general text processor, such as GNU M4.
.Pp
C preprocessors vary in some details.
This manual discusses the GNU C preprocessor, which provides a small superset of the features of ISO Standard C.
In its default mode, the GNU C preprocessor does not do a few things required by the standard.
These are features which are rarely, if ever, used, and may cause surprising changes to the meaning of a program which does not expect them.
To get strict ISO Standard C, you should use the
.Fl std=c89
or
.Fl std=c99
options, depending on which version of the standard you want.
To get all the mandatory diagnostics, you must also use
.Fl pedantic .
.Pp
This manual describes the behavior of the ISO preprocessor.
To minimize gratuitous differences, where the ISO preprocessor's behavior does not conflict with traditional semantics, the traditional preprocessor should behave the same way.
The various differences that do exist are detailed in the section
.Sy Traditional Mode .
.Pp
For clarity, unless noted otherwise, references to
.Sy CPP
in this manual refer to GNU CPP.
.Sh OPTIONS
The C preprocessor expects two file names as arguments,
.Em infile
and
.Em outfile .
The preprocessor reads
.Em infile
together with any other files it specifies with
.Sy #include .
All the output generated by the combined input files is written in
.Em outfile .
.Pp
Either
.Em infile
or
.Em outfile
may be
.Sy - ,
which as
.Em infile
means to read from standard input and as
.Em outfile
means to write to standard output.
Also, if either file is omitted, it means the same as if
.Sy -
had been specified for that file.
.Pp
Unless otherwise noted, or the option ends in
.Sy = ,
all options which take an argument may have that argument appear either immediately after the option, or with a space between option and argument:
.Fl Ifoo
and
.Fl I Ar foo
have the same effect.
.Pp
Many options have multi-letter names; therefore multiple single-letter options may
.Em not
be grouped:
.Fl dM
is very different from
.Fl d Fl M .
.Pp
.Bl -tag -width xx
.It Fl D Ar name
Predefine
.Em name
as a macro, with definition
.Va 1 .
.Pp
.It Fl D Ar name Ns = Ns Ar definition
The contents of
.Em definition
are tokenized and processed as if they appeared during translation phase three in a
.Sy #define
directive.
In particular, the definition will be truncated by embedded newline characters.
.Pp
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.
.Pp
If you wish to define a function-like macro on the command line, write its argument list with surrounding parentheses before the equals sign (if any).
Parentheses are meaningful to most shells, so you will need to quote the option.
With
.Sy sh
and
.Sy csh ,
.Sy -D'
.Em name
.Sy (
.Em args...
.Sy )=
.Em definition
.Sy '
works.
.Pp
.Fl D
and
.Fl U
options are processed in the order they are given on the command line.
All
.Fl imacros Ar file
and
.Fl include Ar file
options are processed after all
.Fl D
and
.Fl U
options.
.Pp
.It Fl U Ar name
Cancel any previous definition of
.Em name ,
either built in or provided with a
.Fl D
option.
.Pp
.It Fl undef
Do not predefine any system-specific or GCC-specific macros.
The standard predefined macros remain defined.
.Pp
.It Fl I Ar dir
Add the directory
.Em dir
to the list of directories to be searched for header files.
.Pp
Directories named by
.Fl I
are searched before the standard system include directories.
If the directory
.Em dir
is a standard system include directory, the option is ignored to ensure that the default search order for system directories and the special treatment of system headers are not defeated .
.Pp
.It Fl o Ar file
Write output to
.Em file .
This is the same as specifying
.Em file
as the second non-option argument to
.Nm cpp .
.Sy gcc
has a different interpretation of a second non-option argument, so you must use
.Fl o
to specify the output file.
.Pp
.It Fl Wall
Turns on all optional warnings which are desirable for normal code.
At present this is
.Fl Wcomment ,
.Fl Wtrigraphs ,
.Fl Wmultichar
and a warning about integer promotion causing a change of sign in
.Va #if
expressions.
Note that many of the preprocessor's warnings are on by default and have no options to control them.
.Pp
.It Fl Wcomment
.It Fl Wcomments
Warn whenever a comment-start sequence
.Sy /*
appears in a
.Sy /*
comment, or whenever a backslash-newline appears in a
.Sy //
comment.
(Both forms have the same effect.)
.Pp
.It Fl Wtrigraphs
@anchor{Wtrigraphs} Most trigraphs in comments cannot affect the meaning of the program.
However, a trigraph that would form an escaped newline
.Sy ( ??/
at the end of a line) can, by changing where the comment begins or ends.
Therefore, only trigraphs that would form escaped newlines produce warnings inside a comment.
.Pp
This option is implied by
.Fl Wall .
If
.Fl Wall
is not given, this option is still enabled unless trigraphs are enabled.
To get trigraph conversion without warnings, but get the other
.Fl Wall
warnings, use
.Fl trigraphs Fl Wall Fl Wno-trigraphs .
.Pp
.It Fl Wtraditional
Warn about certain constructs that behave differently in traditional and ISO C.
Also warn about ISO C constructs that have no traditional C equivalent, and problematic constructs which should be avoided.
.Pp
.It Fl Wimport
Warn the first time
.Sy #import
is used.
.Pp
.It Fl Wundef
Warn whenever an identifier which is not a macro is encountered in an
.Sy #if
directive, outside of
.Sy defined .
Such identifiers are replaced with zero.
.Pp
.It Fl Wunused-macros
Warn about macros defined in the main file that are unused.
A macro is
.Em used
if it is expanded or tested for existence at least once.
The preprocessor will also warn if the macro has not been used at the time it is redefined or undefined.
.Pp
Built-in macros, macros defined on the command line, and macros defined in include files are not warned about.
.Pp
.Em Note:
If a macro is actually used, but only used in skipped conditional blocks, then CPP will report it as unused.
To avoid the warning in such a case, you might improve the scope of the macro's definition by, for example, moving it into the first skipped block.
Alternatively, you could provide a dummy use with something like:
.Pp
.Bd -literal -offset indent
#if defined the_macro_causing_the_warning
#endif
.Ed
.It Fl Wendif-labels
Warn whenever an
.Sy #else
or an
.Sy #endif
are followed by text.
This usually happens in code of the form
.Pp
.Bd -literal -offset indent
#if FOO
\&...
#else FOO
\&...
#endif FOO
.Ed
The second and third
.Va FOO
should be in comments, but often are not in older programs.
This warning is on by default.
.Pp
.It Fl Werror
Make all warnings into hard errors.
Source code which triggers warnings will be rejected.
.Pp
.It Fl Wsystem-headers
Issue warnings for code in system headers.
These are normally unhelpful in finding bugs in your own code, therefore suppressed.
If you are responsible for the system library, you may want to see them.
.Pp
.It Fl w
Suppress all warnings, including those which GNU CPP issues by default.
.Pp
.It Fl pedantic
Issue all the mandatory diagnostics listed in the C standard.
Some of them are left out by default, since they trigger frequently on harmless code.
.Pp
.It Fl pedantic-errors
Issue all the mandatory diagnostics, and make all mandatory diagnostics into errors.
This includes mandatory diagnostics that GCC issues without
.Fl pedantic
but treats as warnings.
.Pp
.It Fl M
Instead of outputting the result of preprocessing, output a rule suitable for
.Sy make
describing the dependencies of the main source file.
The preprocessor outputs one
.Sy make
rule containing the object file name for that source file, a colon, and the names of all the included files, including those coming from
.Fl include
or
.Fl imacros
command line options.
.Pp
Unless specified explicitly (with
.Fl MT
or
.Fl MQ ) ,
the object file name consists of the basename of the source file with any suffix replaced with object file suffix.
If there are many included files then the rule is split into several lines using
.Sy \e
-newline.
The rule has no commands.
.Pp
This option does not suppress the preprocessor's debug output, such as
.Fl dM .
To avoid mixing such debug output with the dependency rules you should explicitly specify the dependency output file with
.Fl MF ,
or use an environment variable like
.Sy DEPENDENCIES_OUTPUT .
Debug output will still be sent to the regular output stream as normal.
.Pp
Passing
.Fl M
to the driver implies
.Fl E ,
and suppresses warnings with an implicit
.Fl w .
.Pp
.It Fl MM
Like
.Fl M
but do not mention header files that are found in system header directories, nor header files that are included, directly or indirectly, from such a header.
.Pp
This implies that the choice of angle brackets or double quotes in an
.Sy #include
directive does not in itself determine whether that header will appear in
.Fl MM
dependency output.
This is a slight change in semantics from GCC versions 3.0 and earlier.
.Pp
@anchor{dashMF}
.Pp
.It Fl MF Ar file
When used with
.Fl M
or
.Fl MM ,
specifies a file to write the dependencies to.
If no
.Fl MF
switch is given the preprocessor sends the rules to the same place it would have sent preprocessed output.
.Pp
When used with the driver options
.Fl MD
or
.Fl MMD ,
.Fl MF
overrides the default dependency output file.
.Pp
.It Fl MG
In conjunction with an option such as
.Fl M
requesting dependency generation,
.Fl MG
assumes missing header files are generated files and adds them to the dependency list without raising an error.
The dependency filename is taken directly from the
.Va #include
directive without prepending any path.
.Fl MG
also suppresses preprocessed output, as a missing header file renders this useless.
.Pp
This feature is used in automatic updating of makefiles.
.Pp
.It Fl MP
This option instructs CPP to add a phony target for each dependency other than the main file, causing each to depend on nothing.
These dummy rules work around errors
.Sy make
gives if you remove header files without updating the
.Pa Makefile
to match.
.Pp
This is typical output:
.Pp
.Bd -literal -offset indent
test.o: test.c test.h

test.h:
.Ed
.It Fl MT Ar target
Change the target of the rule emitted by dependency generation.
By default CPP takes the name of the main input file, including any path, deletes any file suffix such as
.Sy .c ,
and appends the platform's usual object suffix.
The result is the target.
.Pp
An
.Fl MT
option will set the target to be exactly the string you specify.
If you want multiple targets, you can specify them as a single argument to
.Fl MT ,
or use multiple
.Fl MT
options.
.Pp
For example,
.Sy -MT '$(objpfx)foo.o'
might give
.Pp
.Bd -literal -offset indent
$(objpfx)foo.o: foo.c
.Ed
.It Fl MQ Ar target
Same as
.Fl MT ,
but it quotes any characters which are special to Make.
.Sy -MQ '$(objpfx)foo.o'
gives
.Pp
.Bd -literal -offset indent
$$(objpfx)foo.o: foo.c
.Ed
The default target is automatically quoted, as if it were given with
.Fl MQ .
.Pp
.It Fl MD
.Fl MD
is equivalent to
.Fl M Fl MF Ar file ,
except that
.Fl E
is not implied.
The driver determines
.Em file
based on whether an
.Fl o
option is given.
If it is, the driver uses its argument but with a suffix of
.Pa .d ,
otherwise it take the basename of the input file and applies a
.Pa .d
suffix.
.Pp
If
.Fl MD
is used in conjunction with
.Fl E ,
any
.Fl o
switch is understood to specify the dependency output file (but @pxref{dashMF,,-MF}), but if used without
.Fl E ,
each
.Fl o
is understood to specify a target object file.
.Pp
Since
.Fl E
is not implied,
.Fl MD
can be used to generate a dependency output file as a side-effect of the compilation process.
.Pp
.It Fl MMD
Like
.Fl MD
except mention only user header files, not system header files.
.Pp
.It Fl x Ar c
.It Fl x Ar c++
.It Fl x Ar objective-c
.It Fl x Ar assembler-with-cpp
Specify the source language: C, C++, Objective-C, or assembly.
This has nothing to do with standards conformance or extensions; it merely selects which base syntax to expect.
If you give none of these options, cpp will deduce the language from the extension of the source file:
.Sy .c ,
.Sy .cc ,
.Sy .m ,
or
.Sy .S .
Some other common extensions for C++ and assembly are also recognized.
If cpp does not recognize the extension, it will treat the file as C; this is the most generic mode.
.Pp
.Em Note:
Previous versions of cpp accepted a
.Fl lang
option which selected both the language and the standards conformance level.
This option has been removed, because it conflicts with the
.Fl l
option.
.Pp
.It Fl std= Ns Ar standard
.It Fl ansi
Specify the standard to which the code should conform.
Currently CPP knows about C and C++ standards; others may be added in the future.
.Pp
.Em standard
may be one of:
.Pp
.Bl -tag -width xx
.It Sy iso9899:1990 Ns
.It Sy c89 Ns
The ISO C standard from 1990.
.Sy c89
is the customary shorthand for this version of the standard.
.Pp
The
.Fl ansi
option is equivalent to
.Fl std=c89 .
.Pp
.It Sy iso9899:199409 Ns
The 1990 C standard, as amended in 1994.
.Pp
.It Sy iso9899:1999 Ns
.It Sy c99 Ns
.It Sy iso9899:199x Ns
.It Sy c9x Ns
The revised ISO C standard, published in December 1999.
Before publication, this was known as C9X.
.Pp
.It Sy gnu89 Ns
The 1990 C standard plus GNU extensions.
This is the default.
.Pp
.It Sy gnu99 Ns
.It Sy gnu9x Ns
The 1999 C standard plus GNU extensions.
.Pp
.It Sy c++98 Ns
The 1998 ISO C++ standard plus amendments.
.Pp
.It Sy gnu++98 Ns
The same as
.Fl std=c++98
plus GNU extensions.
This is the default for C++ code.
.Pp
.El
.It Fl I-
Split the include path.
Any directories specified with
.Fl I
options before
.Fl I-
are searched only for headers requested with
.Va .Sy #include \&"file" ;
they are not searched for
.Va .Sy #include \*[Lt]file\*[Gt] .
If additional directories are specified with
.Fl I
options after the
.Fl I- ,
those directories are searched for all
.Sy #include
directives.
.Pp
In addition,
.Fl I-
inhibits the use of the directory of the current file directory as the first search directory for
.Va .Sy #include \&"file" .
.Pp
This option has been deprecated.
.Pp
.It Fl nostdinc
Do not search the standard system directories for header files.
Only the directories you have specified with
.Fl I
options (and the directory of the current file, if appropriate) are searched.
.Pp
.It Fl 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.)
.Pp
.It Fl include Ar file
Process
.Em file
as if
.Va #include \&"file"
appeared as the first line of the primary source file.
However, the first directory searched for
.Em file
is the preprocessor's working directory
.Em instead of
the directory containing the main source file.
If not found there, it is searched for in the remainder of the
.Va #include \&"..."
search chain as normal.
.Pp
If multiple
.Fl include
options are given, the files are included in the order they appear on the command line.
.Pp
.It Fl imacros Ar file
Exactly like
.Fl include ,
except that any output produced by scanning
.Em file
is thrown away.
Macros it defines remain defined.
This allows you to acquire all the macros from a header without also processing its declarations.
.Pp
All files specified by
.Fl imacros
are processed before all files specified by
.Fl include .
.Pp
.It Fl idirafter Ar dir
Search
.Em dir
for header files, but do it
.Em after
all directories specified with
.Fl I
and the standard system directories have been exhausted.
.Em dir
is treated as a system include directory.
.Pp
.It Fl iprefix Ar prefix
Specify
.Em prefix
as the prefix for subsequent
.Fl iwithprefix
options.
If the prefix represents a directory, you should include the final
.Sy / .
.Pp
.It Fl iwithprefix Ar dir
.It Fl iwithprefixbefore Ar dir
Append
.Em dir
to the prefix specified previously with
.Fl iprefix ,
and add the resulting directory to the include search path.
.Fl iwithprefixbefore
puts it in the same place
.Fl I
would;
.Fl iwithprefix
puts it where
.Fl idirafter
would.
.Pp
.It Fl isysroot Ar dir
This option is like the
.Fl -sysroot
option, but applies only to header files.
See the
.Fl -sysroot
option for more information.
.Pp
.It Fl isystem Ar dir
Search
.Em dir
for header files, after all directories specified by
.Fl I
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.
.Pp
.It Fl cxx-isystem Ar dir
Search
.Em dir
for C++ header files, after all directories specified by
.Fl I
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.
.Pp
.It Fl iquote Ar dir
Search
.Em dir
only for header files requested with
.Va .Sy #include \&"file" ;
they are not searched for
.Va .Sy #include \*[Lt]file\*[Gt] ,
before all directories specified by
.Fl I
and before the standard system directories.
.Pp
.It Fl fdollars-in-identifiers
@anchor{fdollars-in-identifiers} Accept
.Sy $
in identifiers.
.Pp
.It Fl fextended-identifiers
Accept universal character names in identifiers.
This option is experimental; in a future version of GCC, it will be enabled by default for C99 and C++.
.Pp
.It Fl 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.
The preprocessor still recognizes and removes comments, so that you can pass a file preprocessed with
.Fl C
to the compiler without problems.
In this mode the integrated preprocessor is little more than a tokenizer for the front ends.
.Pp
.Fl fpreprocessed
is implicit if the input file has one of the extensions
.Sy .i ,
.Sy .ii
or
.Sy .mi .
These are the extensions that GCC uses for preprocessed files created by
.Fl save-temps .
.Pp
.It Fl ftabstop= Ns Ar 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.
.Pp
.It Fl fexec-charset= Ns Ar charset
Set the execution character set, used for string and character constants.
The default is UTF-8.
.Em charset
can be any encoding supported by the system's
.Va iconv
library routine.
.Pp
.It Fl fwide-exec-charset= Ns Ar charset
Set the wide execution character set, used for wide string and character constants.
The default is UTF-32 or UTF-16, whichever corresponds to the width of
.Va wchar_t .
As with
.Fl fexec-charset ,
.Em charset
can be any encoding supported by the system's
.Va iconv
library routine; however, you will have problems with encodings that do not fit exactly in
.Va wchar_t .
.Pp
.It Fl finput-charset= Ns Ar charset
Set the input character set, used for translation from the character set of the input file to the source character set used by GCC.
If the locale does not specify, or GCC cannot get this information from the locale, the default is UTF-8.
This can be overridden by either the locale or this command line option.
Currently the command line option takes precedence if there's a conflict.
.Em charset
can be any encoding supported by the system's
.Va iconv
library routine.
.Pp
.It Fl fworking-directory
Enable generation of linemarkers in the preprocessor output that will let the compiler know the current working directory at the time of preprocessing.
When this option is enabled, the preprocessor will emit, after the initial linemarker, a second linemarker with the current working directory followed by two slashes.
GCC will use this directory, when it's present in the preprocessed input, as the directory emitted as the current working directory in some debugging information formats.
This option is implicitly enabled if debugging information is enabled, but this can be inhibited with the negated form
.Fl fno-working-directory .
If the
.Fl P
flag is present in the command line, this option has no effect, since no
.Va #line
directives are emitted whatsoever.
.Pp
.It Fl 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
.Sy dejagnu .
.Pp
.It Fl A Ar predicate Ns = Ns Ar answer
Make an assertion with the predicate
.Em predicate
and answer
.Em answer .
This form is preferred to the older form
.Fl A Ar predicate
.Sy (
.Em answer
.Sy ) ,
which is still supported, because it does not use shell special characters.
.Pp
.It Fl A Fl  Ns Ar predicate Ns = Ns Ar answer
Cancel an assertion with the predicate
.Em predicate
and answer
.Em answer .
.Pp
.It Fl dCHARS
.Em CHARS
is a sequence of one or more of the following characters, and must not be preceded by a space.
Other characters are interpreted by the compiler proper, or reserved for future versions of GCC, and so are silently ignored.
If you specify characters whose behavior conflicts, the result is undefined.
.Pp
.Bl -tag -width xx
.It Sy M Ns
Instead of the normal output, generate a list of
.Sy #define
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
.Pa foo.h ,
the command
.Pp
.Bd -literal -offset indent
touch foo.h; cpp -dM foo.h
.Ed
will show all the predefined macros.
.Pp
.It Sy D Ns
Like
.Sy M
except in two respects: it does
.Em not
include the predefined macros, and it outputs
.Em both
the
.Sy #define
directives and the result of preprocessing.
Both kinds of output go to the standard output file.
.Pp
.It Sy N Ns
Like
.Sy D ,
but emit only the macro names, not their expansions.
.Pp
.It Sy I Ns
Output
.Sy #include
directives in addition to the result of preprocessing.
.Pp
.El
.It Fl 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.
.Pp
.It Fl 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.
.Pp
You should be prepared for side effects when using
.Fl C ;
it causes the preprocessor to treat comments as tokens in their own right.
For example, 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
.Sy # .
.Pp
.It Fl CC
Do not discard comments, including during macro expansion.
This is like
.Fl C ,
except that comments contained within macros are also passed through to the output file where the macro is expanded.
.Pp
In addition to the side-effects of the
.Fl C
option, the
.Fl CC
option causes all C++-style comments inside a macro to be converted to C-style comments.
This is to prevent later use of that macro from inadvertently commenting out the remainder of the source line.
.Pp
The
.Fl CC
option is generally used to support lint comments.
.Pp
.It Fl traditional-cpp
Try to imitate the behavior of old-fashioned C preprocessors, as opposed to ISO C preprocessors.
.Pp
.It Fl trigraphs
Process trigraph sequences.
.Pp
.It Fl remap
Enable special code to work around file systems which only permit very short file names, such as MS-DOS.
.Pp
.It Fl -help
.It Fl -target-help
Print text describing all the command line options instead of preprocessing anything.
.Pp
.It Fl v
Verbose mode.
Print out GNU CPP's version number at the beginning of execution, and report the final form of the include path.
.Pp
.It Fl 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
.Sy #include
stack it is.
Precompiled header files are also printed, even if they are found to be invalid; an invalid precompiled header file is printed with
.Sy ...x
and a valid one with
.Sy ...! .
.Pp
.It Fl version
.It Fl -version
Print out GNU CPP's version number.
With one dash, proceed to preprocess as normal.
With two dashes, exit immediately.
.Pp
.El
.Sh ENVIRONMENT
This section describes the environment variables that affect how CPP operates.
You can use them to specify directories or prefixes to use when searching for include files, or to control dependency output.
.Pp
Note that you can also specify places to search using options such as
.Fl I ,
and control dependency output with options like
.Fl M .
These take precedence over environment variables, which in turn take precedence over the configuration of GCC.
.Pp
.Bl -tag -width xx
.It Sy CPATH Ns
.It Sy C_INCLUDE_PATH Ns
.It Sy CPLUS_INCLUDE_PATH Ns
.It Sy OBJC_INCLUDE_PATH Ns
Each variable's value is a list of directories separated by a special character, much like
.Sy PATH ,
in which to look for header files.
The special character,
.Va PATH_SEPARATOR ,
is target-dependent and determined at GCC build time.
For Microsoft Windows-based targets it is a semicolon, and for almost all other targets it is a colon.
.Pp
.Sy CPATH
specifies a list of directories to be searched as if specified with
.Fl I ,
but after any paths given with
.Fl I
options on the command line.
This environment variable is used regardless of which language is being preprocessed.
.Pp
The remaining environment variables apply only when preprocessing the particular language indicated.
Each specifies a list of directories to be searched as if specified with
.Fl isystem ,
but after any paths given with
.Fl isystem
options on the command line.
.Pp
In all these variables, an empty element instructs the compiler to search its current working directory.
Empty elements can appear at the beginning or end of a path.
For instance, if the value of
.Sy CPATH
is
.Va :/special/include ,
that has the same effect as
.Sy -I. -I/special/include .
.Pp
.It Sy DEPENDENCIES_OUTPUT Ns
If this variable is set, its value specifies how to output dependencies for Make based on the non-system header files processed by the compiler.
System header files are ignored in the dependency output.
.Pp
The value of
.Sy DEPENDENCIES_OUTPUT
can be just a file name, in which case the Make rules are written to that file, guessing the target name from the source file name.
Or the value can have the form
.Em file
\~
.Em target ,
in which case the rules are written to file
.Em file
using
.Em target
as the target name.
.Pp
In other words, this environment variable is equivalent to combining the options
.Fl MM
and
.Fl MF ,
with an optional
.Fl MT
switch too.
.Pp
.It Sy SUNPRO_DEPENDENCIES Ns
This variable is the same as
.Sy DEPENDENCIES_OUTPUT
(see above), except that system header files are not ignored, so it implies
.Fl M
rather than
.Fl MM .
However, the dependence on the main input file is omitted.
.Pp
.It Sy CPP_RESTRICTED Ns
If this variable is defined, cpp will skip any include file which is not a regular file, and will continue searching for the requested name (this is always done if the found file is a directory).
.Pp
.El
.Sh SEE ALSO
gpl(7), gfdl(7), fsf-funding(7), gcc(1), as(1), ld(1), and the Info entries for
.Pa cpp ,
.Pa gcc ,
and
.Pa binutils .
.Sh COPYRIGHT
Copyright (c) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
.Pp
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation.
A copy of the license is included in the man page gfdl(7).
This manual contains no Invariant Sections.
The Front-Cover Texts are (a) (see below), and the Back-Cover Texts are (b) (see below).
.Pp
(a) The FSF's Front-Cover Text is:
.Pp
 A GNU Manual
.Pp
(b) The FSF's Back-Cover Text is:
.Pp
You have freedom to copy and modify this GNU Manual, like GNU software.
Copies published by the Free Software Foundation raise funds for GNU development.

cvs diff -r1.1 -r1.2 src/gnu/usr.bin/gcc4/cpp/Attic/cpp.1 (expand / switch to unified diff)

--- src/gnu/usr.bin/gcc4/cpp/Attic/cpp.1 2006/05/10 22:48:12 1.1
+++ src/gnu/usr.bin/gcc4/cpp/Attic/cpp.1 2009/04/30 00:45:47 1.2
@@ -1,935 +1,1006 @@ @@ -1,935 +1,1006 @@
1.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3 1.\" $NetBSD: cpp.1,v 1.2 2009/04/30 00:45:47 joerg Exp $
2.\" 2.Dd April 30, 2009
3.\" Standard preamble: 3.Dt CPP 1
4.\" ======================================================================== 4.Os
5.de Sh \" Subsection heading 5.Sh NAME
6.br 6.Nm cpp
7.if t .Sp 7.Nd The C Preprocessor
8.ne 5 8.Sh SYNOPSIS
9.PP 9.Nm
10\fB\\$1\fR 10.Op Fl D Ns Ar macro Ns = Ns Ar defn...
11.PP 11.Op Fl U Ns Ar macro
12.. 12.Op Fl I Ns Ar dir...
13.de Sp \" Vertical space (when we can't use .PP) 13.Op Fl iquote Ns Ar dir...
14.if t .sp .5v 14.Op Fl W Ns Ar warn...
15.if n .sp 15.Op Fl M | Fl MM
16.. 16.Op Fl MG
17.de Vb \" Begin verbatim text 17.Op Fl MF Ar filename
18.ft CW 18.Op Fl MP
19.nf 19.Op Fl MQ Ar target...
20.ne \\$1 20.Op Fl MT Ar target...
21.. 21.Op Fl P
22.de Ve \" End verbatim text 22.Op Fl fno-working-directory
23.ft R 23.Op Fl x Ar language
24.fi 24.Op Fl std= Ns Ar standard
25.. 25.Ar infile
26.\" Set up some character translations and predefined strings. \*(-- will 26.Ar outfile
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left 27.Pp
28.\" double quote, and \*(R" will give a right double quote. | will give a 
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to 
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' 
31.\" expand to `' in nroff, nothing in troff, for use with C<>. 
32.tr \(*W-|\(bv\*(Tr 
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' 
34.ie n \{\ 
35. ds -- \(*W- 
36. ds PI pi 
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch 
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch 
39. ds L" "" 
40. ds R" "" 
41. ds C` "" 
42. ds C' "" 
43'br\} 
44.el\{\ 
45. ds -- \|\(em\| 
46. ds PI \(*p 
47. ds L" `` 
48. ds R" '' 
49'br\} 
50.\" 
51.\" If the F register is turned on, we'll generate index entries on stderr for 
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index 
53.\" entries marked with X<> in POD. Of course, you'll have to process the 
54.\" output yourself in some meaningful fashion. 
55.if \nF \{\ 
56. de IX 
57. tm Index:\\$1\t\\n%\t"\\$2" 
58.. 
59. nr % 0 
60. rr F 
61.\} 
62.\" 
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes 
64.\" way too many mistakes in technical documents. 
65.hy 0 
66.if n .na 
67.\" 
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). 
69.\" Fear. Run. Save yourself. No user-serviceable parts. 
70. \" fudge factors for nroff and troff 
71.if n \{\ 
72. ds #H 0 
73. ds #V .8m 
74. ds #F .3m 
75. ds #[ \f1 
76. ds #] \fP 
77.\} 
78.if t \{\ 
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m) 
80. ds #V .6m 
81. ds #F 0 
82. ds #[ \& 
83. ds #] \& 
84.\} 
85. \" simple accents for nroff and troff 
86.if n \{\ 
87. ds ' \& 
88. ds ` \& 
89. ds ^ \& 
90. ds , \& 
91. ds ~ ~ 
92. ds / 
93.\} 
94.if t \{\ 
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" 
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' 
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' 
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' 
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' 
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' 
101.\} 
102. \" troff and (daisy-wheel) nroff accents 
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' 
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H' 
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] 
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' 
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' 
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] 
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] 
110.ds ae a\h'-(\w'a'u*4/10)'e 
111.ds Ae A\h'-(\w'A'u*4/10)'E 
112. \" corrections for vroff 
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' 
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' 
115. \" for low resolution devices (crt and lpr) 
116.if \n(.H>23 .if \n(.V>19 \ 
117\{\ 
118. ds : e 
119. ds 8 ss 
120. ds o a 
121. ds d- d\h'-1'\(ga 
122. ds D- D\h'-1'\(hy 
123. ds th \o'bp' 
124. ds Th \o'LP' 
125. ds ae ae 
126. ds Ae AE 
127.\} 
128.rm #[ #] #H #V #F C 
129.\" ======================================================================== 
130.\" 
131.IX Title "CPP 1" 
132.TH CPP 1 "2006-05-06" "gcc-4.1.1" "GNU" 
133.SH "NAME" 
134cpp \- The C Preprocessor 
135.SH "SYNOPSIS" 
136.IX Header "SYNOPSIS" 
137cpp [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR] 
138 [\fB\-I\fR\fIdir\fR...] [\fB\-iquote\fR\fIdir\fR...] 
139 [\fB\-W\fR\fIwarn\fR...] 
140 [\fB\-M\fR|\fB\-MM\fR] [\fB\-MG\fR] [\fB\-MF\fR \fIfilename\fR] 
141 [\fB\-MP\fR] [\fB\-MQ\fR \fItarget\fR...] 
142 [\fB\-MT\fR \fItarget\fR...] 
143 [\fB\-P\fR] [\fB\-fno\-working\-directory\fR] 
144 [\fB\-x\fR \fIlanguage\fR] [\fB\-std=\fR\fIstandard\fR] 
145 \fIinfile\fR \fIoutfile\fR 
146.PP 
147Only the most useful options are listed here; see below for the remainder. 28Only the most useful options are listed here; see below for the remainder.
148.SH "DESCRIPTION" 29.Sh DESCRIPTION
149.IX Header "DESCRIPTION" 30The C preprocessor, often known as
150The C preprocessor, often known as \fIcpp\fR, is a \fImacro processor\fR 31.Nm ,
151that is used automatically by the C compiler to transform your program 32is a
152before compilation. It is called a macro processor because it allows 33.Em macro processor
153you to define \fImacros\fR, which are brief abbreviations for longer 34that is used automatically by the C compiler to transform your program before compilation.
154constructs. 35It is called a macro processor because it allows you to define
155.PP 36.Em macros ,
156The C preprocessor is intended to be used only with C, \*(C+, and 37which are brief abbreviations for longer constructs.
157Objective-C source code. In the past, it has been abused as a general 38.Pp
158text processor. It will choke on input which does not obey C's lexical 39The C preprocessor is intended to be used only with C, C++, and Objective-C source code.
159rules. For example, apostrophes will be interpreted as the beginning of 40In the past, it has been abused as a general text processor.
160character constants, and cause errors. Also, you cannot rely on it 41It will choke on input which does not obey C's lexical rules.
161preserving characteristics of the input which are not significant to 42For example, apostrophes will be interpreted as the beginning of character constants, and cause errors.
162C\-family languages. If a Makefile is preprocessed, all the hard tabs 43Also, you cannot rely on it preserving characteristics of the input which are not significant to C-family languages.
163will be removed, and the Makefile will not work. 44If a Makefile is preprocessed, all the hard tabs will be removed, and the Makefile will not work.
164.PP 45.Pp
165Having said that, you can often get away with using cpp on things which 46Having said that, you can often get away with using cpp on things which are not C.
166are not C. Other Algol-ish programming languages are often safe 47Other Algol-ish programming languages are often safe (Pascal, Ada, etc.) So is assembly, with caution.
167(Pascal, Ada, etc.) So is assembly, with caution. \fB\-traditional\-cpp\fR 48.Fl traditional-cpp
168mode preserves more white space, and is otherwise more permissive. Many 49mode preserves more white space, and is otherwise more permissive.
169of the problems can be avoided by writing C or \*(C+ style comments 50Many of the problems can be avoided by writing C or C++ style comments instead of native language comments, and keeping macros simple.
170instead of native language comments, and keeping macros simple. 51.Pp
171.PP 52Wherever possible, you should use a preprocessor geared to the language you are writing in.
172Wherever possible, you should use a preprocessor geared to the language 53Modern versions of the GNU assembler have macro facilities.
173you are writing in. Modern versions of the \s-1GNU\s0 assembler have macro 54Most high level programming languages have their own conditional compilation and inclusion mechanism.
174facilities. Most high level programming languages have their own 55If all else fails, try a true general text processor, such as GNU M4.
175conditional compilation and inclusion mechanism. If all else fails, 56.Pp
176try a true general text processor, such as \s-1GNU\s0 M4. 57C preprocessors vary in some details.
177.PP 58This manual discusses the GNU C preprocessor, which provides a small superset of the features of ISO Standard C.
178C preprocessors vary in some details. This manual discusses the \s-1GNU\s0 C 59In its default mode, the GNU C preprocessor does not do a few things required by the standard.
179preprocessor, which provides a small superset of the features of \s-1ISO\s0 60These are features which are rarely, if ever, used, and may cause surprising changes to the meaning of a program which does not expect them.
180Standard C. In its default mode, the \s-1GNU\s0 C preprocessor does not do a 61To get strict ISO Standard C, you should use the
181few things required by the standard. These are features which are 62.Fl std=c89
182rarely, if ever, used, and may cause surprising changes to the meaning 63or
183of a program which does not expect them. To get strict \s-1ISO\s0 Standard C, 64.Fl std=c99
184you should use the \fB\-std=c89\fR or \fB\-std=c99\fR options, depending 65options, depending on which version of the standard you want.
185on which version of the standard you want. To get all the mandatory 66To get all the mandatory diagnostics, you must also use
186diagnostics, you must also use \fB\-pedantic\fR.  67.Fl pedantic .
187.PP 68.Pp
188This manual describes the behavior of the \s-1ISO\s0 preprocessor. To 69This manual describes the behavior of the ISO preprocessor.
189minimize gratuitous differences, where the \s-1ISO\s0 preprocessor's 70To minimize gratuitous differences, where the ISO preprocessor's behavior does not conflict with traditional semantics, the traditional preprocessor should behave the same way.
190behavior does not conflict with traditional semantics, the 71The various differences that do exist are detailed in the section
191traditional preprocessor should behave the same way. The various 72.Sy Traditional Mode .
192differences that do exist are detailed in the section \fBTraditional 73.Pp
193Mode\fR. 74For clarity, unless noted otherwise, references to
194.PP 75.Sy CPP
195For clarity, unless noted otherwise, references to \fB\s-1CPP\s0\fR in this 76in this manual refer to GNU CPP.
196manual refer to \s-1GNU\s0 \s-1CPP\s0. 77.Sh OPTIONS
197.SH "OPTIONS" 78The C preprocessor expects two file names as arguments,
198.IX Header "OPTIONS" 79.Em infile
199The C preprocessor expects two file names as arguments, \fIinfile\fR and 80and
200\&\fIoutfile\fR. The preprocessor reads \fIinfile\fR together with any 81.Em outfile .
201other files it specifies with \fB#include\fR. All the output generated 82The preprocessor reads
202by the combined input files is written in \fIoutfile\fR. 83.Em infile
203.PP 84together with any other files it specifies with
204Either \fIinfile\fR or \fIoutfile\fR may be \fB\-\fR, which as 85.Sy #include .
205\&\fIinfile\fR means to read from standard input and as \fIoutfile\fR 86All the output generated by the combined input files is written in
206means to write to standard output. Also, if either file is omitted, it 87.Em outfile .
207means the same as if \fB\-\fR had been specified for that file. 88.Pp
208.PP 89Either
209Unless otherwise noted, or the option ends in \fB=\fR, all options 90.Em infile
210which take an argument may have that argument appear either immediately 91or
211after the option, or with a space between option and argument: 92.Em outfile
212\&\fB\-Ifoo\fR and \fB\-I foo\fR have the same effect. 93may be
213.PP 94.Sy - ,
214Many options have multi-letter names; therefore multiple single-letter 95which as
215options may \fInot\fR be grouped: \fB\-dM\fR is very different from 96.Em infile
216\&\fB\-d\ \-M\fR. 97means to read from standard input and as
217.IP "\fB\-D\fR \fIname\fR" 4 98.Em outfile
218.IX Item "-D name" 99means to write to standard output.
219Predefine \fIname\fR as a macro, with definition \f(CW1\fR. 100Also, if either file is omitted, it means the same as if
220.IP "\fB\-D\fR \fIname\fR\fB=\fR\fIdefinition\fR" 4 101.Sy -
221.IX Item "-D name=definition" 102had been specified for that file.
222The contents of \fIdefinition\fR are tokenized and processed as if 103.Pp
223they appeared during translation phase three in a \fB#define\fR 104Unless otherwise noted, or the option ends in
224directive. In particular, the definition will be truncated by 105.Sy = ,
225embedded newline characters. 106all options which take an argument may have that argument appear either immediately after the option, or with a space between option and argument:
226.Sp 107.Fl Ifoo
227If you are invoking the preprocessor from a shell or shell-like 108and
228program you may need to use the shell's quoting syntax to protect 109.Fl I Ar foo
229characters such as spaces that have a meaning in the shell syntax. 110have the same effect.
230.Sp 111.Pp
231If you wish to define a function-like macro on the command line, write 112Many options have multi-letter names; therefore multiple single-letter options may
232its argument list with surrounding parentheses before the equals sign 113.Em not
233(if any). Parentheses are meaningful to most shells, so you will need 114be grouped:
234to quote the option. With \fBsh\fR and \fBcsh\fR, 115.Fl dM
235\&\fB\-D'\fR\fIname\fR\fB(\fR\fIargs...\fR\fB)=\fR\fIdefinition\fR\fB'\fR works. 116is very different from
236.Sp 117.Fl d Fl M .
237\&\fB\-D\fR and \fB\-U\fR options are processed in the order they 118.Pp
238are given on the command line. All \fB\-imacros\fR \fIfile\fR and 119.Bl -tag -width xx -compact
239\&\fB\-include\fR \fIfile\fR options are processed after all 120.It Fl D Ar name
240\&\fB\-D\fR and \fB\-U\fR options. 121Predefine
241.IP "\fB\-U\fR \fIname\fR" 4 122.Em name
242.IX Item "-U name" 123as a macro, with definition
243Cancel any previous definition of \fIname\fR, either built in or 124.Va 1 .
244provided with a \fB\-D\fR option. 125.Pp
245.IP "\fB\-undef\fR" 4 126.It Fl D Ar name Ns = Ns Ar definition
246.IX Item "-undef" 127The contents of
247Do not predefine any system-specific or GCC-specific macros. The 128.Em definition
248standard predefined macros remain defined. 129are tokenized and processed as if they appeared during translation phase three in a
249.IP "\fB\-I\fR \fIdir\fR" 4 130.Sy #define
250.IX Item "-I dir" 131directive.
251Add the directory \fIdir\fR to the list of directories to be searched 132In particular, the definition will be truncated by embedded newline characters.
252for header files. 133.Pp
253.Sp 134If 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.
254Directories named by \fB\-I\fR are searched before the standard 135.Pp
255system include directories. If the directory \fIdir\fR is a standard 136If you wish to define a function-like macro on the command line, write its argument list with surrounding parentheses before the equals sign (if any).
256system include directory, the option is ignored to ensure that the 137Parentheses are meaningful to most shells, so you will need to quote the option.
257default search order for system directories and the special treatment 138With
258of system headers are not defeated 139.Nm sh
259\&. 140and
260.IP "\fB\-o\fR \fIfile\fR" 4 141.Nm csh ,
261.IX Item "-o file" 142.Sy -D'name(args...)=definition'
262Write output to \fIfile\fR. This is the same as specifying \fIfile\fR 143works.
263as the second non-option argument to \fBcpp\fR. \fBgcc\fR has a 144.Pp
264different interpretation of a second non-option argument, so you must 145.Fl D
265use \fB\-o\fR to specify the output file. 146and
266.IP "\fB\-Wall\fR" 4 147.Fl U
267.IX Item "-Wall" 148options are processed in the order they are given on the command line.
 149All
 150.Fl imacros Ar file
 151and
 152.Fl include Ar file
 153options are processed after all
 154.Fl D
 155and
 156.Fl U
 157options.
 158.Pp
 159.It Fl U Ar name
 160Cancel any previous definition of
 161.Em name ,
 162either built in or provided with a
 163.Fl D
 164option.
 165.Pp
 166.It Fl undef
 167Do not predefine any system-specific or GCC-specific macros.
 168The standard predefined macros remain defined.
 169.Pp
 170.It Fl I Ar dir
 171Add the directory
 172.Em dir
 173to the list of directories to be searched for header files.
 174.Pp
 175Directories named by
 176.Fl I
 177are searched before the standard system include directories.
 178If the directory
 179.Em dir
 180is a standard system include directory, the option is ignored to ensure that the default search order for system directories and the special treatment of system headers are not defeated .
 181.Pp
 182.It Fl o Ar file
 183Write output to
 184.Em file .
 185This is the same as specifying
 186.Em file
 187as the second non-option argument to
 188.Nm cpp .
 189.Nm gcc
 190has a different interpretation of a second non-option argument, so you must use
 191.Fl o
 192to specify the output file.
 193.Pp
 194.It Fl Wall
268Turns on all optional warnings which are desirable for normal code. 195Turns on all optional warnings which are desirable for normal code.
269At present this is \fB\-Wcomment\fR, \fB\-Wtrigraphs\fR, 196At present this is
270\&\fB\-Wmultichar\fR and a warning about integer promotion causing a 197.Fl Wcomment ,
271change of sign in \f(CW\*(C`#if\*(C'\fR expressions. Note that many of the 198.Fl Wtrigraphs ,
272preprocessor's warnings are on by default and have no options to 199.Fl Wmultichar
273control them. 200and a warning about integer promotion causing a change of sign in
274.IP "\fB\-Wcomment\fR" 4 201.Va #if
275.IX Item "-Wcomment" 202expressions.
276.PD 0 203Note that many of the preprocessor's warnings are on by default and have no options to control them.
277.IP "\fB\-Wcomments\fR" 4 204.Pp
278.IX Item "-Wcomments" 205.It Fl Wcomment
279.PD 206.It Fl Wcomments
280Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR 207Warn whenever a comment-start sequence
281comment, or whenever a backslash-newline appears in a \fB//\fR comment. 208.Sy /*
 209appears in a
 210.Sy /*
 211comment, or whenever a backslash-newline appears in a
 212.Sy //
 213comment.
282(Both forms have the same effect.) 214(Both forms have the same effect.)
283.IP "\fB\-Wtrigraphs\fR" 4 215.Pp
284.IX Item "-Wtrigraphs" 216.It Fl Wtrigraphs
285@anchor{Wtrigraphs} 217@anchor{Wtrigraphs} Most trigraphs in comments cannot affect the meaning of the program.
286Most trigraphs in comments cannot affect the meaning of the program. 218However, a trigraph that would form an escaped newline
287However, a trigraph that would form an escaped newline (\fB??/\fR at 219.Sy ( ??/
288the end of a line) can, by changing where the comment begins or ends. 220at the end of a line) can, by changing where the comment begins or ends.
289Therefore, only trigraphs that would form escaped newlines produce 221Therefore, only trigraphs that would form escaped newlines produce warnings inside a comment.
290warnings inside a comment. 222.Pp
291.Sp 223This option is implied by
292This option is implied by \fB\-Wall\fR. If \fB\-Wall\fR is not 224.Fl Wall .
293given, this option is still enabled unless trigraphs are enabled. To 225If
294get trigraph conversion without warnings, but get the other 226.Fl Wall
295\&\fB\-Wall\fR warnings, use \fB\-trigraphs \-Wall \-Wno\-trigraphs\fR. 227is not given, this option is still enabled unless trigraphs are enabled.
296.IP "\fB\-Wtraditional\fR" 4 228To get trigraph conversion without warnings, but get the other
297.IX Item "-Wtraditional" 229.Fl Wall
298Warn about certain constructs that behave differently in traditional and 230warnings, use
299\&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C 231.Fl trigraphs Fl Wall Fl Wno-trigraphs .
300equivalent, and problematic constructs which should be avoided. 232.Pp
301.IP "\fB\-Wimport\fR" 4 233.It Fl Wtraditional
302.IX Item "-Wimport" 234Warn about certain constructs that behave differently in traditional and ISO C.
303Warn the first time \fB#import\fR is used. 235Also warn about ISO C constructs that have no traditional C equivalent, and problematic constructs which should be avoided.
304.IP "\fB\-Wundef\fR" 4 236.Pp
305.IX Item "-Wundef" 237.It Fl Wimport
 238Warn the first time
 239.Sy #import
 240is used.
 241.Pp
 242.It Fl Wundef
306Warn whenever an identifier which is not a macro is encountered in an 243Warn whenever an identifier which is not a macro is encountered in an
307\&\fB#if\fR directive, outside of \fBdefined\fR. Such identifiers are 244.Sy #if
308replaced with zero. 245directive, outside of
309.IP "\fB\-Wunused\-macros\fR" 4 246.Sy defined .
310.IX Item "-Wunused-macros" 247Such identifiers are replaced with zero.
311Warn about macros defined in the main file that are unused. A macro 248.Pp
312is \fIused\fR if it is expanded or tested for existence at least once. 249.It Fl Wunused-macros
313The preprocessor will also warn if the macro has not been used at the 250Warn about macros defined in the main file that are unused.
314time it is redefined or undefined. 251A macro is
315.Sp 252.Em used
316Built-in macros, macros defined on the command line, and macros 253if it is expanded or tested for existence at least once.
317defined in include files are not warned about. 254The preprocessor will also warn if the macro has not been used at the time it is redefined or undefined.
318.Sp 255.Pp
319\&\fINote:\fR If a macro is actually used, but only used in skipped 256Built-in macros, macros defined on the command line, and macros defined in include files are not warned about.
320conditional blocks, then \s-1CPP\s0 will report it as unused. To avoid the 257.Pp
321warning in such a case, you might improve the scope of the macro's 258.Em Note:
322definition by, for example, moving it into the first skipped block. 259If a macro is actually used, but only used in skipped conditional blocks, then CPP will report it as unused.
 260To avoid the warning in such a case, you might improve the scope of the macro's definition by, for example, moving it into the first skipped block.
323Alternatively, you could provide a dummy use with something like: 261Alternatively, you could provide a dummy use with something like:
324.Sp 262.Pp
325.Vb 2 263.Bd -literal -offset indent
326\& #if defined the_macro_causing_the_warning 264#if defined the_macro_causing_the_warning
327\& #endif 265#endif
328.Ve 266.Ed
329.IP "\fB\-Wendif\-labels\fR" 4 267.Pp
330.IX Item "-Wendif-labels" 268.It Fl Wendif-labels
331Warn whenever an \fB#else\fR or an \fB#endif\fR are followed by text. 269Warn whenever an
 270.Sy #else
 271or an
 272.Sy #endif
 273are followed by text.
332This usually happens in code of the form 274This usually happens in code of the form
333.Sp 275.Pp
334.Vb 5 276.Bd -literal -offset indent
335\& #if FOO 277#if FOO
336\& ... 278\&...
337\& #else FOO 279#else FOO
338\& ... 280\&...
339\& #endif FOO 281#endif FOO
340.Ve 282.Ed
341.Sp 283The second and third
342The second and third \f(CW\*(C`FOO\*(C'\fR should be in comments, but often are not 284.Va FOO
343in older programs. This warning is on by default. 285should be in comments, but often are not in older programs.
344.IP "\fB\-Werror\fR" 4 286This warning is on by default.
345.IX Item "-Werror" 287.Pp
346Make all warnings into hard errors. Source code which triggers warnings 288.It Fl Werror
347will be rejected. 289Make all warnings into hard errors.
348.IP "\fB\-Wsystem\-headers\fR" 4 290Source code which triggers warnings will be rejected.
349.IX Item "-Wsystem-headers" 291.Pp
350Issue warnings for code in system headers. These are normally unhelpful 292.It Fl Wsystem-headers
351in finding bugs in your own code, therefore suppressed. If you are 293Issue warnings for code in system headers.
352responsible for the system library, you may want to see them. 294These are normally unhelpful in finding bugs in your own code, therefore suppressed.
353.IP "\fB\-w\fR" 4 295If you are responsible for the system library, you may want to see them.
354.IX Item "-w" 296.Pp
355Suppress all warnings, including those which \s-1GNU\s0 \s-1CPP\s0 issues by default. 297.It Fl w
356.IP "\fB\-pedantic\fR" 4 298Suppress all warnings, including those which GNU CPP issues by default.
357.IX Item "-pedantic" 299.Pp
358Issue all the mandatory diagnostics listed in the C standard. Some of 300.It Fl pedantic
359them are left out by default, since they trigger frequently on harmless 301Issue all the mandatory diagnostics listed in the C standard.
360code. 302Some of them are left out by default, since they trigger frequently on harmless code.
361.IP "\fB\-pedantic\-errors\fR" 4 303.Pp
362.IX Item "-pedantic-errors" 304.It Fl pedantic-errors
363Issue all the mandatory diagnostics, and make all mandatory diagnostics 305Issue all the mandatory diagnostics, and make all mandatory diagnostics into errors.
364into errors. This includes mandatory diagnostics that \s-1GCC\s0 issues 306This includes mandatory diagnostics that GCC issues without
365without \fB\-pedantic\fR but treats as warnings. 307.Fl pedantic
366.IP "\fB\-M\fR" 4 308but treats as warnings.
367.IX Item "-M" 309.Pp
368Instead of outputting the result of preprocessing, output a rule 310.It Fl M
369suitable for \fBmake\fR describing the dependencies of the main 311Instead of outputting the result of preprocessing, output a rule suitable for
370source file. The preprocessor outputs one \fBmake\fR rule containing 312.Sy make
371the object file name for that source file, a colon, and the names of all 313describing the dependencies of the main source file.
372the included files, including those coming from \fB\-include\fR or 314The preprocessor outputs one
373\&\fB\-imacros\fR command line options. 315.Sy make
374.Sp 316rule containing the object file name for that source file, a colon, and the names of all the included files, including those coming from
375Unless specified explicitly (with \fB\-MT\fR or \fB\-MQ\fR), the 317.Fl include
376object file name consists of the basename of the source file with any 318or
377suffix replaced with object file suffix. If there are many included 319.Fl imacros
378files then the rule is split into several lines using \fB\e\fR\-newline. 320command line options.
 321.Pp
 322Unless specified explicitly (with
 323.Fl MT
 324or
 325.Fl MQ ) ,
 326the object file name consists of the basename of the source file with any suffix replaced with object file suffix.
 327If there are many included files then the rule is split into several lines using
 328.Sy \e
 329-newline.
379The rule has no commands. 330The rule has no commands.
380.Sp 331.Pp
381This option does not suppress the preprocessor's debug output, such as 332This option does not suppress the preprocessor's debug output, such as
382\&\fB\-dM\fR. To avoid mixing such debug output with the dependency 333.Fl dM .
383rules you should explicitly specify the dependency output file with 334To avoid mixing such debug output with the dependency rules you should explicitly specify the dependency output file with
384\&\fB\-MF\fR, or use an environment variable like 335.Fl MF ,
385\&\fB\s-1DEPENDENCIES_OUTPUT\s0\fR. Debug output 336or use an environment variable like
386will still be sent to the regular output stream as normal. 337.Sy DEPENDENCIES_OUTPUT .
387.Sp 338Debug output will still be sent to the regular output stream as normal.
388Passing \fB\-M\fR to the driver implies \fB\-E\fR, and suppresses 339.Pp
389warnings with an implicit \fB\-w\fR. 340Passing
390.IP "\fB\-MM\fR" 4 341.Fl M
391.IX Item "-MM" 342to the driver implies
392Like \fB\-M\fR but do not mention header files that are found in 343.Fl E ,
393system header directories, nor header files that are included, 344and suppresses warnings with an implicit
394directly or indirectly, from such a header. 345.Fl w .
395.Sp 346.Pp
 347.It Fl MM
 348Like
 349.Fl M
 350but do not mention header files that are found in system header directories, nor header files that are included, directly or indirectly, from such a header.
 351.Pp
396This implies that the choice of angle brackets or double quotes in an 352This implies that the choice of angle brackets or double quotes in an
397\&\fB#include\fR directive does not in itself determine whether that 353.Sy #include
398header will appear in \fB\-MM\fR dependency output. This is a 354directive does not in itself determine whether that header will appear in
399slight change in semantics from \s-1GCC\s0 versions 3.0 and earlier. 355.Fl MM
400.Sp 356dependency output.
 357This is a slight change in semantics from GCC versions 3.0 and earlier.
 358.Pp
401@anchor{dashMF} 359@anchor{dashMF}
402.IP "\fB\-MF\fR \fIfile\fR" 4 360.Pp
403.IX Item "-MF file" 361.It Fl MF Ar file
404When used with \fB\-M\fR or \fB\-MM\fR, specifies a 362When used with
405file to write the dependencies to. If no \fB\-MF\fR switch is given 363.Fl M
406the preprocessor sends the rules to the same place it would have sent 364or
407preprocessed output. 365.Fl MM ,
408.Sp 366specifies a file to write the dependencies to.
409When used with the driver options \fB\-MD\fR or \fB\-MMD\fR, 367If no
410\&\fB\-MF\fR overrides the default dependency output file. 368.Fl MF
411.IP "\fB\-MG\fR" 4 369switch is given the preprocessor sends the rules to the same place it would have sent preprocessed output.
412.IX Item "-MG" 370.Pp
413In conjunction with an option such as \fB\-M\fR requesting 371When used with the driver options
414dependency generation, \fB\-MG\fR assumes missing header files are 372.Fl MD
415generated files and adds them to the dependency list without raising 373or
416an error. The dependency filename is taken directly from the 374.Fl MMD ,
417\&\f(CW\*(C`#include\*(C'\fR directive without prepending any path. \fB\-MG\fR 375.Fl MF
418also suppresses preprocessed output, as a missing header file renders 376overrides the default dependency output file.
419this useless. 377.Pp
420.Sp 378.It Fl MG
 379In conjunction with an option such as
 380.Fl M
 381requesting dependency generation,
 382.Fl MG
 383assumes missing header files are generated files and adds them to the dependency list without raising an error.
 384The dependency filename is taken directly from the
 385.Va #include
 386directive without prepending any path.
 387.Fl MG
 388also suppresses preprocessed output, as a missing header file renders this useless.
 389.Pp
421This feature is used in automatic updating of makefiles. 390This feature is used in automatic updating of makefiles.
422.IP "\fB\-MP\fR" 4 391.Pp
423.IX Item "-MP" 392.It Fl MP
424This option instructs \s-1CPP\s0 to add a phony target for each dependency 393This option instructs CPP to add a phony target for each dependency other than the main file, causing each to depend on nothing.
425other than the main file, causing each to depend on nothing. These 394These dummy rules work around errors
426dummy rules work around errors \fBmake\fR gives if you remove header 395.Sy make
427files without updating the \fIMakefile\fR to match. 396gives if you remove header files without updating the
428.Sp 397.Pa Makefile
 398to match.
 399.Pp
429This is typical output: 400This is typical output:
430.Sp 401.Pp
431.Vb 1 402.Bd -literal -offset indent
432\& test.o: test.c test.h 403test.o: test.c test.h
433.Ve 404
434.Sp 405test.h:
435.Vb 1 406.Ed
436\& test.h: 407.It Fl MT Ar target
437.Ve 408Change the target of the rule emitted by dependency generation.
438.IP "\fB\-MT\fR \fItarget\fR" 4 409By default CPP takes the name of the main input file, including any path, deletes any file suffix such as
439.IX Item "-MT target" 410.Sy .c ,
440Change the target of the rule emitted by dependency generation. By 411and appends the platform's usual object suffix.
441default \s-1CPP\s0 takes the name of the main input file, including any path, 412The result is the target.
442deletes any file suffix such as \fB.c\fR, and appends the platform's 413.Pp
443usual object suffix. The result is the target. 414An
444.Sp 415.Fl MT
445An \fB\-MT\fR option will set the target to be exactly the string you 416option will set the target to be exactly the string you specify.
446specify. If you want multiple targets, you can specify them as a single 417If you want multiple targets, you can specify them as a single argument to
447argument to \fB\-MT\fR, or use multiple \fB\-MT\fR options. 418.Fl MT ,
448.Sp 419or use multiple
449For example, \fB\-MT\ '$(objpfx)foo.o'\fR might give 420.Fl MT
450.Sp 421options.
451.Vb 1 422.Pp
452\& $(objpfx)foo.o: foo.c 423For example,
453.Ve 424.Sy -MT '$(objpfx)foo.o'
454.IP "\fB\-MQ\fR \fItarget\fR" 4 425might give
455.IX Item "-MQ target" 426.Pp
456Same as \fB\-MT\fR, but it quotes any characters which are special to 427.Bd -literal -offset indent
457Make. \fB\-MQ\ '$(objpfx)foo.o'\fR gives 428$(objpfx)foo.o: foo.c
458.Sp 429.Ed
459.Vb 1 430.It Fl MQ Ar target
460\& $$(objpfx)foo.o: foo.c 431Same as
461.Ve 432.Fl MT ,
462.Sp 433but it quotes any characters which are special to Make.
 434.Sy -MQ '$(objpfx)foo.o'
 435gives
 436.Pp
 437.Bd -literal -offset indent
 438$$(objpfx)foo.o: foo.c
 439.Ed
463The default target is automatically quoted, as if it were given with 440The default target is automatically quoted, as if it were given with
464\&\fB\-MQ\fR. 441.Fl MQ .
465.IP "\fB\-MD\fR" 4 442.Pp
466.IX Item "-MD" 443.It Fl MD
467\&\fB\-MD\fR is equivalent to \fB\-M \-MF\fR \fIfile\fR, except that 444.Fl MD
468\&\fB\-E\fR is not implied. The driver determines \fIfile\fR based on 445is equivalent to
469whether an \fB\-o\fR option is given. If it is, the driver uses its 446.Fl M Fl MF Ar file ,
470argument but with a suffix of \fI.d\fR, otherwise it take the 447except that
471basename of the input file and applies a \fI.d\fR suffix. 448.Fl E
472.Sp 449is not implied.
473If \fB\-MD\fR is used in conjunction with \fB\-E\fR, any 450The driver determines
474\&\fB\-o\fR switch is understood to specify the dependency output file 451.Em file
475(but \f(CW@pxref\fR{dashMF,,\-MF}), but if used without \fB\-E\fR, each \fB\-o\fR 452based on whether an
 453.Fl o
 454option is given.
 455If it is, the driver uses its argument but with a suffix of
 456.Pa .d ,
 457otherwise it take the basename of the input file and applies a
 458.Pa .d
 459suffix.
 460.Pp
 461If
 462.Fl MD
 463is used in conjunction with
 464.Fl E ,
 465any
 466.Fl o
 467switch is understood to specify the dependency output file (but @pxref{dashMF,,-MF}), but if used without
 468.Fl E ,
 469each
 470.Fl o
476is understood to specify a target object file. 471is understood to specify a target object file.
477.Sp 472.Pp
478Since \fB\-E\fR is not implied, \fB\-MD\fR can be used to generate 473Since
479a dependency output file as a side-effect of the compilation process. 474.Fl E
480.IP "\fB\-MMD\fR" 4 475is not implied,
481.IX Item "-MMD" 476.Fl MD
482Like \fB\-MD\fR except mention only user header files, not system 477can be used to generate a dependency output file as a side-effect of the compilation process.
483header files. 478.Pp
484.IP "\fB\-x c\fR" 4 479.It Fl MMD
485.IX Item "-x c" 480Like
486.PD 0 481.Fl MD
487.IP "\fB\-x c++\fR" 4 482except mention only user header files, not system header files.
488.IX Item "-x c++" 483.Pp
489.IP "\fB\-x objective-c\fR" 4 484.It Fl x Ar c
490.IX Item "-x objective-c" 485.It Fl x Ar c++
491.IP "\fB\-x assembler-with-cpp\fR" 4 486.It Fl x Ar objective-c
492.IX Item "-x assembler-with-cpp" 487.It Fl x Ar assembler-with-cpp
493.PD 488Specify the source language: C, C++, Objective-C, or assembly.
494Specify the source language: C, \*(C+, Objective\-C, or assembly. This has 489This has nothing to do with standards conformance or extensions; it merely selects which base syntax to expect.
495nothing to do with standards conformance or extensions; it merely 490If you give none of these options, cpp will deduce the language from the extension of the source file:
496selects which base syntax to expect. If you give none of these options, 491.Sy .c ,
497cpp will deduce the language from the extension of the source file: 492.Sy .cc ,
498\&\fB.c\fR, \fB.cc\fR, \fB.m\fR, or \fB.S\fR. Some other common 493.Sy .m ,
499extensions for \*(C+ and assembly are also recognized. If cpp does not 494or
500recognize the extension, it will treat the file as C; this is the most 495.Sy .S .
501generic mode. 496Some other common extensions for C++ and assembly are also recognized.
502.Sp 497If cpp does not recognize the extension, it will treat the file as C; this is the most generic mode.
503\&\fINote:\fR Previous versions of cpp accepted a \fB\-lang\fR option 498.Pp
504which selected both the language and the standards conformance level. 499.Em Note:
505This option has been removed, because it conflicts with the \fB\-l\fR 500Previous versions of cpp accepted a
 501.Fl lang
 502option which selected both the language and the standards conformance level.
 503This option has been removed, because it conflicts with the
 504.Fl l
506option. 505option.
507.IP "\fB\-std=\fR\fIstandard\fR" 4 506.Pp
508.IX Item "-std=standard" 507.It Fl std= Ns Ar standard
509.PD 0 508.It Fl ansi
510.IP "\fB\-ansi\fR" 4 509Specify the standard to which the code should conform.
511.IX Item "-ansi" 510Currently CPP knows about C and C++ standards; others may be added in the future.
512.PD 511.Pp
513Specify the standard to which the code should conform. Currently \s-1CPP\s0 512.Em standard
514knows about C and \*(C+ standards; others may be added in the future. 
515.Sp 
516\&\fIstandard\fR 
517may be one of: 513may be one of:
518.RS 4 514.Pp
519.ie n .IP """iso9899:1990""" 4 515.Bl -tag -width xx
520.el .IP "\f(CWiso9899:1990\fR" 4 516.It Sy iso9899:1990 Ns
521.IX Item "iso9899:1990" 517.It Sy c89 Ns
522.PD 0 518The ISO C standard from 1990.
523.ie n .IP """c89""" 4 519.Sy c89
524.el .IP "\f(CWc89\fR" 4 520is the customary shorthand for this version of the standard.
525.IX Item "c89" 521.Pp
526.PD 522The
527The \s-1ISO\s0 C standard from 1990. \fBc89\fR is the customary shorthand for 523.Fl ansi
528this version of the standard. 524option is equivalent to
529.Sp 525.Fl std=c89 .
530The \fB\-ansi\fR option is equivalent to \fB\-std=c89\fR. 526.Pp
531.ie n .IP """iso9899:199409""" 4 527.It Sy iso9899:199409 Ns
532.el .IP "\f(CWiso9899:199409\fR" 4 
533.IX Item "iso9899:199409" 
534The 1990 C standard, as amended in 1994. 528The 1990 C standard, as amended in 1994.
535.ie n .IP """iso9899:1999""" 4 529.Pp
536.el .IP "\f(CWiso9899:1999\fR" 4 530.It Sy iso9899:1999 Ns
537.IX Item "iso9899:1999" 531.It Sy c99 Ns
538.PD 0 532.It Sy iso9899:199x Ns
539.ie n .IP """c99""" 4 533.It Sy c9x Ns
540.el .IP "\f(CWc99\fR" 4 534The revised ISO C standard, published in December 1999.
541.IX Item "c99" 535Before publication, this was known as C9X.
542.ie n .IP """iso9899:199x""" 4 536.Pp
543.el .IP "\f(CWiso9899:199x\fR" 4 537.It Sy gnu89 Ns
544.IX Item "iso9899:199x" 538The 1990 C standard plus GNU extensions.
545.ie n .IP """c9x""" 4 539This is the default.
546.el .IP "\f(CWc9x\fR" 4 540.Pp
547.IX Item "c9x" 541.It Sy gnu99 Ns
548.PD 542.It Sy gnu9x Ns
549The revised \s-1ISO\s0 C standard, published in December 1999. Before 543The 1999 C standard plus GNU extensions.
550publication, this was known as C9X. 544.Pp
551.ie n .IP """gnu89""" 4 545.It Sy c++98 Ns
552.el .IP "\f(CWgnu89\fR" 4 546The 1998 ISO C++ standard plus amendments.
553.IX Item "gnu89" 547.Pp
554The 1990 C standard plus \s-1GNU\s0 extensions. This is the default. 548.It Sy gnu++98 Ns
555.ie n .IP """gnu99""" 4 549The same as
556.el .IP "\f(CWgnu99\fR" 4 550.Fl std=c++98
557.IX Item "gnu99" 551plus GNU extensions.
558.PD 0 552This is the default for C++ code.
559.ie n .IP """gnu9x""" 4 553.Pp
560.el .IP "\f(CWgnu9x\fR" 4 554.El
561.IX Item "gnu9x" 555.It Fl I-
562.PD 556Split the include path.
563The 1999 C standard plus \s-1GNU\s0 extensions. 557Any directories specified with
564.ie n .IP """c++98""" 4 558.Fl I
565.el .IP "\f(CWc++98\fR" 4 559options before
566.IX Item "c++98" 560.Fl I-
567The 1998 \s-1ISO\s0 \*(C+ standard plus amendments. 561are searched only for headers requested with
568.ie n .IP """gnu++98""" 4 562.Va .Sy #include \&"file" ;
569.el .IP "\f(CWgnu++98\fR" 4 563they are not searched for
570.IX Item "gnu++98" 564.Va .Sy #include \*[Lt]file\*[Gt] .
571The same as \fB\-std=c++98\fR plus \s-1GNU\s0 extensions. This is the 565If additional directories are specified with
572default for \*(C+ code. 566.Fl I
573.RE 567options after the
574.RS 4 568.Fl I- ,
575.RE 569those directories are searched for all
576.IP "\fB\-I\-\fR" 4 570.Sy #include
577.IX Item "-I-" 571directives.
578Split the include path. Any directories specified with \fB\-I\fR 572.Pp
579options before \fB\-I\-\fR are searched only for headers requested with 573In addition,
580\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for 574.Fl I-
581\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR. If additional directories are 575inhibits the use of the directory of the current file directory as the first search directory for
582specified with \fB\-I\fR options after the \fB\-I\-\fR, those 576.Va .Sy #include \&"file" .
583directories are searched for all \fB#include\fR directives. 577.Pp
584.Sp 
585In addition, \fB\-I\-\fR inhibits the use of the directory of the current 
586file directory as the first search directory for \f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR. 
587.Sp 
588This option has been deprecated. 578This option has been deprecated.
589.IP "\fB\-nostdinc\fR" 4 579.Pp
590.IX Item "-nostdinc" 580.It Fl nostdinc
591Do not search the standard system directories for header files. 581Do not search the standard system directories for header files.
592Only the directories you have specified with \fB\-I\fR options 582Only the directories you have specified with
593(and the directory of the current file, if appropriate) are searched. 583.Fl I
594.IP "\fB\-nostdinc++\fR" 4 584options (and the directory of the current file, if appropriate) are searched.
595.IX Item "-nostdinc++" 585.Pp
596Do not search for header files in the \*(C+\-specific standard directories, 586.It Fl nostdinc++
597but do still search the other standard directories. (This option is 587Do not search for header files in the C++-specific standard directories, but do still search the other standard directories.
598used when building the \*(C+ library.) 588(This option is used when building the C++ library.)
599.IP "\fB\-include\fR \fIfile\fR" 4 589.Pp
600.IX Item "-include file" 590.It Fl include Ar file
601Process \fIfile\fR as if \f(CW\*(C`#include "file"\*(C'\fR appeared as the first 591Process
602line of the primary source file. However, the first directory searched 592.Em file
603for \fIfile\fR is the preprocessor's working directory \fIinstead of\fR 593as if
604the directory containing the main source file. If not found there, it 594.Va #include \&"file"
605is searched for in the remainder of the \f(CW\*(C`#include "..."\*(C'\fR search 595appeared as the first line of the primary source file.
606chain as normal. 596However, the first directory searched for
607.Sp 597.Em file
608If multiple \fB\-include\fR options are given, the files are included 598is the preprocessor's working directory
609in the order they appear on the command line. 599.Em instead of
610.IP "\fB\-imacros\fR \fIfile\fR" 4 600the directory containing the main source file.
611.IX Item "-imacros file" 601If not found there, it is searched for in the remainder of the
612Exactly like \fB\-include\fR, except that any output produced by 602.Va #include \&"..."
613scanning \fIfile\fR is thrown away. Macros it defines remain defined. 603search chain as normal.
614This allows you to acquire all the macros from a header without also 604.Pp
615processing its declarations. 605If multiple
616.Sp 606.Fl include
617All files specified by \fB\-imacros\fR are processed before all files 607options are given, the files are included in the order they appear on the command line.
618specified by \fB\-include\fR. 608.Pp
619.IP "\fB\-idirafter\fR \fIdir\fR" 4 609.It Fl imacros Ar file
620.IX Item "-idirafter dir" 610Exactly like
621Search \fIdir\fR for header files, but do it \fIafter\fR all 611.Fl include ,
622directories specified with \fB\-I\fR and the standard system directories 612except that any output produced by scanning
623have been exhausted. \fIdir\fR is treated as a system include directory. 613.Em file
624.IP "\fB\-iprefix\fR \fIprefix\fR" 4 614is thrown away.
625.IX Item "-iprefix prefix" 615Macros it defines remain defined.
626Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR 616This allows you to acquire all the macros from a header without also processing its declarations.
627options. If the prefix represents a directory, you should include the 617.Pp
628final \fB/\fR. 618All files specified by
629.IP "\fB\-iwithprefix\fR \fIdir\fR" 4 619.Fl imacros
630.IX Item "-iwithprefix dir" 620are processed before all files specified by
631.PD 0 621.Fl include .
632.IP "\fB\-iwithprefixbefore\fR \fIdir\fR" 4 622.Pp
633.IX Item "-iwithprefixbefore dir" 623.It Fl idirafter Ar dir
634.PD 624Search
635Append \fIdir\fR to the prefix specified previously with 625.Em dir
636\&\fB\-iprefix\fR, and add the resulting directory to the include search 626for header files, but do it
637path. \fB\-iwithprefixbefore\fR puts it in the same place \fB\-I\fR 627.Em after
638would; \fB\-iwithprefix\fR puts it where \fB\-idirafter\fR would. 628all directories specified with
639.IP "\fB\-isysroot\fR \fIdir\fR" 4 629.Fl I
640.IX Item "-isysroot dir" 630and the standard system directories have been exhausted.
641This option is like the \fB\-\-sysroot\fR option, but applies only to 631.Em dir
642header files. See the \fB\-\-sysroot\fR option for more information. 632is treated as a system include directory.
643.IP "\fB\-isystem\fR \fIdir\fR" 4 633.Pp
644.IX Item "-isystem dir" 634.It Fl iprefix Ar prefix
645Search \fIdir\fR for header files, after all directories specified by 635Specify
646\&\fB\-I\fR but before the standard system directories. Mark it 636.Em prefix
647as a system directory, so that it gets the same special treatment as 637as the prefix for subsequent
648is applied to the standard system directories. 638.Fl iwithprefix
649.IP "\fB\-iquote\fR \fIdir\fR" 4 639options.
650.IX Item "-iquote dir" 640If the prefix represents a directory, you should include the final
651Search \fIdir\fR only for header files requested with 641.Sy / .
652\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for 642.Pp
653\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR, before all directories specified by 643.It Fl iwithprefix Ar dir
654\&\fB\-I\fR and before the standard system directories. 644.It Fl iwithprefixbefore Ar dir
655.IP "\fB\-fdollars\-in\-identifiers\fR" 4 645Append
656.IX Item "-fdollars-in-identifiers" 646.Em dir
657@anchor{fdollars\-in\-identifiers} 647to the prefix specified previously with
658Accept \fB$\fR in identifiers. 648.Fl iprefix ,
659.IP "\fB\-fextended\-identifiers\fR" 4 649and add the resulting directory to the include search path.
660.IX Item "-fextended-identifiers" 650.Fl iwithprefixbefore
661Accept universal character names in identifiers. This option is 651puts it in the same place
662experimental; in a future version of \s-1GCC\s0, it will be enabled by 652.Fl I
663default for C99 and \*(C+. 653would;
664.IP "\fB\-fpreprocessed\fR" 4 654.Fl iwithprefix
665.IX Item "-fpreprocessed" 655puts it where
666Indicate to the preprocessor that the input file has already been 656.Fl idirafter
667preprocessed. This suppresses things like macro expansion, trigraph 657would.
668conversion, escaped newline splicing, and processing of most directives. 658.Pp
669The preprocessor still recognizes and removes comments, so that you can 659.It Fl isysroot Ar dir
670pass a file preprocessed with \fB\-C\fR to the compiler without 660This option is like the
671problems. In this mode the integrated preprocessor is little more than 661.Fl -sysroot
672a tokenizer for the front ends. 662option, but applies only to header files.
673.Sp 663See the
674\&\fB\-fpreprocessed\fR is implicit if the input file has one of the 664.Fl -sysroot
675extensions \fB.i\fR, \fB.ii\fR or \fB.mi\fR. These are the 665option for more information.
676extensions that \s-1GCC\s0 uses for preprocessed files created by 666.Pp
677\&\fB\-save\-temps\fR. 667.It Fl isystem Ar dir
678.IP "\fB\-ftabstop=\fR\fIwidth\fR" 4 668Search
679.IX Item "-ftabstop=width" 669.Em dir
680Set the distance between tab stops. This helps the preprocessor report 670for header files, after all directories specified by
681correct column numbers in warnings or errors, even if tabs appear on the 671.Fl I
682line. If the value is less than 1 or greater than 100, the option is 672but before the standard system directories.
683ignored. The default is 8. 673Mark it as a system directory, so that it gets the same special treatment as is applied to the standard system directories.
684.IP "\fB\-fexec\-charset=\fR\fIcharset\fR" 4 674.Pp
685.IX Item "-fexec-charset=charset" 675.It Fl cxx-isystem Ar dir
686Set the execution character set, used for string and character 676Search
687constants. The default is \s-1UTF\-8\s0. \fIcharset\fR can be any encoding 677.Em dir
688supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine. 678for C++ header files, after all directories specified by
689.IP "\fB\-fwide\-exec\-charset=\fR\fIcharset\fR" 4 679.Fl I
690.IX Item "-fwide-exec-charset=charset" 680but before the standard system directories.
691Set the wide execution character set, used for wide string and 681Mark it as a system directory, so that it gets the same special treatment as is applied to the standard system directories.
692character constants. The default is \s-1UTF\-32\s0 or \s-1UTF\-16\s0, whichever 682.Pp
693corresponds to the width of \f(CW\*(C`wchar_t\*(C'\fR. As with 683.It Fl iquote Ar dir
694\&\fB\-fexec\-charset\fR, \fIcharset\fR can be any encoding supported 684Search
695by the system's \f(CW\*(C`iconv\*(C'\fR library routine; however, you will have 685.Em dir
696problems with encodings that do not fit exactly in \f(CW\*(C`wchar_t\*(C'\fR. 686only for header files requested with
697.IP "\fB\-finput\-charset=\fR\fIcharset\fR" 4 687.Va .Sy #include \&"file" ;
698.IX Item "-finput-charset=charset" 688they are not searched for
699Set the input character set, used for translation from the character 689.Va .Sy #include \*[Lt]file\*[Gt] ,
700set of the input file to the source character set used by \s-1GCC\s0. If the 690before all directories specified by
701locale does not specify, or \s-1GCC\s0 cannot get this information from the 691.Fl I
702locale, the default is \s-1UTF\-8\s0. This can be overridden by either the locale 692and before the standard system directories.
703or this command line option. Currently the command line option takes 693.Pp
704precedence if there's a conflict. \fIcharset\fR can be any encoding 694.It Fl fdollars-in-identifiers
705supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine. 695@anchor{fdollars-in-identifiers} Accept
706.IP "\fB\-fworking\-directory\fR" 4 696.Sy $
707.IX Item "-fworking-directory" 697in identifiers.
708Enable generation of linemarkers in the preprocessor output that will 698.Pp
709let the compiler know the current working directory at the time of 699.It Fl fextended-identifiers
710preprocessing. When this option is enabled, the preprocessor will 700Accept universal character names in identifiers.
711emit, after the initial linemarker, a second linemarker with the 701This option is experimental; in a future version of GCC, it will be enabled by default for C99 and C++.
712current working directory followed by two slashes. \s-1GCC\s0 will use this 702.Pp
713directory, when it's present in the preprocessed input, as the 703.It Fl fpreprocessed
714directory emitted as the current working directory in some debugging 704Indicate to the preprocessor that the input file has already been preprocessed.
715information formats. This option is implicitly enabled if debugging 705This suppresses things like macro expansion, trigraph conversion, escaped newline splicing, and processing of most directives.
716information is enabled, but this can be inhibited with the negated 706The preprocessor still recognizes and removes comments, so that you can pass a file preprocessed with
717form \fB\-fno\-working\-directory\fR. If the \fB\-P\fR flag is 707.Fl C
718present in the command line, this option has no effect, since no 708to the compiler without problems.
719\&\f(CW\*(C`#line\*(C'\fR directives are emitted whatsoever. 709In this mode the integrated preprocessor is little more than a tokenizer for the front ends.
720.IP "\fB\-fno\-show\-column\fR" 4 710.Pp
721.IX Item "-fno-show-column" 711.Fl fpreprocessed
722Do not print column numbers in diagnostics. This may be necessary if 712is implicit if the input file has one of the extensions
723diagnostics are being scanned by a program that does not understand the 713.Sy .i ,
724column numbers, such as \fBdejagnu\fR. 714.Sy .ii
725.IP "\fB\-A\fR \fIpredicate\fR\fB=\fR\fIanswer\fR" 4 715or
726.IX Item "-A predicate=answer" 716.Sy .mi .
727Make an assertion with the predicate \fIpredicate\fR and answer 717These are the extensions that GCC uses for preprocessed files created by
728\&\fIanswer\fR. This form is preferred to the older form \fB\-A\fR 718.Fl save-temps .
729\&\fIpredicate\fR\fB(\fR\fIanswer\fR\fB)\fR, which is still supported, because 719.Pp
730it does not use shell special characters. 720.It Fl ftabstop= Ns Ar width
731.IP "\fB\-A \-\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4 721Set the distance between tab stops.
732.IX Item "-A -predicate=answer" 722This helps the preprocessor report correct column numbers in warnings or errors, even if tabs appear on the line.
733Cancel an assertion with the predicate \fIpredicate\fR and answer 723If the value is less than 1 or greater than 100, the option is ignored.
734\&\fIanswer\fR. 724The default is 8.
735.IP "\fB\-dCHARS\fR" 4 725.Pp
736.IX Item "-dCHARS" 726.It Fl fexec-charset= Ns Ar charset
737\&\fI\s-1CHARS\s0\fR is a sequence of one or more of the following characters, 727Set the execution character set, used for string and character constants.
738and must not be preceded by a space. Other characters are interpreted 728The default is UTF-8.
739by the compiler proper, or reserved for future versions of \s-1GCC\s0, and so 729.Em charset
740are silently ignored. If you specify characters whose behavior 730can be any encoding supported by the system's
741conflicts, the result is undefined. 731.Va iconv
742.RS 4 732library routine.
743.IP "\fBM\fR" 4 733.Pp
744.IX Item "M" 734.It Fl fwide-exec-charset= Ns Ar charset
745Instead of the normal output, generate a list of \fB#define\fR 735Set the wide execution character set, used for wide string and character constants.
746directives for all the macros defined during the execution of the 736The default is UTF-32 or UTF-16, whichever corresponds to the width of
747preprocessor, including predefined macros. This gives you a way of 737.Va wchar_t .
748finding out what is predefined in your version of the preprocessor. 738As with
749Assuming you have no file \fIfoo.h\fR, the command 739.Fl fexec-charset ,
750.Sp 740.Em charset
751.Vb 1 741can be any encoding supported by the system's
752\& touch foo.h; cpp -dM foo.h 742.Va iconv
753.Ve 743library routine; however, you will have problems with encodings that do not fit exactly in
754.Sp 744.Va wchar_t .
 745.Pp
 746.It Fl finput-charset= Ns Ar charset
 747Set the input character set, used for translation from the character set of the input file to the source character set used by GCC.
 748If the locale does not specify, or GCC cannot get this information from the locale, the default is UTF-8.
 749This can be overridden by either the locale or this command line option.
 750Currently the command line option takes precedence if there's a conflict.
 751.Em charset
 752can be any encoding supported by the system's
 753.Va iconv
 754library routine.
 755.Pp
 756.It Fl fworking-directory
 757Enable generation of linemarkers in the preprocessor output that will let the compiler know the current working directory at the time of preprocessing.
 758When this option is enabled, the preprocessor will emit, after the initial linemarker, a second linemarker with the current working directory followed by two slashes.
 759GCC will use this directory, when it's present in the preprocessed input, as the directory emitted as the current working directory in some debugging information formats.
 760This option is implicitly enabled if debugging information is enabled, but this can be inhibited with the negated form
 761.Fl fno-working-directory .
 762If the
 763.Fl P
 764flag is present in the command line, this option has no effect, since no
 765.Va #line
 766directives are emitted whatsoever.
 767.Pp
 768.It Fl fno-show-column
 769Do not print column numbers in diagnostics.
 770This may be necessary if diagnostics are being scanned by a program that does not understand the column numbers, such as
 771.Sy dejagnu .
 772.Pp
 773.It Fl A Ar predicate Ns = Ns Ar answer
 774Make an assertion with the predicate
 775.Em predicate
 776and answer
 777.Em answer .
 778This form is preferred to the older form
 779.Fl A Ar predicate
 780.Sy (
 781.Em answer
 782.Sy ) ,
 783which is still supported, because it does not use shell special characters.
 784.Pp
 785.It Fl A Fl Ns Ar predicate Ns = Ns Ar answer
 786Cancel an assertion with the predicate
 787.Em predicate
 788and answer
 789.Em answer .
 790.Pp
 791.It Fl dCHARS
 792.Em CHARS
 793is a sequence of one or more of the following characters, and must not be preceded by a space.
 794Other characters are interpreted by the compiler proper, or reserved for future versions of GCC, and so are silently ignored.
 795If you specify characters whose behavior conflicts, the result is undefined.
 796.Pp
 797.Bl -tag -width xx
 798.It Sy M Ns
 799Instead of the normal output, generate a list of
 800.Sy #define
 801directives for all the macros defined during the execution of the preprocessor, including predefined macros.
 802This gives you a way of finding out what is predefined in your version of the preprocessor.
 803Assuming you have no file
 804.Pa foo.h ,
 805the command
 806.Pp
 807.Bd -literal -offset indent
 808touch foo.h; cpp -dM foo.h
 809.Ed
755will show all the predefined macros. 810will show all the predefined macros.
756.IP "\fBD\fR" 4 811.Pp
757.IX Item "D" 812.It Sy D Ns
758Like \fBM\fR except in two respects: it does \fInot\fR include the 813Like
759predefined macros, and it outputs \fIboth\fR the \fB#define\fR 814.Sy M
760directives and the result of preprocessing. Both kinds of output go to 815except in two respects: it does
761the standard output file. 816.Em not
762.IP "\fBN\fR" 4 817include the predefined macros, and it outputs
763.IX Item "N" 818.Em both
764Like \fBD\fR, but emit only the macro names, not their expansions. 819the
765.IP "\fBI\fR" 4 820.Sy #define
766.IX Item "I" 821directives and the result of preprocessing.
767Output \fB#include\fR directives in addition to the result of 822Both kinds of output go to the standard output file.
768preprocessing. 823.Pp
769.RE 824.It Sy N Ns
770.RS 4 825Like
771.RE 826.Sy D ,
772.IP "\fB\-P\fR" 4 827but emit only the macro names, not their expansions.
773.IX Item "-P" 828.Pp
 829.It Sy I Ns
 830Output
 831.Sy #include
 832directives in addition to the result of preprocessing.
 833.Pp
 834.El
 835.It Fl P
774Inhibit generation of linemarkers in the output from the preprocessor. 836Inhibit generation of linemarkers in the output from the preprocessor.
775This might be useful when running the preprocessor on something that is 837This 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.
776not C code, and will be sent to a program which might be confused by the 838.Pp
777linemarkers. 839.It Fl C
778.IP "\fB\-C\fR" 4 840Do not discard comments.
779.IX Item "-C" 841All comments are passed through to the output file, except for comments in processed directives, which are deleted along with the directive.
780Do not discard comments. All comments are passed through to the output 842.Pp
781file, except for comments in processed directives, which are deleted 843You should be prepared for side effects when using
782along with the directive. 844.Fl C ;
783.Sp 845it causes the preprocessor to treat comments as tokens in their own right.
784You should be prepared for side effects when using \fB\-C\fR; it 846For example, 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
785causes the preprocessor to treat comments as tokens in their own right. 847.Sy # .
786For example, comments appearing at the start of what would be a 848.Pp
787directive line have the effect of turning that line into an ordinary 849.It Fl CC
788source line, since the first token on the line is no longer a \fB#\fR. 850Do not discard comments, including during macro expansion.
789.IP "\fB\-CC\fR" 4 851This is like
790.IX Item "-CC" 852.Fl C ,
791Do not discard comments, including during macro expansion. This is 853except that comments contained within macros are also passed through to the output file where the macro is expanded.
792like \fB\-C\fR, except that comments contained within macros are 854.Pp
793also passed through to the output file where the macro is expanded. 855In addition to the side-effects of the
794.Sp 856.Fl C
795In addition to the side-effects of the \fB\-C\fR option, the 857option, the
796\&\fB\-CC\fR option causes all \*(C+\-style comments inside a macro 858.Fl CC
797to be converted to C\-style comments. This is to prevent later use 859option causes all C++-style comments inside a macro to be converted to C-style comments.
798of that macro from inadvertently commenting out the remainder of 860This is to prevent later use of that macro from inadvertently commenting out the remainder of the source line.
799the source line. 861.Pp
800.Sp 862The
801The \fB\-CC\fR option is generally used to support lint comments. 863.Fl CC
802.IP "\fB\-traditional\-cpp\fR" 4 864option is generally used to support lint comments.
803.IX Item "-traditional-cpp" 865.Pp
804Try to imitate the behavior of old-fashioned C preprocessors, as 866.It Fl traditional-cpp
805opposed to \s-1ISO\s0 C preprocessors. 867Try to imitate the behavior of old-fashioned C preprocessors, as opposed to ISO C preprocessors.
806.IP "\fB\-trigraphs\fR" 4 868.Pp
807.IX Item "-trigraphs" 869.It Fl trigraphs
808Process trigraph sequences. 870Process trigraph sequences.
809.IP "\fB\-remap\fR" 4 871.Pp
810.IX Item "-remap" 872.It Fl remap
811Enable special code to work around file systems which only permit very 873Enable special code to work around file systems which only permit very short file names, such as MS-DOS.
812short file names, such as \s-1MS\-DOS\s0. 874.Pp
813.IP "\fB\-\-help\fR" 4 875.It Fl -help
814.IX Item "--help" 876.It Fl -target-help
815.PD 0 877Print text describing all the command line options instead of preprocessing anything.
816.IP "\fB\-\-target\-help\fR" 4 878.Pp
817.IX Item "--target-help" 879.It Fl v
818.PD 880Verbose mode.
819Print text describing all the command line options instead of 881Print out GNU CPP's version number at the beginning of execution, and report the final form of the include path.
820preprocessing anything. 882.Pp
821.IP "\fB\-v\fR" 4 883.It Fl H
822.IX Item "-v" 884Print the name of each header file used, in addition to other normal activities.
823Verbose mode. Print out \s-1GNU\s0 \s-1CPP\s0's version number at the beginning of 885Each name is indented to show how deep in the
824execution, and report the final form of the include path. 886.Sy #include
825.IP "\fB\-H\fR" 4 887stack it is.
826.IX Item "-H" 888Precompiled header files are also printed, even if they are found to be invalid; an invalid precompiled header file is printed with
827Print the name of each header file used, in addition to other normal 889.Sy ...x
828activities. Each name is indented to show how deep in the 890and a valid one with
829\&\fB#include\fR stack it is. Precompiled header files are also 891.Sy ...! .
830printed, even if they are found to be invalid; an invalid precompiled 892.Pp
831header file is printed with \fB...x\fR and a valid one with \fB...!\fR . 893.It Fl version
832.IP "\fB\-version\fR" 4 894.It Fl -version
833.IX Item "-version" 895Print out GNU CPP's version number.
834.PD 0 896With one dash, proceed to preprocess as normal.
835.IP "\fB\-\-version\fR" 4 897With two dashes, exit immediately.
836.IX Item "--version" 898.Pp
837.PD 899.El
838Print out \s-1GNU\s0 \s-1CPP\s0's version number. With one dash, proceed to 900.Sh ENVIRONMENT
839preprocess as normal. With two dashes, exit immediately. 901This section describes the environment variables that affect how CPP operates.
840.SH "ENVIRONMENT" 902You can use them to specify directories or prefixes to use when searching for include files, or to control dependency output.
841.IX Header "ENVIRONMENT" 903.Pp
842This section describes the environment variables that affect how \s-1CPP\s0 
843operates. You can use them to specify directories or prefixes to use 
844when searching for include files, or to control dependency output. 
845.PP 
846Note that you can also specify places to search using options such as 904Note that you can also specify places to search using options such as
847\&\fB\-I\fR, and control dependency output with options like 905.Fl I ,
848\&\fB\-M\fR. These take precedence over 906and control dependency output with options like
849environment variables, which in turn take precedence over the 907.Fl M .
850configuration of \s-1GCC\s0. 908These take precedence over environment variables, which in turn take precedence over the configuration of GCC.
851.IP "\fB\s-1CPATH\s0\fR" 4 909.Pp
852.IX Item "CPATH" 910.Bl -tag -width xx -compact
853.PD 0 911.It Sy CPATH Ns
854.IP "\fBC_INCLUDE_PATH\fR" 4 912.It Sy C_INCLUDE_PATH Ns
855.IX Item "C_INCLUDE_PATH" 913.It Sy CPLUS_INCLUDE_PATH Ns
856.IP "\fB\s-1CPLUS_INCLUDE_PATH\s0\fR" 4 914.It Sy OBJC_INCLUDE_PATH Ns
857.IX Item "CPLUS_INCLUDE_PATH" 915Each variable's value is a list of directories separated by a special character, much like
858.IP "\fB\s-1OBJC_INCLUDE_PATH\s0\fR" 4 916.Sy PATH ,
859.IX Item "OBJC_INCLUDE_PATH" 917in which to look for header files.
860.PD 918The special character,
861Each variable's value is a list of directories separated by a special 919.Va PATH_SEPARATOR ,
862character, much like \fB\s-1PATH\s0\fR, in which to look for header files. 920is target-dependent and determined at GCC build time.
863The special character, \f(CW\*(C`PATH_SEPARATOR\*(C'\fR, is target-dependent and 921For Microsoft Windows-based targets it is a semicolon, and for almost all other targets it is a colon.
864determined at \s-1GCC\s0 build time. For Microsoft Windows-based targets it is a 922.Pp
865semicolon, and for almost all other targets it is a colon. 923.Sy CPATH
866.Sp 924specifies a list of directories to be searched as if specified with
867\&\fB\s-1CPATH\s0\fR specifies a list of directories to be searched as if 925.Fl I ,
868specified with \fB\-I\fR, but after any paths given with \fB\-I\fR 926but after any paths given with
869options on the command line. This environment variable is used 927.Fl I
870regardless of which language is being preprocessed. 928options on the command line.
871.Sp 929This environment variable is used regardless of which language is being preprocessed.
872The remaining environment variables apply only when preprocessing the 930.Pp
873particular language indicated. Each specifies a list of directories 931The remaining environment variables apply only when preprocessing the particular language indicated.
874to be searched as if specified with \fB\-isystem\fR, but after any 932Each specifies a list of directories to be searched as if specified with
875paths given with \fB\-isystem\fR options on the command line. 933.Fl isystem ,
876.Sp 934but after any paths given with
877In all these variables, an empty element instructs the compiler to 935.Fl isystem
878search its current working directory. Empty elements can appear at the 936options on the command line.
879beginning or end of a path. For instance, if the value of 937.Pp
880\&\fB\s-1CPATH\s0\fR is \f(CW\*(C`:/special/include\*(C'\fR, that has the same 938In all these variables, an empty element instructs the compiler to search its current working directory.
881effect as \fB\-I.\ \-I/special/include\fR. 939Empty elements can appear at the beginning or end of a path.
882.IP "\fB\s-1DEPENDENCIES_OUTPUT\s0\fR" 4 940For instance, if the value of
883.IX Item "DEPENDENCIES_OUTPUT" 941.Sy CPATH
884If this variable is set, its value specifies how to output 942is
885dependencies for Make based on the non-system header files processed 943.Va :/special/include ,
886by the compiler. System header files are ignored in the dependency 944that has the same effect as
887output. 945.Sy -I. -I/special/include .
888.Sp 946.Pp
889The value of \fB\s-1DEPENDENCIES_OUTPUT\s0\fR can be just a file name, in 947.It Sy DEPENDENCIES_OUTPUT Ns
890which case the Make rules are written to that file, guessing the target 948If this variable is set, its value specifies how to output dependencies for Make based on the non-system header files processed by the compiler.
891name from the source file name. Or the value can have the form 949System header files are ignored in the dependency output.
892\&\fIfile\fR\fB \fR\fItarget\fR, in which case the rules are written to 950.Pp
893file \fIfile\fR using \fItarget\fR as the target name. 951The value of
894.Sp 952.Sy DEPENDENCIES_OUTPUT
895In other words, this environment variable is equivalent to combining 953can be just a file name, in which case the Make rules are written to that file, guessing the target name from the source file name.
896the options \fB\-MM\fR and \fB\-MF\fR, 954Or the value can have the form
897with an optional \fB\-MT\fR switch too. 955.Em file
898.IP "\fB\s-1SUNPRO_DEPENDENCIES\s0\fR" 4 956\~
899.IX Item "SUNPRO_DEPENDENCIES" 957.Em target ,
900This variable is the same as \fB\s-1DEPENDENCIES_OUTPUT\s0\fR (see above), 958in which case the rules are written to file
901except that system header files are not ignored, so it implies 959.Em file
902\&\fB\-M\fR rather than \fB\-MM\fR. However, the dependence on the 960using
903main input file is omitted. 961.Em target
904.SH "SEE ALSO" 962as the target name.
905.IX Header "SEE ALSO" 963.Pp
906\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7), 964In other words, this environment variable is equivalent to combining the options
907\&\fIgcc\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIcpp\fR, \fIgcc\fR, and 965.Fl MM
908\&\fIbinutils\fR. 966and
909.SH "COPYRIGHT" 967.Fl MF ,
910.IX Header "COPYRIGHT" 968with an optional
911Copyright (c) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 969.Fl MT
9121997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 970switch too.
913Free Software Foundation, Inc. 971.Pp
914.PP 972.It Sy SUNPRO_DEPENDENCIES Ns
915Permission is granted to copy, distribute and/or modify this document 973This variable is the same as
916under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or 974.Sy DEPENDENCIES_OUTPUT
917any later version published by the Free Software Foundation. A copy of 975(see above), except that system header files are not ignored, so it implies
918the license is included in the 976.Fl M
919man page \fIgfdl\fR\|(7). 977rather than
920This manual contains no Invariant Sections. The Front-Cover Texts are 978.Fl MM .
921(a) (see below), and the Back-Cover Texts are (b) (see below). 979However, the dependence on the main input file is omitted.
922.PP 980.Pp
923(a) The \s-1FSF\s0's Front-Cover Text is: 981.It Sy CPP_RESTRICTED Ns
924.PP 982If this variable is defined, cpp will skip any include file which is not a regular file, and will continue searching for the requested name (this is always done if the found file is a directory).
925.Vb 1 983.Pp
926\& A GNU Manual 984.El
927.Ve 985.Sh SEE ALSO
928.PP 986gpl(7), gfdl(7), fsf-funding(7), gcc(1), as(1), ld(1), and the Info entries for
929(b) The \s-1FSF\s0's Back-Cover Text is: 987.Pa cpp ,
930.PP 988.Pa gcc ,
931.Vb 3 989and
932\& You have freedom to copy and modify this GNU Manual, like GNU 990.Pa binutils .
933\& software. Copies published by the Free Software Foundation raise 991.Sh COPYRIGHT
934\& funds for GNU development. 992Copyright (c) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
935.Ve 993.Pp
 994Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation.
 995A copy of the license is included in the man page gfdl(7).
 996This manual contains no Invariant Sections.
 997The Front-Cover Texts are (a) (see below), and the Back-Cover Texts are (b) (see below).
 998.Pp
 999(a) The FSF's Front-Cover Text is:
 1000.Pp
 1001 A GNU Manual
 1002.Pp
 1003(b) The FSF's Back-Cover Text is:
 1004.Pp
 1005You have freedom to copy and modify this GNU Manual, like GNU software.
 1006Copies published by the Free Software Foundation raise funds for GNU development.