cppopts.texi revision 103445
196263Sobrien@c Copyright (c) 1999, 2000, 2001, 2002
296263Sobrien@c Free Software Foundation, Inc.
396263Sobrien@c This is part of the CPP and GCC manuals.
496263Sobrien@c For copying conditions, see the file gcc.texi.
596263Sobrien
696263Sobrien@c ---------------------------------------------------------------------
796263Sobrien@c Options affecting the preprocessor
896263Sobrien@c ---------------------------------------------------------------------
996263Sobrien
1096263Sobrien@c If this file is included with the flag ``cppmanual'' set, it is
1196263Sobrien@c formatted for inclusion in the CPP manual; otherwise the main GCC manual.
1296263Sobrien
1396263Sobrien@table @gcctabopt
1496263Sobrien@item -D @var{name}
1596263Sobrien@opindex D
1696263SobrienPredefine @var{name} as a macro, with definition @code{1}.
1796263Sobrien
1896263Sobrien@item -D @var{name}=@var{definition}
1996263SobrienPredefine @var{name} as a macro, with definition @var{definition}.
2096263SobrienThere are no restrictions on the contents of @var{definition}, but if
2196263Sobrienyou are invoking the preprocessor from a shell or shell-like program you
2296263Sobrienmay need to use the shell's quoting syntax to protect characters such as
2396263Sobrienspaces that have a meaning in the shell syntax.
2496263Sobrien
2596263SobrienIf you wish to define a function-like macro on the command line, write
2696263Sobrienits argument list with surrounding parentheses before the equals sign
2796263Sobrien(if any).  Parentheses are meaningful to most shells, so you will need
2896263Sobriento quote the option.  With @command{sh} and @command{csh},
2996263Sobrien@option{-D'@var{name}(@var{args@dots{}})=@var{definition}'} works.
3096263Sobrien
3196263Sobrien@option{-D} and @option{-U} options are processed in the order they
3296263Sobrienare given on the command line.  All @option{-imacros @var{file}} and
3396263Sobrien@option{-include @var{file}} options are processed after all
3496263Sobrien@option{-D} and @option{-U} options.
3596263Sobrien
3696263Sobrien@item -U @var{name}
3796263Sobrien@opindex U
3896263SobrienCancel any previous definition of @var{name}, either built in or
3996263Sobrienprovided with a @option{-D} option.
4096263Sobrien
4196263Sobrien@item -undef
4296263Sobrien@opindex undef
4396263SobrienDo not predefine any system-specific macros.  The common predefined
4496263Sobrienmacros remain defined.
4596263Sobrien
4696263Sobrien@item -I @var{dir}
4796263Sobrien@opindex I
4896263SobrienAdd the directory @var{dir} to the list of directories to be searched
4996263Sobrienfor header files.
5096263Sobrien@ifset cppmanual
5196263Sobrien@xref{Search Path}.
5296263Sobrien@end ifset
5396263SobrienDirectories named by @option{-I} are searched before the standard
5496263Sobriensystem include directories.
5596263Sobrien
5696263SobrienIt is dangerous to specify a standard system include directory in an
5796263Sobrien@option{-I} option.  This defeats the special treatment of system
5896263Sobrienheaders
5996263Sobrien@ifset cppmanual
6096263Sobrien(@pxref{System Headers})
6196263Sobrien@end ifset
6296263Sobrien.  It can also defeat the repairs to buggy system headers which GCC
6396263Sobrienmakes when it is installed.
6496263Sobrien
6596263Sobrien@item -o @var{file}
6696263Sobrien@opindex o
6796263SobrienWrite output to @var{file}.  This is the same as specifying @var{file}
6896263Sobrienas the second non-option argument to @command{cpp}.  @command{gcc} has a
6996263Sobriendifferent interpretation of a second non-option argument, so you must
7096263Sobrienuse @option{-o} to specify the output file.
7196263Sobrien
7296263Sobrien@item -Wall
7396263Sobrien@opindex Wall
7496263SobrienTurns on all optional warnings which are desirable for normal code.  At
7596263Sobrienpresent this is @option{-Wcomment} and @option{-Wtrigraphs}.  Note that
7696263Sobrienmany of the preprocessor's warnings are on by default and have no
7796263Sobrienoptions to control them.
7896263Sobrien
7996263Sobrien@item -Wcomment
8096263Sobrien@itemx -Wcomments
8196263Sobrien@opindex Wcomment
8296263Sobrien@opindex Wcomments
8396263SobrienWarn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
8496263Sobriencomment, or whenever a backslash-newline appears in a @samp{//} comment.
8596263Sobrien(Both forms have the same effect.)
8696263Sobrien
8796263Sobrien@item -Wtrigraphs
8896263Sobrien@opindex Wtrigraphs
8996263SobrienWarn if any trigraphs are encountered.  This option used to take effect
9096263Sobrienonly if @option{-trigraphs} was also specified, but now works
9196263Sobrienindependently.  Warnings are not given for trigraphs within comments, as
9296263Sobrienthey do not affect the meaning of the program.
9396263Sobrien
9496263Sobrien@item -Wtraditional
9596263Sobrien@opindex Wtraditional
9696263SobrienWarn about certain constructs that behave differently in traditional and
9796263SobrienISO C@.  Also warn about ISO C constructs that have no traditional C
9896263Sobrienequivalent, and problematic constructs which should be avoided.
9996263Sobrien@ifset cppmanual
10096263Sobrien@xref{Traditional Mode}.
10196263Sobrien@end ifset
10296263Sobrien
10396263Sobrien@item -Wimport
10496263Sobrien@opindex Wimport
10596263SobrienWarn the first time @samp{#import} is used.
10696263Sobrien
10796263Sobrien@item -Wundef
10896263Sobrien@opindex Wundef
10996263SobrienWarn whenever an identifier which is not a macro is encountered in an
11096263Sobrien@samp{#if} directive, outside of @samp{defined}.  Such identifiers are
11196263Sobrienreplaced with zero.
11296263Sobrien
11396263Sobrien@item -Werror
11496263Sobrien@opindex Werror
11596263SobrienMake all warnings into hard errors.  Source code which triggers warnings
11696263Sobrienwill be rejected.
11796263Sobrien
11896263Sobrien@item -Wsystem-headers
11996263Sobrien@opindex Wsystem-headers
12096263SobrienIssue warnings for code in system headers.  These are normally unhelpful
12196263Sobrienin finding bugs in your own code, therefore suppressed.  If you are
12296263Sobrienresponsible for the system library, you may want to see them.
12396263Sobrien
12496263Sobrien@item -w
12596263Sobrien@opindex w
12696263SobrienSuppress all warnings, including those which GNU CPP issues by default.
12796263Sobrien
12896263Sobrien@item -pedantic
12996263Sobrien@opindex pedantic
13096263SobrienIssue all the mandatory diagnostics listed in the C standard.  Some of
13196263Sobrienthem are left out by default, since they trigger frequently on harmless
13296263Sobriencode.
13396263Sobrien
13496263Sobrien@item -pedantic-errors
13596263Sobrien@opindex pedantic-errors
13696263SobrienIssue all the mandatory diagnostics, and make all mandatory diagnostics
13796263Sobrieninto errors.  This includes mandatory diagnostics that GCC issues
13896263Sobrienwithout @samp{-pedantic} but treats as warnings.
13996263Sobrien
14096263Sobrien@item -M
14196263Sobrien@opindex M
14296263Sobrien@cindex make
14396263Sobrien@cindex dependencies, make
14496263SobrienInstead of outputting the result of preprocessing, output a rule
14596263Sobriensuitable for @command{make} describing the dependencies of the main
14696263Sobriensource file.  The preprocessor outputs one @command{make} rule containing
14796263Sobrienthe object file name for that source file, a colon, and the names of all
14896263Sobrienthe included files, including those coming from @option{-include} or
14996263Sobrien@option{-imacros} command line options.
15096263Sobrien
15196263SobrienUnless specified explicitly (with @option{-MT} or @option{-MQ}), the
15296263Sobrienobject file name consists of the basename of the source file with any
15396263Sobriensuffix replaced with object file suffix.  If there are many included
15496263Sobrienfiles then the rule is split into several lines using @samp{\}-newline.
15596263SobrienThe rule has no commands.
15696263Sobrien
15796263SobrienThis option does not suppress the preprocessor's debug output, such as
15896263Sobrien@option{-dM}.  To avoid mixing such debug output with the dependency
15996263Sobrienrules you should explicitly specify the dependency output file with
16096263Sobrien@option{-MF}, or use an environment variable like
16196263Sobrien@env{DEPENDENCIES_OUTPUT} (@pxref{DEPENDENCIES_OUTPUT}).  Debug output
16296263Sobrienwill still be sent to the regular output stream as normal.
16396263Sobrien
16496263SobrienPassing @option{-M} to the driver implies @option{-E}.
16596263Sobrien
16696263Sobrien@item -MM
16796263Sobrien@opindex MM
16896263SobrienLike @option{-M} but do not mention header files that are found in
16996263Sobriensystem header directories, nor header files that are included,
17096263Sobriendirectly or indirectly, from such a header.
17196263Sobrien
17296263SobrienThis implies that the choice of angle brackets or double quotes in an
17396263Sobrien@samp{#include} directive does not in itself determine whether that
17496263Sobrienheader will appear in @option{-MM} dependency output.  This is a
17596263Sobrienslight change in semantics from GCC versions 3.0 and earlier.
17696263Sobrien
17796263Sobrien@item -MF @var{file}
17896263Sobrien@opindex MF
17996263Sobrien@anchor{-MF}
18096263SobrienWhen used with @option{-M} or @option{-MM}, specifies a
18196263Sobrienfile to write the dependencies to.  If no @option{-MF} switch is given
18296263Sobrienthe preprocessor sends the rules to the same place it would have sent
18396263Sobrienpreprocessed output.
18496263Sobrien
18596263SobrienWhen used with the driver options @option{-MD} or @option{-MMD},
18696263Sobrien@option{-MF} overrides the default dependency output file.
18796263Sobrien
18896263Sobrien@item -MG
18996263Sobrien@opindex MG
19096263SobrienWhen used with @option{-M} or @option{-MM}, @option{-MG} says to treat missing
19196263Sobrienheader files as generated files and assume they live in the same
19296263Sobriendirectory as the source file.  It suppresses preprocessed output, as a
19396263Sobrienmissing header file is ordinarily an error.
19496263Sobrien
19596263SobrienThis feature is used in automatic updating of makefiles.
19696263Sobrien
19796263Sobrien@item -MP
19896263Sobrien@opindex MP
19996263SobrienThis option instructs CPP to add a phony target for each dependency
20096263Sobrienother than the main file, causing each to depend on nothing.  These
20196263Sobriendummy rules work around errors @command{make} gives if you remove header
20296263Sobrienfiles without updating the @file{Makefile} to match.
20396263Sobrien
20496263SobrienThis is typical output:
20596263Sobrien
20696263Sobrien@example
20796263Sobrientest.o: test.c test.h
20896263Sobrien
20996263Sobrientest.h:
21096263Sobrien@end example
21196263Sobrien
21296263Sobrien@item -MT @var{target}
21396263Sobrien@opindex MT
21496263Sobrien
21596263SobrienChange the target of the rule emitted by dependency generation.  By
21696263Sobriendefault CPP takes the name of the main input file, including any path,
21796263Sobriendeletes any file suffix such as @samp{.c}, and appends the platform's
21896263Sobrienusual object suffix.  The result is the target.
21996263Sobrien
22096263SobrienAn @option{-MT} option will set the target to be exactly the string you
22196263Sobrienspecify.  If you want multiple targets, you can specify them as a single
22296263Sobrienargument to @option{-MT}, or use multiple @option{-MT} options.
22396263Sobrien
22496263SobrienFor example, @option{@w{-MT '$(objpfx)foo.o'}} might give
22596263Sobrien
22696263Sobrien@example
22796263Sobrien$(objpfx)foo.o: foo.c
22896263Sobrien@end example
22996263Sobrien
23096263Sobrien@item -MQ @var{target}
23196263Sobrien@opindex MQ
23296263Sobrien
23396263SobrienSame as @option{-MT}, but it quotes any characters which are special to
23496263SobrienMake.  @option{@w{-MQ '$(objpfx)foo.o'}} gives
23596263Sobrien
23696263Sobrien@example
23796263Sobrien$$(objpfx)foo.o: foo.c
23896263Sobrien@end example
23996263Sobrien
24096263SobrienThe default target is automatically quoted, as if it were given with
24196263Sobrien@option{-MQ}.
24296263Sobrien
24396263Sobrien@item -MD
24496263Sobrien@opindex MD
24596263Sobrien@option{-MD} is equivalent to @option{-M -MF @var{file}}, except that
24696263Sobrien@option{-E} is not implied.  The driver determines @var{file} based on
24796263Sobrienwhether an @option{-o} option is given.  If it is, the driver uses its
24896263Sobrienargument but with a suffix of @file{.d}, otherwise it take the
24996263Sobrienbasename of the input file and applies a @file{.d} suffix.
25096263Sobrien
25196263SobrienIf @option{-MD} is used in conjunction with @option{-E}, any
25296263Sobrien@option{-o} switch is understood to specify the dependency output file
25396263Sobrien(but @pxref{-MF}), but if used without @option{-E}, each @option{-o}
25496263Sobrienis understood to specify a target object file.
25596263Sobrien
25696263SobrienSince @option{-E} is not implied, @option{-MD} can be used to generate
25796263Sobriena dependency output file as a side-effect of the compilation process.
25896263Sobrien
25996263Sobrien@item -MMD
26096263Sobrien@opindex MMD
26196263SobrienLike @option{-MD} except mention only user header files, not system
26296263Sobrien-header files.
26396263Sobrien
26496263Sobrien@item -x c
26596263Sobrien@itemx -x c++
26696263Sobrien@itemx -x objective-c
26796263Sobrien@itemx -x assembler-with-cpp
26896263Sobrien@opindex x
26996263SobrienSpecify the source language: C, C++, Objective-C, or assembly.  This has
27096263Sobriennothing to do with standards conformance or extensions; it merely
27196263Sobrienselects which base syntax to expect.  If you give none of these options,
27296263Sobriencpp will deduce the language from the extension of the source file:
27396263Sobrien@samp{.c}, @samp{.cc}, @samp{.m}, or @samp{.S}.  Some other common
27496263Sobrienextensions for C++ and assembly are also recognized.  If cpp does not
27596263Sobrienrecognize the extension, it will treat the file as C; this is the most
27696263Sobriengeneric mode.
27796263Sobrien
27896263Sobrien@strong{Note:} Previous versions of cpp accepted a @option{-lang} option
27996263Sobrienwhich selected both the language and the standards conformance level.
28096263SobrienThis option has been removed, because it conflicts with the @option{-l}
28196263Sobrienoption.
28296263Sobrien
28396263Sobrien@item -std=@var{standard}
28496263Sobrien@itemx -ansi
28596263Sobrien@opindex ansi
28696263Sobrien@opindex std=
28796263SobrienSpecify the standard to which the code should conform.  Currently cpp
28896263Sobrienonly knows about the standards for C; other language standards will be
28996263Sobrienadded in the future.
29096263Sobrien
29196263Sobrien@var{standard}
29296263Sobrienmay be one of:
29396263Sobrien@table @code
29496263Sobrien@item iso9899:1990
29596263Sobrien@itemx c89
29696263SobrienThe ISO C standard from 1990.  @samp{c89} is the customary shorthand for
29796263Sobrienthis version of the standard.
29896263Sobrien
29996263SobrienThe @option{-ansi} option is equivalent to @option{-std=c89}.
30096263Sobrien
30196263Sobrien@item iso9899:199409
30296263SobrienThe 1990 C standard, as amended in 1994.
30396263Sobrien
30496263Sobrien@item iso9899:1999
30596263Sobrien@itemx c99
30696263Sobrien@itemx iso9899:199x
30796263Sobrien@itemx c9x
30896263SobrienThe revised ISO C standard, published in December 1999.  Before
30996263Sobrienpublication, this was known as C9X@.
31096263Sobrien
31196263Sobrien@item gnu89
31296263SobrienThe 1990 C standard plus GNU extensions.  This is the default.
31396263Sobrien
31496263Sobrien@item gnu99
31596263Sobrien@itemx gnu9x
31696263SobrienThe 1999 C standard plus GNU extensions.
31796263Sobrien@end table
31896263Sobrien
31996263Sobrien@item -I-
32096263Sobrien@opindex I-
32196263SobrienSplit the include path.  Any directories specified with @option{-I}
32296263Sobrienoptions before @option{-I-} are searched only for headers requested with
32396263Sobrien@code{@w{#include "@var{file}"}}; they are not searched for
32496263Sobrien@code{@w{#include <@var{file}>}}.  If additional directories are
32596263Sobrienspecified with @option{-I} options after the @option{-I-}, those
32696263Sobriendirectories are searched for all @samp{#include} directives.
32796263Sobrien
32896263SobrienIn addition, @option{-I-} inhibits the use of the directory of the current
32996263Sobrienfile directory as the first search directory for @code{@w{#include
33096263Sobrien"@var{file}"}}.
33196263Sobrien@ifset cppmanual
33296263Sobrien@xref{Search Path}.
33396263Sobrien@end ifset
33496263Sobrien
33596263Sobrien@item -nostdinc
33696263Sobrien@opindex nostdinc
33796263SobrienDo not search the standard system directories for header files.
33896263SobrienOnly the directories you have specified with @option{-I} options
33996263Sobrien(and the directory of the current file, if appropriate) are searched.
34096263Sobrien
34196263Sobrien@item -nostdinc++
34296263Sobrien@opindex nostdinc++
34396263SobrienDo not search for header files in the C++-specific standard directories,
34496263Sobrienbut do still search the other standard directories.  (This option is
34596263Sobrienused when building the C++ library.)
34696263Sobrien
34796263Sobrien@item -include @var{file}
34896263Sobrien@opindex include
34996263SobrienProcess @var{file} as if @code{#include "file"} appeared as the first
35096263Sobrienline of the primary source file.  However, the first directory searched
35196263Sobrienfor @var{file} is the preprocessor's working directory @emph{instead of}
35296263Sobrienthe directory containing the main source file.  If not found there, it
35396263Sobrienis searched for in the remainder of the @code{#include "@dots{}"} search
35496263Sobrienchain as normal.
35596263Sobrien
35696263SobrienIf multiple @option{-include} options are given, the files are included
35796263Sobrienin the order they appear on the command line.
35896263Sobrien
35996263Sobrien@item -imacros @var{file}
36096263Sobrien@opindex imacros
36196263SobrienExactly like @option{-include}, except that any output produced by
36296263Sobrienscanning @var{file} is thrown away.  Macros it defines remain defined.
36396263SobrienThis allows you to acquire all the macros from a header without also
36496263Sobrienprocessing its declarations.
36596263Sobrien
36696263SobrienAll files specified by @option{-imacros} are processed before all files
36796263Sobrienspecified by @option{-include}.
36896263Sobrien
36996263Sobrien@item -idirafter @var{dir}
37096263Sobrien@opindex idirafter
37196263SobrienSearch @var{dir} for header files, but do it @emph{after} all
37296263Sobriendirectories specified with @option{-I} and the standard system directories
37396263Sobrienhave been exhausted.  @var{dir} is treated as a system include directory.
37496263Sobrien
37596263Sobrien@item -iprefix @var{prefix}
37696263Sobrien@opindex iprefix
37796263SobrienSpecify @var{prefix} as the prefix for subsequent @option{-iwithprefix}
37896263Sobrienoptions.  If the prefix represents a directory, you should include the
37996263Sobrienfinal @samp{/}.
38096263Sobrien
38196263Sobrien@item -iwithprefix @var{dir}
38296263Sobrien@itemx -iwithprefixbefore @var{dir}
38396263Sobrien@opindex iwithprefix
38496263Sobrien@opindex iwithprefixbefore
38596263SobrienAppend @var{dir} to the prefix specified previously with
38696263Sobrien@option{-iprefix}, and add the resulting directory to the include search
38796263Sobrienpath.  @option{-iwithprefixbefore} puts it in the same place @option{-I}
38896263Sobrienwould; @option{-iwithprefix} puts it where @option{-idirafter} would.
38996263Sobrien
39096263SobrienUse of these options is discouraged.
39196263Sobrien
39296263Sobrien@item -isystem @var{dir}
39396263Sobrien@opindex isystem
39496263SobrienSearch @var{dir} for header files, after all directories specified by
39596263Sobrien@option{-I} but before the standard system directories.  Mark it
39696263Sobrienas a system directory, so that it gets the same special treatment as
39796263Sobrienis applied to the standard system directories.
39896263Sobrien@ifset cppmanual
39996263Sobrien@xref{System Headers}.
40096263Sobrien@end ifset
40196263Sobrien
40296263Sobrien@item -fpreprocessed
40396263Sobrien@opindex fpreprocessed
40496263SobrienIndicate to the preprocessor that the input file has already been
40596263Sobrienpreprocessed.  This suppresses things like macro expansion, trigraph
40696263Sobrienconversion, escaped newline splicing, and processing of most directives.
40796263SobrienThe preprocessor still recognizes and removes comments, so that you can
40896263Sobrienpass a file preprocessed with @option{-C} to the compiler without
40996263Sobrienproblems.  In this mode the integrated preprocessor is little more than
41096263Sobriena tokenizer for the front ends.
41196263Sobrien
41296263Sobrien@option{-fpreprocessed} is implicit if the input file has one of the
41396263Sobrienextensions @samp{.i}, @samp{.ii} or @samp{.mi}.  These are the
41496263Sobrienextensions that GCC uses for preprocessed files created by
41596263Sobrien@option{-save-temps}.
41696263Sobrien
41796263Sobrien@item -ftabstop=@var{width}
41896263Sobrien@opindex ftabstop
41996263SobrienSet the distance between tab stops.  This helps the preprocessor report
42096263Sobriencorrect column numbers in warnings or errors, even if tabs appear on the
42196263Sobrienline.  If the value is less than 1 or greater than 100, the option is
42296263Sobrienignored.  The default is 8.
42396263Sobrien
42496263Sobrien@item -fno-show-column
42596263Sobrien@opindex fno-show-column
42696263SobrienDo not print column numbers in diagnostics.  This may be necessary if
42796263Sobriendiagnostics are being scanned by a program that does not understand the
42896263Sobriencolumn numbers, such as @command{dejagnu}.
42996263Sobrien
43096263Sobrien@item -A @var{predicate}=@var{answer}
43196263Sobrien@opindex A
43296263SobrienMake an assertion with the predicate @var{predicate} and answer
43396263Sobrien@var{answer}.  This form is preferred to the older form @option{-A
43496263Sobrien@var{predicate}(@var{answer})}, which is still supported, because
43596263Sobrienit does not use shell special characters.
43696263Sobrien@ifset cppmanual
43796263Sobrien@xref{Assertions}.
43896263Sobrien@end ifset
43996263Sobrien
44096263Sobrien@item -A -@var{predicate}=@var{answer}
44196263SobrienCancel an assertion with the predicate @var{predicate} and answer
44296263Sobrien@var{answer}.
44396263Sobrien
44496263Sobrien@item -A-
44596263Sobrien@opindex A-
44696263SobrienCancel all predefined assertions and all assertions preceding it on
44796263Sobrienthe command line.  Also, undefine all predefined macros and all
44896263Sobrienmacros preceding it on the command line.  (This is a historical wart and
44996263Sobrienmay change in the future.)
45096263Sobrien
45196263Sobrien@item -dCHARS
45296263Sobrien@var{CHARS} is a sequence of one or more of the following characters,
45396263Sobrienand must not be preceded by a space.  Other characters are interpreted
45496263Sobrienby the compiler proper, or reserved for future versions of GCC, and so
45596263Sobrienare silently ignored.  If you specify characters whose behavior
45696263Sobrienconflicts, the result is undefined.
45796263Sobrien
45896263Sobrien@table @samp
45996263Sobrien@item M
46096263Sobrien@opindex dM
46196263SobrienInstead of the normal output, generate a list of @samp{#define}
46296263Sobriendirectives for all the macros defined during the execution of the
46396263Sobrienpreprocessor, including predefined macros.  This gives you a way of
46496263Sobrienfinding out what is predefined in your version of the preprocessor.
46596263SobrienAssuming you have no file @file{foo.h}, the command
46696263Sobrien
46796263Sobrien@example
46896263Sobrientouch foo.h; cpp -dM foo.h
46996263Sobrien@end example
47096263Sobrien
47196263Sobrien@noindent
47296263Sobrienwill show all the predefined macros.
47396263Sobrien
47496263Sobrien@item D
47596263Sobrien@opindex dD
47696263SobrienLike @samp{M} except in two respects: it does @emph{not} include the
47796263Sobrienpredefined macros, and it outputs @emph{both} the @samp{#define}
47896263Sobriendirectives and the result of preprocessing.  Both kinds of output go to
47996263Sobrienthe standard output file.
48096263Sobrien
48196263Sobrien@item N
48296263Sobrien@opindex dN
48396263SobrienLike @samp{D}, but emit only the macro names, not their expansions.
48496263Sobrien
48596263Sobrien@item I
48696263Sobrien@opindex dI
48796263SobrienOutput @samp{#include} directives in addition to the result of
48896263Sobrienpreprocessing.
48996263Sobrien@end table
49096263Sobrien
49196263Sobrien@item -P
49296263Sobrien@opindex P
49396263SobrienInhibit generation of linemarkers in the output from the preprocessor.
49496263SobrienThis might be useful when running the preprocessor on something that is
49596263Sobriennot C code, and will be sent to a program which might be confused by the
49696263Sobrienlinemarkers.
49796263Sobrien@ifset cppmanual
49896263Sobrien@xref{Preprocessor Output}.
49996263Sobrien@end ifset
50096263Sobrien
50196263Sobrien@item -C
50296263Sobrien@opindex C
50396263SobrienDo not discard comments.  All comments are passed through to the output
50496263Sobrienfile, except for comments in processed directives, which are deleted
50596263Sobrienalong with the directive.
50696263Sobrien
50796263SobrienYou should be prepared for side effects when using @option{-C}; it
50896263Sobriencauses the preprocessor to treat comments as tokens in their own right.
50996263SobrienFor example, comments appearing at the start of what would be a
51096263Sobriendirective line have the effect of turning that line into an ordinary
51196263Sobriensource line, since the first token on the line is no longer a @samp{#}.
51296263Sobrien
51396263Sobrien@item -gcc
51496263Sobrien@opindex gcc
51596263SobrienDefine the macros @sc{__gnuc__}, @sc{__gnuc_minor__} and
51696263Sobrien@sc{__gnuc_patchlevel__}.  These are defined automatically when you use
51796263Sobrien@command{gcc -E}; you can turn them off in that case with
51896263Sobrien@option{-no-gcc}.
51996263Sobrien
52096263Sobrien@item -traditional
52196263Sobrien@opindex traditional
52296263SobrienTry to imitate the behavior of old-fashioned C, as opposed to ISO
52396263SobrienC@.
52496263Sobrien@ifset cppmanual
52596263Sobrien@xref{Traditional Mode}.
52696263Sobrien@end ifset
52796263Sobrien
52896263Sobrien@item -trigraphs
52996263Sobrien@opindex trigraphs
53096263SobrienProcess trigraph sequences.
53196263Sobrien@ifset cppmanual
53296263Sobrien@xref{Initial processing}.
53396263Sobrien@end ifset
53496263Sobrien@ifclear cppmanual
53596263SobrienThese are three-character sequences, all starting with @samp{??}, that
53696263Sobrienare defined by ISO C to stand for single characters.  For example,
53796263Sobrien@samp{??/} stands for @samp{\}, so @samp{'??/n'} is a character
53896263Sobrienconstant for a newline.  By default, GCC ignores trigraphs, but in
53996263Sobrienstandard-conforming modes it converts them.  See the @option{-std} and
54096263Sobrien@option{-ansi} options.
54196263Sobrien
54296263SobrienThe nine trigraphs and their replacements are
54396263Sobrien
544103445Skan@smallexample
54596263SobrienTrigraph:       ??(  ??)  ??<  ??>  ??=  ??/  ??'  ??!  ??-
54696263SobrienReplacement:      [    ]    @{    @}    #    \    ^    |    ~
547103445Skan@end smallexample
54896263Sobrien@end ifclear
54996263Sobrien
55096263Sobrien@item -remap
55196263Sobrien@opindex remap
55296263SobrienEnable special code to work around file systems which only permit very
55396263Sobrienshort file names, such as MS-DOS@.
55496263Sobrien
55596263Sobrien@item -$
55696263Sobrien@opindex $
55796263SobrienForbid the use of @samp{$} in identifiers.  The C standard allows
55896263Sobrienimplementations to define extra characters that can appear in
55996263Sobrienidentifiers.  By default GNU CPP permits @samp{$}, a common extension.
56096263Sobrien
56196263Sobrien@item -h
56296263Sobrien@itemx --help
56396263Sobrien@itemx --target-help
56496263Sobrien@opindex h
56596263Sobrien@opindex help
56696263Sobrien@opindex target-help
56796263SobrienPrint text describing all the command line options instead of
56896263Sobrienpreprocessing anything.
56996263Sobrien
57096263Sobrien@item -v
57196263Sobrien@opindex v
57296263SobrienVerbose mode.  Print out GNU CPP's version number at the beginning of
57396263Sobrienexecution, and report the final form of the include path.
57496263Sobrien
57596263Sobrien@item -H
57696263Sobrien@opindex H
57796263SobrienPrint the name of each header file used, in addition to other normal
57896263Sobrienactivities.  Each name is indented to show how deep in the
57996263Sobrien@samp{#include} stack it is.
58096263Sobrien
58196263Sobrien@item -version
58296263Sobrien@itemx --version
58396263Sobrien@opindex version
58496263SobrienPrint out GNU CPP's version number.  With one dash, proceed to
58596263Sobrienpreprocess as normal.  With two dashes, exit immediately.
58696263Sobrien@end table
587