xref: /dflybsd-src/contrib/gcc-4.7/gcc/doc/cppopts.texi (revision 81fc95a5293ee307c688a350a3feb4734aaddbb4)
1e4b17023SJohn Marino@c Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
2e4b17023SJohn Marino@c 2010, Free Software Foundation, Inc.
3e4b17023SJohn Marino@c This is part of the CPP and GCC manuals.
4e4b17023SJohn Marino@c For copying conditions, see the file gcc.texi.
5e4b17023SJohn Marino
6e4b17023SJohn Marino@c ---------------------------------------------------------------------
7e4b17023SJohn Marino@c Options affecting the preprocessor
8e4b17023SJohn Marino@c ---------------------------------------------------------------------
9e4b17023SJohn Marino
10e4b17023SJohn Marino@c If this file is included with the flag ``cppmanual'' set, it is
11e4b17023SJohn Marino@c formatted for inclusion in the CPP manual; otherwise the main GCC manual.
12e4b17023SJohn Marino
13e4b17023SJohn Marino@table @gcctabopt
14e4b17023SJohn Marino@item -D @var{name}
15e4b17023SJohn Marino@opindex D
16e4b17023SJohn MarinoPredefine @var{name} as a macro, with definition @code{1}.
17e4b17023SJohn Marino
18e4b17023SJohn Marino@item -D @var{name}=@var{definition}
19e4b17023SJohn MarinoThe contents of @var{definition} are tokenized and processed as if
20e4b17023SJohn Marinothey appeared during translation phase three in a @samp{#define}
21e4b17023SJohn Marinodirective.  In particular, the definition will be truncated by
22e4b17023SJohn Marinoembedded newline characters.
23e4b17023SJohn Marino
24e4b17023SJohn MarinoIf you are invoking the preprocessor from a shell or shell-like
25e4b17023SJohn Marinoprogram you may need to use the shell's quoting syntax to protect
26e4b17023SJohn Marinocharacters such as spaces that have a meaning in the shell syntax.
27e4b17023SJohn Marino
28e4b17023SJohn MarinoIf you wish to define a function-like macro on the command line, write
29e4b17023SJohn Marinoits argument list with surrounding parentheses before the equals sign
30e4b17023SJohn Marino(if any).  Parentheses are meaningful to most shells, so you will need
31e4b17023SJohn Marinoto quote the option.  With @command{sh} and @command{csh},
32e4b17023SJohn Marino@option{-D'@var{name}(@var{args@dots{}})=@var{definition}'} works.
33e4b17023SJohn Marino
34e4b17023SJohn Marino@option{-D} and @option{-U} options are processed in the order they
35e4b17023SJohn Marinoare given on the command line.  All @option{-imacros @var{file}} and
36e4b17023SJohn Marino@option{-include @var{file}} options are processed after all
37e4b17023SJohn Marino@option{-D} and @option{-U} options.
38e4b17023SJohn Marino
39e4b17023SJohn Marino@item -U @var{name}
40e4b17023SJohn Marino@opindex U
41e4b17023SJohn MarinoCancel any previous definition of @var{name}, either built in or
42e4b17023SJohn Marinoprovided with a @option{-D} option.
43e4b17023SJohn Marino
44e4b17023SJohn Marino@item -undef
45e4b17023SJohn Marino@opindex undef
46e4b17023SJohn MarinoDo not predefine any system-specific or GCC-specific macros.  The
47e4b17023SJohn Marinostandard predefined macros remain defined.
48e4b17023SJohn Marino@ifset cppmanual
49e4b17023SJohn Marino@xref{Standard Predefined Macros}.
50e4b17023SJohn Marino@end ifset
51e4b17023SJohn Marino
52e4b17023SJohn Marino@item -I @var{dir}
53e4b17023SJohn Marino@opindex I
54e4b17023SJohn MarinoAdd the directory @var{dir} to the list of directories to be searched
55e4b17023SJohn Marinofor header files.
56e4b17023SJohn Marino@ifset cppmanual
57e4b17023SJohn Marino@xref{Search Path}.
58e4b17023SJohn Marino@end ifset
59e4b17023SJohn MarinoDirectories named by @option{-I} are searched before the standard
60e4b17023SJohn Marinosystem include directories.  If the directory @var{dir} is a standard
61e4b17023SJohn Marinosystem include directory, the option is ignored to ensure that the
62e4b17023SJohn Marinodefault search order for system directories and the special treatment
63e4b17023SJohn Marinoof system headers are not defeated
64e4b17023SJohn Marino@ifset cppmanual
65e4b17023SJohn Marino(@pxref{System Headers})
66e4b17023SJohn Marino@end ifset
67e4b17023SJohn Marino.
68e4b17023SJohn MarinoIf @var{dir} begins with @code{=}, then the @code{=} will be replaced
69e4b17023SJohn Marinoby the sysroot prefix; see @option{--sysroot} and @option{-isysroot}.
70e4b17023SJohn Marino
71e4b17023SJohn Marino@item -o @var{file}
72e4b17023SJohn Marino@opindex o
73e4b17023SJohn MarinoWrite output to @var{file}.  This is the same as specifying @var{file}
74e4b17023SJohn Marinoas the second non-option argument to @command{cpp}.  @command{gcc} has a
75e4b17023SJohn Marinodifferent interpretation of a second non-option argument, so you must
76e4b17023SJohn Marinouse @option{-o} to specify the output file.
77e4b17023SJohn Marino
78e4b17023SJohn Marino@item -Wall
79e4b17023SJohn Marino@opindex Wall
80e4b17023SJohn MarinoTurns on all optional warnings which are desirable for normal code.
81e4b17023SJohn MarinoAt present this is @option{-Wcomment}, @option{-Wtrigraphs},
82e4b17023SJohn Marino@option{-Wmultichar} and a warning about integer promotion causing a
83e4b17023SJohn Marinochange of sign in @code{#if} expressions.  Note that many of the
84e4b17023SJohn Marinopreprocessor's warnings are on by default and have no options to
85e4b17023SJohn Marinocontrol them.
86e4b17023SJohn Marino
87e4b17023SJohn Marino@item -Wcomment
88e4b17023SJohn Marino@itemx -Wcomments
89e4b17023SJohn Marino@opindex Wcomment
90e4b17023SJohn Marino@opindex Wcomments
91e4b17023SJohn MarinoWarn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
92e4b17023SJohn Marinocomment, or whenever a backslash-newline appears in a @samp{//} comment.
93e4b17023SJohn Marino(Both forms have the same effect.)
94e4b17023SJohn Marino
95e4b17023SJohn Marino@item -Wtrigraphs
96e4b17023SJohn Marino@opindex Wtrigraphs
97e4b17023SJohn Marino@anchor{Wtrigraphs}
98e4b17023SJohn MarinoMost trigraphs in comments cannot affect the meaning of the program.
99e4b17023SJohn MarinoHowever, a trigraph that would form an escaped newline (@samp{??/} at
100e4b17023SJohn Marinothe end of a line) can, by changing where the comment begins or ends.
101e4b17023SJohn MarinoTherefore, only trigraphs that would form escaped newlines produce
102e4b17023SJohn Marinowarnings inside a comment.
103e4b17023SJohn Marino
104e4b17023SJohn MarinoThis option is implied by @option{-Wall}.  If @option{-Wall} is not
105e4b17023SJohn Marinogiven, this option is still enabled unless trigraphs are enabled.  To
106e4b17023SJohn Marinoget trigraph conversion without warnings, but get the other
107e4b17023SJohn Marino@option{-Wall} warnings, use @samp{-trigraphs -Wall -Wno-trigraphs}.
108e4b17023SJohn Marino
109e4b17023SJohn Marino@item -Wtraditional
110e4b17023SJohn Marino@opindex Wtraditional
111e4b17023SJohn MarinoWarn about certain constructs that behave differently in traditional and
112e4b17023SJohn MarinoISO C@.  Also warn about ISO C constructs that have no traditional C
113e4b17023SJohn Marinoequivalent, and problematic constructs which should be avoided.
114e4b17023SJohn Marino@ifset cppmanual
115e4b17023SJohn Marino@xref{Traditional Mode}.
116e4b17023SJohn Marino@end ifset
117e4b17023SJohn Marino
118e4b17023SJohn Marino@item -Wundef
119e4b17023SJohn Marino@opindex Wundef
120e4b17023SJohn MarinoWarn whenever an identifier which is not a macro is encountered in an
121e4b17023SJohn Marino@samp{#if} directive, outside of @samp{defined}.  Such identifiers are
122e4b17023SJohn Marinoreplaced with zero.
123e4b17023SJohn Marino
124e4b17023SJohn Marino@item -Wunused-macros
125e4b17023SJohn Marino@opindex Wunused-macros
126e4b17023SJohn MarinoWarn about macros defined in the main file that are unused.  A macro
127e4b17023SJohn Marinois @dfn{used} if it is expanded or tested for existence at least once.
128e4b17023SJohn MarinoThe preprocessor will also warn if the macro has not been used at the
129e4b17023SJohn Marinotime it is redefined or undefined.
130e4b17023SJohn Marino
131e4b17023SJohn MarinoBuilt-in macros, macros defined on the command line, and macros
132e4b17023SJohn Marinodefined in include files are not warned about.
133e4b17023SJohn Marino
134e4b17023SJohn Marino@emph{Note:} If a macro is actually used, but only used in skipped
135e4b17023SJohn Marinoconditional blocks, then CPP will report it as unused.  To avoid the
136e4b17023SJohn Marinowarning in such a case, you might improve the scope of the macro's
137e4b17023SJohn Marinodefinition by, for example, moving it into the first skipped block.
138e4b17023SJohn MarinoAlternatively, you could provide a dummy use with something like:
139e4b17023SJohn Marino
140e4b17023SJohn Marino@smallexample
141e4b17023SJohn Marino#if defined the_macro_causing_the_warning
142e4b17023SJohn Marino#endif
143e4b17023SJohn Marino@end smallexample
144e4b17023SJohn Marino
145e4b17023SJohn Marino@item -Wendif-labels
146e4b17023SJohn Marino@opindex Wendif-labels
147e4b17023SJohn MarinoWarn whenever an @samp{#else} or an @samp{#endif} are followed by text.
148e4b17023SJohn MarinoThis usually happens in code of the form
149e4b17023SJohn Marino
150e4b17023SJohn Marino@smallexample
151e4b17023SJohn Marino#if FOO
152e4b17023SJohn Marino@dots{}
153e4b17023SJohn Marino#else FOO
154e4b17023SJohn Marino@dots{}
155e4b17023SJohn Marino#endif FOO
156e4b17023SJohn Marino@end smallexample
157e4b17023SJohn Marino
158e4b17023SJohn Marino@noindent
159e4b17023SJohn MarinoThe second and third @code{FOO} should be in comments, but often are not
160e4b17023SJohn Marinoin older programs.  This warning is on by default.
161e4b17023SJohn Marino
162e4b17023SJohn Marino@item -Werror
163e4b17023SJohn Marino@opindex Werror
164e4b17023SJohn MarinoMake all warnings into hard errors.  Source code which triggers warnings
165e4b17023SJohn Marinowill be rejected.
166e4b17023SJohn Marino
167e4b17023SJohn Marino@item -Wsystem-headers
168e4b17023SJohn Marino@opindex Wsystem-headers
169e4b17023SJohn MarinoIssue warnings for code in system headers.  These are normally unhelpful
170e4b17023SJohn Marinoin finding bugs in your own code, therefore suppressed.  If you are
171e4b17023SJohn Marinoresponsible for the system library, you may want to see them.
172e4b17023SJohn Marino
173e4b17023SJohn Marino@item -w
174e4b17023SJohn Marino@opindex w
175e4b17023SJohn MarinoSuppress all warnings, including those which GNU CPP issues by default.
176e4b17023SJohn Marino
177e4b17023SJohn Marino@item -pedantic
178e4b17023SJohn Marino@opindex pedantic
179e4b17023SJohn MarinoIssue all the mandatory diagnostics listed in the C standard.  Some of
180e4b17023SJohn Marinothem are left out by default, since they trigger frequently on harmless
181e4b17023SJohn Marinocode.
182e4b17023SJohn Marino
183e4b17023SJohn Marino@item -pedantic-errors
184e4b17023SJohn Marino@opindex pedantic-errors
185e4b17023SJohn MarinoIssue all the mandatory diagnostics, and make all mandatory diagnostics
186e4b17023SJohn Marinointo errors.  This includes mandatory diagnostics that GCC issues
187e4b17023SJohn Marinowithout @samp{-pedantic} but treats as warnings.
188e4b17023SJohn Marino
189e4b17023SJohn Marino@item -M
190e4b17023SJohn Marino@opindex M
191e4b17023SJohn Marino@cindex @command{make}
192e4b17023SJohn Marino@cindex dependencies, @command{make}
193e4b17023SJohn MarinoInstead of outputting the result of preprocessing, output a rule
194e4b17023SJohn Marinosuitable for @command{make} describing the dependencies of the main
195e4b17023SJohn Marinosource file.  The preprocessor outputs one @command{make} rule containing
196e4b17023SJohn Marinothe object file name for that source file, a colon, and the names of all
197e4b17023SJohn Marinothe included files, including those coming from @option{-include} or
198e4b17023SJohn Marino@option{-imacros} command line options.
199e4b17023SJohn Marino
200e4b17023SJohn MarinoUnless specified explicitly (with @option{-MT} or @option{-MQ}), the
201e4b17023SJohn Marinoobject file name consists of the name of the source file with any
202e4b17023SJohn Marinosuffix replaced with object file suffix and with any leading directory
203e4b17023SJohn Marinoparts removed.  If there are many included files then the rule is
204e4b17023SJohn Marinosplit into several lines using @samp{\}-newline.  The rule has no
205e4b17023SJohn Marinocommands.
206e4b17023SJohn Marino
207e4b17023SJohn MarinoThis option does not suppress the preprocessor's debug output, such as
208e4b17023SJohn Marino@option{-dM}.  To avoid mixing such debug output with the dependency
209e4b17023SJohn Marinorules you should explicitly specify the dependency output file with
210e4b17023SJohn Marino@option{-MF}, or use an environment variable like
211e4b17023SJohn Marino@env{DEPENDENCIES_OUTPUT} (@pxref{Environment Variables}).  Debug output
212e4b17023SJohn Marinowill still be sent to the regular output stream as normal.
213e4b17023SJohn Marino
214e4b17023SJohn MarinoPassing @option{-M} to the driver implies @option{-E}, and suppresses
215e4b17023SJohn Marinowarnings with an implicit @option{-w}.
216e4b17023SJohn Marino
217e4b17023SJohn Marino@item -MM
218e4b17023SJohn Marino@opindex MM
219e4b17023SJohn MarinoLike @option{-M} but do not mention header files that are found in
220e4b17023SJohn Marinosystem header directories, nor header files that are included,
221e4b17023SJohn Marinodirectly or indirectly, from such a header.
222e4b17023SJohn Marino
223e4b17023SJohn MarinoThis implies that the choice of angle brackets or double quotes in an
224e4b17023SJohn Marino@samp{#include} directive does not in itself determine whether that
225e4b17023SJohn Marinoheader will appear in @option{-MM} dependency output.  This is a
226e4b17023SJohn Marinoslight change in semantics from GCC versions 3.0 and earlier.
227e4b17023SJohn Marino
228e4b17023SJohn Marino@anchor{dashMF}
229e4b17023SJohn Marino@item -MF @var{file}
230e4b17023SJohn Marino@opindex MF
231e4b17023SJohn MarinoWhen used with @option{-M} or @option{-MM}, specifies a
232e4b17023SJohn Marinofile to write the dependencies to.  If no @option{-MF} switch is given
233e4b17023SJohn Marinothe preprocessor sends the rules to the same place it would have sent
234e4b17023SJohn Marinopreprocessed output.
235e4b17023SJohn Marino
236e4b17023SJohn MarinoWhen used with the driver options @option{-MD} or @option{-MMD},
237e4b17023SJohn Marino@option{-MF} overrides the default dependency output file.
238e4b17023SJohn Marino
239e4b17023SJohn Marino@item -MG
240e4b17023SJohn Marino@opindex MG
241e4b17023SJohn MarinoIn conjunction with an option such as @option{-M} requesting
242e4b17023SJohn Marinodependency generation, @option{-MG} assumes missing header files are
243e4b17023SJohn Marinogenerated files and adds them to the dependency list without raising
244e4b17023SJohn Marinoan error.  The dependency filename is taken directly from the
245e4b17023SJohn Marino@code{#include} directive without prepending any path.  @option{-MG}
246e4b17023SJohn Marinoalso suppresses preprocessed output, as a missing header file renders
247e4b17023SJohn Marinothis useless.
248e4b17023SJohn Marino
249e4b17023SJohn MarinoThis feature is used in automatic updating of makefiles.
250e4b17023SJohn Marino
251e4b17023SJohn Marino@item -MP
252e4b17023SJohn Marino@opindex MP
253e4b17023SJohn MarinoThis option instructs CPP to add a phony target for each dependency
254e4b17023SJohn Marinoother than the main file, causing each to depend on nothing.  These
255e4b17023SJohn Marinodummy rules work around errors @command{make} gives if you remove header
256e4b17023SJohn Marinofiles without updating the @file{Makefile} to match.
257e4b17023SJohn Marino
258e4b17023SJohn MarinoThis is typical output:
259e4b17023SJohn Marino
260e4b17023SJohn Marino@smallexample
261e4b17023SJohn Marinotest.o: test.c test.h
262e4b17023SJohn Marino
263e4b17023SJohn Marinotest.h:
264e4b17023SJohn Marino@end smallexample
265e4b17023SJohn Marino
266e4b17023SJohn Marino@item -MT @var{target}
267e4b17023SJohn Marino@opindex MT
268e4b17023SJohn Marino
269e4b17023SJohn MarinoChange the target of the rule emitted by dependency generation.  By
270e4b17023SJohn Marinodefault CPP takes the name of the main input file, deletes any
271e4b17023SJohn Marinodirectory components and any file suffix such as @samp{.c}, and
272e4b17023SJohn Marinoappends the platform's usual object suffix.  The result is the target.
273e4b17023SJohn Marino
274e4b17023SJohn MarinoAn @option{-MT} option will set the target to be exactly the string you
275e4b17023SJohn Marinospecify.  If you want multiple targets, you can specify them as a single
276e4b17023SJohn Marinoargument to @option{-MT}, or use multiple @option{-MT} options.
277e4b17023SJohn Marino
278e4b17023SJohn MarinoFor example, @option{@w{-MT '$(objpfx)foo.o'}} might give
279e4b17023SJohn Marino
280e4b17023SJohn Marino@smallexample
281e4b17023SJohn Marino$(objpfx)foo.o: foo.c
282e4b17023SJohn Marino@end smallexample
283e4b17023SJohn Marino
284e4b17023SJohn Marino@item -MQ @var{target}
285e4b17023SJohn Marino@opindex MQ
286e4b17023SJohn Marino
287e4b17023SJohn MarinoSame as @option{-MT}, but it quotes any characters which are special to
288e4b17023SJohn MarinoMake.  @option{@w{-MQ '$(objpfx)foo.o'}} gives
289e4b17023SJohn Marino
290e4b17023SJohn Marino@smallexample
291e4b17023SJohn Marino$$(objpfx)foo.o: foo.c
292e4b17023SJohn Marino@end smallexample
293e4b17023SJohn Marino
294e4b17023SJohn MarinoThe default target is automatically quoted, as if it were given with
295e4b17023SJohn Marino@option{-MQ}.
296e4b17023SJohn Marino
297e4b17023SJohn Marino@item -MD
298e4b17023SJohn Marino@opindex MD
299e4b17023SJohn Marino@option{-MD} is equivalent to @option{-M -MF @var{file}}, except that
300e4b17023SJohn Marino@option{-E} is not implied.  The driver determines @var{file} based on
301e4b17023SJohn Marinowhether an @option{-o} option is given.  If it is, the driver uses its
302e4b17023SJohn Marinoargument but with a suffix of @file{.d}, otherwise it takes the name
303e4b17023SJohn Marinoof the input file, removes any directory components and suffix, and
304e4b17023SJohn Marinoapplies a @file{.d} suffix.
305e4b17023SJohn Marino
306e4b17023SJohn MarinoIf @option{-MD} is used in conjunction with @option{-E}, any
307e4b17023SJohn Marino@option{-o} switch is understood to specify the dependency output file
308e4b17023SJohn Marino(@pxref{dashMF,,-MF}), but if used without @option{-E}, each @option{-o}
309e4b17023SJohn Marinois understood to specify a target object file.
310e4b17023SJohn Marino
311e4b17023SJohn MarinoSince @option{-E} is not implied, @option{-MD} can be used to generate
312e4b17023SJohn Marinoa dependency output file as a side-effect of the compilation process.
313e4b17023SJohn Marino
314e4b17023SJohn Marino@item -MMD
315e4b17023SJohn Marino@opindex MMD
316e4b17023SJohn MarinoLike @option{-MD} except mention only user header files, not system
317e4b17023SJohn Marinoheader files.
318e4b17023SJohn Marino
319e4b17023SJohn Marino@ifclear cppmanual
320e4b17023SJohn Marino@item -fpch-deps
321e4b17023SJohn Marino@opindex fpch-deps
322e4b17023SJohn MarinoWhen using precompiled headers (@pxref{Precompiled Headers}), this flag
323e4b17023SJohn Marinowill cause the dependency-output flags to also list the files from the
324e4b17023SJohn Marinoprecompiled header's dependencies.  If not specified only the
325e4b17023SJohn Marinoprecompiled header would be listed and not the files that were used to
326e4b17023SJohn Marinocreate it because those files are not consulted when a precompiled
327e4b17023SJohn Marinoheader is used.
328e4b17023SJohn Marino
329e4b17023SJohn Marino@item -fpch-preprocess
330e4b17023SJohn Marino@opindex fpch-preprocess
331e4b17023SJohn MarinoThis option allows use of a precompiled header (@pxref{Precompiled
332e4b17023SJohn MarinoHeaders}) together with @option{-E}.  It inserts a special @code{#pragma},
333e4b17023SJohn Marino@code{#pragma GCC pch_preprocess "@var{filename}"} in the output to mark
334e4b17023SJohn Marinothe place where the precompiled header was found, and its @var{filename}.
335e4b17023SJohn MarinoWhen @option{-fpreprocessed} is in use, GCC recognizes this @code{#pragma}
336e4b17023SJohn Marinoand loads the PCH@.
337e4b17023SJohn Marino
338e4b17023SJohn MarinoThis option is off by default, because the resulting preprocessed output
339e4b17023SJohn Marinois only really suitable as input to GCC@.  It is switched on by
340e4b17023SJohn Marino@option{-save-temps}.
341e4b17023SJohn Marino
342e4b17023SJohn MarinoYou should not write this @code{#pragma} in your own code, but it is
343e4b17023SJohn Marinosafe to edit the filename if the PCH file is available in a different
344e4b17023SJohn Marinolocation.  The filename may be absolute or it may be relative to GCC's
345e4b17023SJohn Marinocurrent directory.
346e4b17023SJohn Marino
347e4b17023SJohn Marino@end ifclear
348e4b17023SJohn Marino@item -x c
349e4b17023SJohn Marino@itemx -x c++
350e4b17023SJohn Marino@itemx -x objective-c
351e4b17023SJohn Marino@itemx -x assembler-with-cpp
352e4b17023SJohn Marino@opindex x
353e4b17023SJohn MarinoSpecify the source language: C, C++, Objective-C, or assembly.  This has
354e4b17023SJohn Marinonothing to do with standards conformance or extensions; it merely
355e4b17023SJohn Marinoselects which base syntax to expect.  If you give none of these options,
356e4b17023SJohn Marinocpp will deduce the language from the extension of the source file:
357e4b17023SJohn Marino@samp{.c}, @samp{.cc}, @samp{.m}, or @samp{.S}.  Some other common
358e4b17023SJohn Marinoextensions for C++ and assembly are also recognized.  If cpp does not
359e4b17023SJohn Marinorecognize the extension, it will treat the file as C; this is the most
360e4b17023SJohn Marinogeneric mode.
361e4b17023SJohn Marino
362e4b17023SJohn Marino@emph{Note:} Previous versions of cpp accepted a @option{-lang} option
363e4b17023SJohn Marinowhich selected both the language and the standards conformance level.
364e4b17023SJohn MarinoThis option has been removed, because it conflicts with the @option{-l}
365e4b17023SJohn Marinooption.
366e4b17023SJohn Marino
367e4b17023SJohn Marino@item -std=@var{standard}
368e4b17023SJohn Marino@itemx -ansi
369e4b17023SJohn Marino@opindex ansi
370e4b17023SJohn Marino@opindex std=
371e4b17023SJohn MarinoSpecify the standard to which the code should conform.  Currently CPP
372e4b17023SJohn Marinoknows about C and C++ standards; others may be added in the future.
373e4b17023SJohn Marino
374e4b17023SJohn Marino@var{standard}
375e4b17023SJohn Marinomay be one of:
376e4b17023SJohn Marino@table @code
377e4b17023SJohn Marino@item c90
378e4b17023SJohn Marino@itemx c89
379e4b17023SJohn Marino@itemx iso9899:1990
380e4b17023SJohn MarinoThe ISO C standard from 1990.  @samp{c90} is the customary shorthand for
381e4b17023SJohn Marinothis version of the standard.
382e4b17023SJohn Marino
383e4b17023SJohn MarinoThe @option{-ansi} option is equivalent to @option{-std=c90}.
384e4b17023SJohn Marino
385e4b17023SJohn Marino@item iso9899:199409
386e4b17023SJohn MarinoThe 1990 C standard, as amended in 1994.
387e4b17023SJohn Marino
388e4b17023SJohn Marino@item iso9899:1999
389e4b17023SJohn Marino@itemx c99
390e4b17023SJohn Marino@itemx iso9899:199x
391e4b17023SJohn Marino@itemx c9x
392e4b17023SJohn MarinoThe revised ISO C standard, published in December 1999.  Before
393e4b17023SJohn Marinopublication, this was known as C9X@.
394e4b17023SJohn Marino
395e4b17023SJohn Marino@item iso9899:2011
396e4b17023SJohn Marino@itemx c11
397e4b17023SJohn Marino@itemx c1x
398e4b17023SJohn MarinoThe revised ISO C standard, published in December 2011.  Before
399e4b17023SJohn Marinopublication, this was known as C1X@.
400e4b17023SJohn Marino
401e4b17023SJohn Marino@item gnu90
402e4b17023SJohn Marino@itemx gnu89
403e4b17023SJohn MarinoThe 1990 C standard plus GNU extensions.  This is the default.
404e4b17023SJohn Marino
405e4b17023SJohn Marino@item gnu99
406e4b17023SJohn Marino@itemx gnu9x
407e4b17023SJohn MarinoThe 1999 C standard plus GNU extensions.
408e4b17023SJohn Marino
409e4b17023SJohn Marino@item gnu11
410e4b17023SJohn Marino@itemx gnu1x
411e4b17023SJohn MarinoThe 2011 C standard plus GNU extensions.
412e4b17023SJohn Marino
413e4b17023SJohn Marino@item c++98
414e4b17023SJohn MarinoThe 1998 ISO C++ standard plus amendments.
415e4b17023SJohn Marino
416e4b17023SJohn Marino@item gnu++98
417e4b17023SJohn MarinoThe same as @option{-std=c++98} plus GNU extensions.  This is the
418e4b17023SJohn Marinodefault for C++ code.
419e4b17023SJohn Marino@end table
420e4b17023SJohn Marino
421e4b17023SJohn Marino@item -I-
422e4b17023SJohn Marino@opindex I-
423e4b17023SJohn MarinoSplit the include path.  Any directories specified with @option{-I}
424e4b17023SJohn Marinooptions before @option{-I-} are searched only for headers requested with
425e4b17023SJohn Marino@code{@w{#include "@var{file}"}}; they are not searched for
426e4b17023SJohn Marino@code{@w{#include <@var{file}>}}.  If additional directories are
427e4b17023SJohn Marinospecified with @option{-I} options after the @option{-I-}, those
428e4b17023SJohn Marinodirectories are searched for all @samp{#include} directives.
429e4b17023SJohn Marino
430e4b17023SJohn MarinoIn addition, @option{-I-} inhibits the use of the directory of the current
431e4b17023SJohn Marinofile directory as the first search directory for @code{@w{#include
432e4b17023SJohn Marino"@var{file}"}}.
433e4b17023SJohn Marino@ifset cppmanual
434e4b17023SJohn Marino@xref{Search Path}.
435e4b17023SJohn Marino@end ifset
436e4b17023SJohn MarinoThis option has been deprecated.
437e4b17023SJohn Marino
438e4b17023SJohn Marino@item -nostdinc
439e4b17023SJohn Marino@opindex nostdinc
440e4b17023SJohn MarinoDo not search the standard system directories for header files.
441e4b17023SJohn MarinoOnly the directories you have specified with @option{-I} options
442e4b17023SJohn Marino(and the directory of the current file, if appropriate) are searched.
443e4b17023SJohn Marino
444e4b17023SJohn Marino@item -nostdinc++
445e4b17023SJohn Marino@opindex nostdinc++
446e4b17023SJohn MarinoDo not search for header files in the C++-specific standard directories,
447e4b17023SJohn Marinobut do still search the other standard directories.  (This option is
448e4b17023SJohn Marinoused when building the C++ library.)
449e4b17023SJohn Marino
450e4b17023SJohn Marino@item -include @var{file}
451e4b17023SJohn Marino@opindex include
452e4b17023SJohn MarinoProcess @var{file} as if @code{#include "file"} appeared as the first
453e4b17023SJohn Marinoline of the primary source file.  However, the first directory searched
454e4b17023SJohn Marinofor @var{file} is the preprocessor's working directory @emph{instead of}
455e4b17023SJohn Marinothe directory containing the main source file.  If not found there, it
456e4b17023SJohn Marinois searched for in the remainder of the @code{#include "@dots{}"} search
457e4b17023SJohn Marinochain as normal.
458e4b17023SJohn Marino
459e4b17023SJohn MarinoIf multiple @option{-include} options are given, the files are included
460e4b17023SJohn Marinoin the order they appear on the command line.
461e4b17023SJohn Marino
462e4b17023SJohn Marino@item -imacros @var{file}
463e4b17023SJohn Marino@opindex imacros
464e4b17023SJohn MarinoExactly like @option{-include}, except that any output produced by
465e4b17023SJohn Marinoscanning @var{file} is thrown away.  Macros it defines remain defined.
466e4b17023SJohn MarinoThis allows you to acquire all the macros from a header without also
467e4b17023SJohn Marinoprocessing its declarations.
468e4b17023SJohn Marino
469e4b17023SJohn MarinoAll files specified by @option{-imacros} are processed before all files
470e4b17023SJohn Marinospecified by @option{-include}.
471e4b17023SJohn Marino
472e4b17023SJohn Marino@item -idirafter @var{dir}
473e4b17023SJohn Marino@opindex idirafter
474e4b17023SJohn MarinoSearch @var{dir} for header files, but do it @emph{after} all
475e4b17023SJohn Marinodirectories specified with @option{-I} and the standard system directories
476e4b17023SJohn Marinohave been exhausted.  @var{dir} is treated as a system include directory.
477e4b17023SJohn MarinoIf @var{dir} begins with @code{=}, then the @code{=} will be replaced
478e4b17023SJohn Marinoby the sysroot prefix; see @option{--sysroot} and @option{-isysroot}.
479e4b17023SJohn Marino
480e4b17023SJohn Marino@item -iprefix @var{prefix}
481e4b17023SJohn Marino@opindex iprefix
482e4b17023SJohn MarinoSpecify @var{prefix} as the prefix for subsequent @option{-iwithprefix}
483e4b17023SJohn Marinooptions.  If the prefix represents a directory, you should include the
484e4b17023SJohn Marinofinal @samp{/}.
485e4b17023SJohn Marino
486e4b17023SJohn Marino@item -iwithprefix @var{dir}
487e4b17023SJohn Marino@itemx -iwithprefixbefore @var{dir}
488e4b17023SJohn Marino@opindex iwithprefix
489e4b17023SJohn Marino@opindex iwithprefixbefore
490e4b17023SJohn MarinoAppend @var{dir} to the prefix specified previously with
491e4b17023SJohn Marino@option{-iprefix}, and add the resulting directory to the include search
492e4b17023SJohn Marinopath.  @option{-iwithprefixbefore} puts it in the same place @option{-I}
493e4b17023SJohn Marinowould; @option{-iwithprefix} puts it where @option{-idirafter} would.
494e4b17023SJohn Marino
495e4b17023SJohn Marino@item -isysroot @var{dir}
496e4b17023SJohn Marino@opindex isysroot
497e4b17023SJohn MarinoThis option is like the @option{--sysroot} option, but applies only to
498e4b17023SJohn Marinoheader files (except for Darwin targets, where it applies to both header
499e4b17023SJohn Marinofiles and libraries).  See the @option{--sysroot} option for more
500e4b17023SJohn Marinoinformation.
501e4b17023SJohn Marino
502e4b17023SJohn Marino@item -imultilib @var{dir}
503e4b17023SJohn Marino@opindex imultilib
504e4b17023SJohn MarinoUse @var{dir} as a subdirectory of the directory containing
505e4b17023SJohn Marinotarget-specific C++ headers.
506e4b17023SJohn Marino
507e4b17023SJohn Marino@item -isystem @var{dir}
508e4b17023SJohn Marino@opindex isystem
509e4b17023SJohn MarinoSearch @var{dir} for header files, after all directories specified by
510e4b17023SJohn Marino@option{-I} but before the standard system directories.  Mark it
511e4b17023SJohn Marinoas a system directory, so that it gets the same special treatment as
512e4b17023SJohn Marinois applied to the standard system directories.
513e4b17023SJohn Marino@ifset cppmanual
514e4b17023SJohn Marino@xref{System Headers}.
515e4b17023SJohn Marino@end ifset
516e4b17023SJohn MarinoIf @var{dir} begins with @code{=}, then the @code{=} will be replaced
517e4b17023SJohn Marinoby the sysroot prefix; see @option{--sysroot} and @option{-isysroot}.
518e4b17023SJohn Marino
519e4b17023SJohn Marino@item -iquote @var{dir}
520e4b17023SJohn Marino@opindex iquote
521e4b17023SJohn MarinoSearch @var{dir} only for header files requested with
522e4b17023SJohn Marino@code{@w{#include "@var{file}"}}; they are not searched for
523e4b17023SJohn Marino@code{@w{#include <@var{file}>}}, before all directories specified by
524e4b17023SJohn Marino@option{-I} and before the standard system directories.
525e4b17023SJohn Marino@ifset cppmanual
526e4b17023SJohn Marino@xref{Search Path}.
527e4b17023SJohn Marino@end ifset
528e4b17023SJohn MarinoIf @var{dir} begins with @code{=}, then the @code{=} will be replaced
529e4b17023SJohn Marinoby the sysroot prefix; see @option{--sysroot} and @option{-isysroot}.
530e4b17023SJohn Marino
531e4b17023SJohn Marino@item -fdirectives-only
532e4b17023SJohn Marino@opindex fdirectives-only
533e4b17023SJohn MarinoWhen preprocessing, handle directives, but do not expand macros.
534e4b17023SJohn Marino
535e4b17023SJohn MarinoThe option's behavior depends on the @option{-E} and @option{-fpreprocessed}
536e4b17023SJohn Marinooptions.
537e4b17023SJohn Marino
538e4b17023SJohn MarinoWith @option{-E}, preprocessing is limited to the handling of directives
539e4b17023SJohn Marinosuch as @code{#define}, @code{#ifdef}, and @code{#error}.  Other
540e4b17023SJohn Marinopreprocessor operations, such as macro expansion and trigraph
541e4b17023SJohn Marinoconversion are not performed.  In addition, the @option{-dD} option is
542e4b17023SJohn Marinoimplicitly enabled.
543e4b17023SJohn Marino
544e4b17023SJohn MarinoWith @option{-fpreprocessed}, predefinition of command line and most
545e4b17023SJohn Marinobuiltin macros is disabled.  Macros such as @code{__LINE__}, which are
546e4b17023SJohn Marinocontextually dependent, are handled normally.  This enables compilation of
547e4b17023SJohn Marinofiles previously preprocessed with @code{-E -fdirectives-only}.
548e4b17023SJohn Marino
549e4b17023SJohn MarinoWith both @option{-E} and @option{-fpreprocessed}, the rules for
550e4b17023SJohn Marino@option{-fpreprocessed} take precedence.  This enables full preprocessing of
551e4b17023SJohn Marinofiles previously preprocessed with @code{-E -fdirectives-only}.
552e4b17023SJohn Marino
553e4b17023SJohn Marino@item -fdollars-in-identifiers
554e4b17023SJohn Marino@opindex fdollars-in-identifiers
555e4b17023SJohn Marino@anchor{fdollars-in-identifiers}
556e4b17023SJohn MarinoAccept @samp{$} in identifiers.
557e4b17023SJohn Marino@ifset cppmanual
558e4b17023SJohn Marino@xref{Identifier characters}.
559e4b17023SJohn Marino@end ifset
560e4b17023SJohn Marino
561e4b17023SJohn Marino@item -fextended-identifiers
562e4b17023SJohn Marino@opindex fextended-identifiers
563e4b17023SJohn MarinoAccept universal character names in identifiers.  This option is
564e4b17023SJohn Marinoexperimental; in a future version of GCC, it will be enabled by
565e4b17023SJohn Marinodefault for C99 and C++.
566e4b17023SJohn Marino
567e4b17023SJohn Marino@item -fpreprocessed
568e4b17023SJohn Marino@opindex fpreprocessed
569e4b17023SJohn MarinoIndicate to the preprocessor that the input file has already been
570e4b17023SJohn Marinopreprocessed.  This suppresses things like macro expansion, trigraph
571e4b17023SJohn Marinoconversion, escaped newline splicing, and processing of most directives.
572e4b17023SJohn MarinoThe preprocessor still recognizes and removes comments, so that you can
573e4b17023SJohn Marinopass a file preprocessed with @option{-C} to the compiler without
574e4b17023SJohn Marinoproblems.  In this mode the integrated preprocessor is little more than
575e4b17023SJohn Marinoa tokenizer for the front ends.
576e4b17023SJohn Marino
577e4b17023SJohn Marino@option{-fpreprocessed} is implicit if the input file has one of the
578e4b17023SJohn Marinoextensions @samp{.i}, @samp{.ii} or @samp{.mi}.  These are the
579e4b17023SJohn Marinoextensions that GCC uses for preprocessed files created by
580e4b17023SJohn Marino@option{-save-temps}.
581e4b17023SJohn Marino
582e4b17023SJohn Marino@item -ftabstop=@var{width}
583e4b17023SJohn Marino@opindex ftabstop
584e4b17023SJohn MarinoSet the distance between tab stops.  This helps the preprocessor report
585e4b17023SJohn Marinocorrect column numbers in warnings or errors, even if tabs appear on the
586e4b17023SJohn Marinoline.  If the value is less than 1 or greater than 100, the option is
587e4b17023SJohn Marinoignored.  The default is 8.
588e4b17023SJohn Marino
589e4b17023SJohn Marino@item -fdebug-cpp
590e4b17023SJohn Marino@opindex fdebug-cpp
591e4b17023SJohn MarinoThis option is only useful for debugging GCC.  When used with
592e4b17023SJohn Marino@option{-E}, dumps debugging information about location maps.  Every
593e4b17023SJohn Marinotoken in the output is preceded by the dump of the map its location
594e4b17023SJohn Marinobelongs to.  The dump of the map holding the location of a token would
595e4b17023SJohn Marinobe:
596e4b17023SJohn Marino@smallexample
597e4b17023SJohn Marino@{@samp{P}:@file{/file/path};@samp{F}:@file{/includer/path};@samp{L}:@var{line_num};@samp{C}:@var{col_num};@samp{S}:@var{system_header_p};@samp{M}:@var{map_address};@samp{E}:@var{macro_expansion_p},@samp{loc}:@var{location}@}
598e4b17023SJohn Marino@end smallexample
599e4b17023SJohn Marino
600e4b17023SJohn MarinoWhen used without @option{-E}, this option has no effect.
601e4b17023SJohn Marino
602e4b17023SJohn Marino@item -ftrack-macro-expansion@r{[}=@var{level}@r{]}
603e4b17023SJohn Marino@opindex ftrack-macro-expansion
604e4b17023SJohn MarinoTrack locations of tokens across macro expansions. This allows the
605e4b17023SJohn Marinocompiler to emit diagnostic about the current macro expansion stack
606e4b17023SJohn Marinowhen a compilation error occurs in a macro expansion. Using this
607e4b17023SJohn Marinooption makes the preprocessor and the compiler consume more
608e4b17023SJohn Marinomemory. The @var{level} parameter can be used to choose the level of
609e4b17023SJohn Marinoprecision of token location tracking thus decreasing the memory
610e4b17023SJohn Marinoconsumption if necessary. Value @samp{0} of @var{level} de-activates
611e4b17023SJohn Marinothis option just as if no @option{-ftrack-macro-expansion} was present
612e4b17023SJohn Marinoon the command line. Value @samp{1} tracks tokens locations in a
613e4b17023SJohn Marinodegraded mode for the sake of minimal memory overhead. In this mode
614e4b17023SJohn Marinoall tokens resulting from the expansion of an argument of a
615e4b17023SJohn Marinofunction-like macro have the same location. Value @samp{2} tracks
616e4b17023SJohn Marinotokens locations completely. This value is the most memory hungry.
617e4b17023SJohn MarinoWhen this option is given no argument, the default parameter value is
618e4b17023SJohn Marino@samp{2}.
619e4b17023SJohn Marino
620e4b17023SJohn Marino@item -fexec-charset=@var{charset}
621e4b17023SJohn Marino@opindex fexec-charset
622e4b17023SJohn Marino@cindex character set, execution
623e4b17023SJohn MarinoSet the execution character set, used for string and character
624e4b17023SJohn Marinoconstants.  The default is UTF-8.  @var{charset} can be any encoding
625e4b17023SJohn Marinosupported by the system's @code{iconv} library routine.
626e4b17023SJohn Marino
627e4b17023SJohn Marino@item -fwide-exec-charset=@var{charset}
628e4b17023SJohn Marino@opindex fwide-exec-charset
629e4b17023SJohn Marino@cindex character set, wide execution
630e4b17023SJohn MarinoSet the wide execution character set, used for wide string and
631e4b17023SJohn Marinocharacter constants.  The default is UTF-32 or UTF-16, whichever
632e4b17023SJohn Marinocorresponds to the width of @code{wchar_t}.  As with
633e4b17023SJohn Marino@option{-fexec-charset}, @var{charset} can be any encoding supported
634e4b17023SJohn Marinoby the system's @code{iconv} library routine; however, you will have
635e4b17023SJohn Marinoproblems with encodings that do not fit exactly in @code{wchar_t}.
636e4b17023SJohn Marino
637e4b17023SJohn Marino@item -finput-charset=@var{charset}
638e4b17023SJohn Marino@opindex finput-charset
639e4b17023SJohn Marino@cindex character set, input
640e4b17023SJohn MarinoSet the input character set, used for translation from the character
641e4b17023SJohn Marinoset of the input file to the source character set used by GCC@.  If the
642e4b17023SJohn Marinolocale does not specify, or GCC cannot get this information from the
643e4b17023SJohn Marinolocale, the default is UTF-8.  This can be overridden by either the locale
644e4b17023SJohn Marinoor this command line option.  Currently the command line option takes
645e4b17023SJohn Marinoprecedence if there's a conflict.  @var{charset} can be any encoding
646e4b17023SJohn Marinosupported by the system's @code{iconv} library routine.
647e4b17023SJohn Marino
648e4b17023SJohn Marino@item -fworking-directory
649e4b17023SJohn Marino@opindex fworking-directory
650e4b17023SJohn Marino@opindex fno-working-directory
651e4b17023SJohn MarinoEnable generation of linemarkers in the preprocessor output that will
652e4b17023SJohn Marinolet the compiler know the current working directory at the time of
653e4b17023SJohn Marinopreprocessing.  When this option is enabled, the preprocessor will
654e4b17023SJohn Marinoemit, after the initial linemarker, a second linemarker with the
655e4b17023SJohn Marinocurrent working directory followed by two slashes.  GCC will use this
656e4b17023SJohn Marinodirectory, when it's present in the preprocessed input, as the
657e4b17023SJohn Marinodirectory emitted as the current working directory in some debugging
658e4b17023SJohn Marinoinformation formats.  This option is implicitly enabled if debugging
659e4b17023SJohn Marinoinformation is enabled, but this can be inhibited with the negated
660e4b17023SJohn Marinoform @option{-fno-working-directory}.  If the @option{-P} flag is
661e4b17023SJohn Marinopresent in the command line, this option has no effect, since no
662e4b17023SJohn Marino@code{#line} directives are emitted whatsoever.
663e4b17023SJohn Marino
664e4b17023SJohn Marino@item -fno-show-column
665e4b17023SJohn Marino@opindex fno-show-column
666e4b17023SJohn MarinoDo not print column numbers in diagnostics.  This may be necessary if
667e4b17023SJohn Marinodiagnostics are being scanned by a program that does not understand the
668e4b17023SJohn Marinocolumn numbers, such as @command{dejagnu}.
669e4b17023SJohn Marino
670e4b17023SJohn Marino@item -A @var{predicate}=@var{answer}
671e4b17023SJohn Marino@opindex A
672e4b17023SJohn MarinoMake an assertion with the predicate @var{predicate} and answer
673e4b17023SJohn Marino@var{answer}.  This form is preferred to the older form @option{-A
674e4b17023SJohn Marino@var{predicate}(@var{answer})}, which is still supported, because
675e4b17023SJohn Marinoit does not use shell special characters.
676e4b17023SJohn Marino@ifset cppmanual
677e4b17023SJohn Marino@xref{Obsolete Features}.
678e4b17023SJohn Marino@end ifset
679e4b17023SJohn Marino
680e4b17023SJohn Marino@item -A -@var{predicate}=@var{answer}
681e4b17023SJohn MarinoCancel an assertion with the predicate @var{predicate} and answer
682e4b17023SJohn Marino@var{answer}.
683e4b17023SJohn Marino
684e4b17023SJohn Marino@item -dCHARS
685e4b17023SJohn Marino@var{CHARS} is a sequence of one or more of the following characters,
686e4b17023SJohn Marinoand must not be preceded by a space.  Other characters are interpreted
687e4b17023SJohn Marinoby the compiler proper, or reserved for future versions of GCC, and so
688e4b17023SJohn Marinoare silently ignored.  If you specify characters whose behavior
689e4b17023SJohn Marinoconflicts, the result is undefined.
690e4b17023SJohn Marino
691e4b17023SJohn Marino@table @samp
692e4b17023SJohn Marino@item M
693e4b17023SJohn Marino@opindex dM
694e4b17023SJohn MarinoInstead of the normal output, generate a list of @samp{#define}
695e4b17023SJohn Marinodirectives for all the macros defined during the execution of the
696e4b17023SJohn Marinopreprocessor, including predefined macros.  This gives you a way of
697e4b17023SJohn Marinofinding out what is predefined in your version of the preprocessor.
698e4b17023SJohn MarinoAssuming you have no file @file{foo.h}, the command
699e4b17023SJohn Marino
700e4b17023SJohn Marino@smallexample
701e4b17023SJohn Marinotouch foo.h; cpp -dM foo.h
702e4b17023SJohn Marino@end smallexample
703e4b17023SJohn Marino
704e4b17023SJohn Marino@noindent
705e4b17023SJohn Marinowill show all the predefined macros.
706e4b17023SJohn Marino
707e4b17023SJohn MarinoIf you use @option{-dM} without the @option{-E} option, @option{-dM} is
708e4b17023SJohn Marinointerpreted as a synonym for @option{-fdump-rtl-mach}.
709e4b17023SJohn Marino@xref{Debugging Options, , ,gcc}.
710e4b17023SJohn Marino
711e4b17023SJohn Marino@item D
712e4b17023SJohn Marino@opindex dD
713e4b17023SJohn MarinoLike @samp{M} except in two respects: it does @emph{not} include the
714e4b17023SJohn Marinopredefined macros, and it outputs @emph{both} the @samp{#define}
715e4b17023SJohn Marinodirectives and the result of preprocessing.  Both kinds of output go to
716e4b17023SJohn Marinothe standard output file.
717e4b17023SJohn Marino
718e4b17023SJohn Marino@item N
719e4b17023SJohn Marino@opindex dN
720e4b17023SJohn MarinoLike @samp{D}, but emit only the macro names, not their expansions.
721e4b17023SJohn Marino
722e4b17023SJohn Marino@item I
723e4b17023SJohn Marino@opindex dI
724e4b17023SJohn MarinoOutput @samp{#include} directives in addition to the result of
725e4b17023SJohn Marinopreprocessing.
726e4b17023SJohn Marino
727e4b17023SJohn Marino@item U
728e4b17023SJohn Marino@opindex dU
729e4b17023SJohn MarinoLike @samp{D} except that only macros that are expanded, or whose
730e4b17023SJohn Marinodefinedness is tested in preprocessor directives, are output; the
731e4b17023SJohn Marinooutput is delayed until the use or test of the macro; and
732e4b17023SJohn Marino@samp{#undef} directives are also output for macros tested but
733e4b17023SJohn Marinoundefined at the time.
734e4b17023SJohn Marino@end table
735e4b17023SJohn Marino
736e4b17023SJohn Marino@item -P
737e4b17023SJohn Marino@opindex P
738e4b17023SJohn MarinoInhibit generation of linemarkers in the output from the preprocessor.
739e4b17023SJohn MarinoThis might be useful when running the preprocessor on something that is
740e4b17023SJohn Marinonot C code, and will be sent to a program which might be confused by the
741e4b17023SJohn Marinolinemarkers.
742e4b17023SJohn Marino@ifset cppmanual
743e4b17023SJohn Marino@xref{Preprocessor Output}.
744e4b17023SJohn Marino@end ifset
745e4b17023SJohn Marino
746e4b17023SJohn Marino@item -C
747e4b17023SJohn Marino@opindex C
748e4b17023SJohn MarinoDo not discard comments.  All comments are passed through to the output
749e4b17023SJohn Marinofile, except for comments in processed directives, which are deleted
750e4b17023SJohn Marinoalong with the directive.
751e4b17023SJohn Marino
752e4b17023SJohn MarinoYou should be prepared for side effects when using @option{-C}; it
753e4b17023SJohn Marinocauses the preprocessor to treat comments as tokens in their own right.
754e4b17023SJohn MarinoFor example, comments appearing at the start of what would be a
755e4b17023SJohn Marinodirective line have the effect of turning that line into an ordinary
756e4b17023SJohn Marinosource line, since the first token on the line is no longer a @samp{#}.
757e4b17023SJohn Marino
758e4b17023SJohn Marino@item -CC
759e4b17023SJohn MarinoDo not discard comments, including during macro expansion.  This is
760e4b17023SJohn Marinolike @option{-C}, except that comments contained within macros are
761e4b17023SJohn Marinoalso passed through to the output file where the macro is expanded.
762e4b17023SJohn Marino
763e4b17023SJohn MarinoIn addition to the side-effects of the @option{-C} option, the
764e4b17023SJohn Marino@option{-CC} option causes all C++-style comments inside a macro
765e4b17023SJohn Marinoto be converted to C-style comments.  This is to prevent later use
766e4b17023SJohn Marinoof that macro from inadvertently commenting out the remainder of
767e4b17023SJohn Marinothe source line.
768e4b17023SJohn Marino
769e4b17023SJohn MarinoThe @option{-CC} option is generally used to support lint comments.
770e4b17023SJohn Marino
771e4b17023SJohn Marino@item -traditional-cpp
772e4b17023SJohn Marino@opindex traditional-cpp
773e4b17023SJohn MarinoTry to imitate the behavior of old-fashioned C preprocessors, as
774e4b17023SJohn Marinoopposed to ISO C preprocessors.
775e4b17023SJohn Marino@ifset cppmanual
776e4b17023SJohn Marino@xref{Traditional Mode}.
777e4b17023SJohn Marino@end ifset
778e4b17023SJohn Marino
779e4b17023SJohn Marino@item -trigraphs
780e4b17023SJohn Marino@opindex trigraphs
781e4b17023SJohn MarinoProcess trigraph sequences.
782e4b17023SJohn Marino@ifset cppmanual
783e4b17023SJohn Marino@xref{Initial processing}.
784e4b17023SJohn Marino@end ifset
785e4b17023SJohn Marino@ifclear cppmanual
786e4b17023SJohn MarinoThese are three-character sequences, all starting with @samp{??}, that
787e4b17023SJohn Marinoare defined by ISO C to stand for single characters.  For example,
788e4b17023SJohn Marino@samp{??/} stands for @samp{\}, so @samp{'??/n'} is a character
789e4b17023SJohn Marinoconstant for a newline.  By default, GCC ignores trigraphs, but in
790e4b17023SJohn Marinostandard-conforming modes it converts them.  See the @option{-std} and
791e4b17023SJohn Marino@option{-ansi} options.
792e4b17023SJohn Marino
793e4b17023SJohn MarinoThe nine trigraphs and their replacements are
794e4b17023SJohn Marino
795e4b17023SJohn Marino@smallexample
796e4b17023SJohn MarinoTrigraph:       ??(  ??)  ??<  ??>  ??=  ??/  ??'  ??!  ??-
797e4b17023SJohn MarinoReplacement:      [    ]    @{    @}    #    \    ^    |    ~
798e4b17023SJohn Marino@end smallexample
799e4b17023SJohn Marino@end ifclear
800e4b17023SJohn Marino
801e4b17023SJohn Marino@item -remap
802e4b17023SJohn Marino@opindex remap
803e4b17023SJohn MarinoEnable special code to work around file systems which only permit very
804e4b17023SJohn Marinoshort file names, such as MS-DOS@.
805e4b17023SJohn Marino
806*5ce9237cSJohn Marino@item --help
807e4b17023SJohn Marino@itemx --target-help
808e4b17023SJohn Marino@opindex help
809e4b17023SJohn Marino@opindex target-help
810e4b17023SJohn MarinoPrint text describing all the command line options instead of
811e4b17023SJohn Marinopreprocessing anything.
812e4b17023SJohn Marino
813e4b17023SJohn Marino@item -v
814e4b17023SJohn Marino@opindex v
815e4b17023SJohn MarinoVerbose mode.  Print out GNU CPP's version number at the beginning of
816e4b17023SJohn Marinoexecution, and report the final form of the include path.
817e4b17023SJohn Marino
818e4b17023SJohn Marino@item -H
819e4b17023SJohn Marino@opindex H
820e4b17023SJohn MarinoPrint the name of each header file used, in addition to other normal
821e4b17023SJohn Marinoactivities.  Each name is indented to show how deep in the
822e4b17023SJohn Marino@samp{#include} stack it is.  Precompiled header files are also
823e4b17023SJohn Marinoprinted, even if they are found to be invalid; an invalid precompiled
824e4b17023SJohn Marinoheader file is printed with @samp{...x} and a valid one with @samp{...!} .
825e4b17023SJohn Marino
826e4b17023SJohn Marino@item -version
827e4b17023SJohn Marino@itemx --version
828e4b17023SJohn Marino@opindex version
829e4b17023SJohn MarinoPrint out GNU CPP's version number.  With one dash, proceed to
830e4b17023SJohn Marinopreprocess as normal.  With two dashes, exit immediately.
831e4b17023SJohn Marino@end table
832