]>
Commit | Line | Data |
---|---|---|
a945c346 | 1 | @c Copyright (C) 1999-2024 Free Software Foundation, Inc. |
d77de738 ML |
2 | @c This is part of the CPP and GCC manuals. |
3 | @c For copying conditions, see the file gcc.texi. | |
4 | ||
5 | @c --------------------------------------------------------------------- | |
6 | @c Options affecting the preprocessor | |
7 | @c --------------------------------------------------------------------- | |
8 | ||
9 | @c If this file is included with the flag ``cppmanual'' set, it is | |
10 | @c formatted for inclusion in the CPP manual; otherwise the main GCC manual. | |
11 | ||
d77de738 | 12 | @opindex D |
ddf6fe37 | 13 | @item -D @var{name} |
d77de738 ML |
14 | Predefine @var{name} as a macro, with definition @code{1}. |
15 | ||
16 | @item -D @var{name}=@var{definition} | |
17 | The contents of @var{definition} are tokenized and processed as if | |
18 | they appeared during translation phase three in a @samp{#define} | |
19 | directive. In particular, the definition is truncated by | |
20 | embedded newline characters. | |
21 | ||
22 | If you are invoking the preprocessor from a shell or shell-like | |
23 | program you may need to use the shell's quoting syntax to protect | |
24 | characters such as spaces that have a meaning in the shell syntax. | |
25 | ||
26 | If you wish to define a function-like macro on the command line, write | |
27 | its argument list with surrounding parentheses before the equals sign | |
28 | (if any). Parentheses are meaningful to most shells, so you should | |
29 | quote the option. With @command{sh} and @command{csh}, | |
30 | @option{-D'@var{name}(@var{args@dots{}})=@var{definition}'} works. | |
31 | ||
32 | @option{-D} and @option{-U} options are processed in the order they | |
33 | are given on the command line. All @option{-imacros @var{file}} and | |
34 | @option{-include @var{file}} options are processed after all | |
35 | @option{-D} and @option{-U} options. | |
36 | ||
d77de738 | 37 | @opindex U |
ddf6fe37 | 38 | @item -U @var{name} |
d77de738 ML |
39 | Cancel any previous definition of @var{name}, either built in or |
40 | provided with a @option{-D} option. | |
41 | ||
d77de738 | 42 | @opindex include |
ddf6fe37 | 43 | @item -include @var{file} |
d77de738 ML |
44 | Process @var{file} as if @code{#include "file"} appeared as the first |
45 | line of the primary source file. However, the first directory searched | |
46 | for @var{file} is the preprocessor's working directory @emph{instead of} | |
47 | the directory containing the main source file. If not found there, it | |
48 | is searched for in the remainder of the @code{#include "@dots{}"} search | |
49 | chain as normal. | |
50 | ||
51 | If multiple @option{-include} options are given, the files are included | |
52 | in the order they appear on the command line. | |
53 | ||
d77de738 | 54 | @opindex imacros |
ddf6fe37 | 55 | @item -imacros @var{file} |
d77de738 ML |
56 | Exactly like @option{-include}, except that any output produced by |
57 | scanning @var{file} is thrown away. Macros it defines remain defined. | |
58 | This allows you to acquire all the macros from a header without also | |
59 | processing its declarations. | |
60 | ||
61 | All files specified by @option{-imacros} are processed before all files | |
62 | specified by @option{-include}. | |
63 | ||
d77de738 | 64 | @opindex undef |
ddf6fe37 | 65 | @item -undef |
d77de738 ML |
66 | Do not predefine any system-specific or GCC-specific macros. The |
67 | standard predefined macros remain defined. | |
68 | @ifset cppmanual | |
69 | @xref{Standard Predefined Macros}. | |
70 | @end ifset | |
71 | ||
d77de738 | 72 | @opindex pthread |
ddf6fe37 | 73 | @item -pthread |
d77de738 ML |
74 | Define additional macros required for using the POSIX threads library. |
75 | You should use this option consistently for both compilation and linking. | |
76 | This option is supported on GNU/Linux targets, most other Unix derivatives, | |
77 | and also on x86 Cygwin and MinGW targets. | |
78 | ||
d77de738 ML |
79 | @opindex M |
80 | @cindex @command{make} | |
81 | @cindex dependencies, @command{make} | |
f33d7a88 | 82 | @item -M |
d77de738 ML |
83 | Instead of outputting the result of preprocessing, output a rule |
84 | suitable for @command{make} describing the dependencies of the main | |
85 | source file. The preprocessor outputs one @command{make} rule containing | |
86 | the object file name for that source file, a colon, and the names of all | |
87 | the included files, including those coming from @option{-include} or | |
88 | @option{-imacros} command-line options. | |
89 | ||
90 | Unless specified explicitly (with @option{-MT} or @option{-MQ}), the | |
91 | object file name consists of the name of the source file with any | |
92 | suffix replaced with object file suffix and with any leading directory | |
93 | parts removed. If there are many included files then the rule is | |
94 | split into several lines using @samp{\}-newline. The rule has no | |
95 | commands. | |
96 | ||
97 | This option does not suppress the preprocessor's debug output, such as | |
98 | @option{-dM}. To avoid mixing such debug output with the dependency | |
99 | rules you should explicitly specify the dependency output file with | |
100 | @option{-MF}, or use an environment variable like | |
101 | @env{DEPENDENCIES_OUTPUT} (@pxref{Environment Variables}). Debug output | |
102 | is still sent to the regular output stream as normal. | |
103 | ||
104 | Passing @option{-M} to the driver implies @option{-E}, and suppresses | |
105 | warnings with an implicit @option{-w}. | |
106 | ||
d77de738 | 107 | @opindex MM |
ddf6fe37 | 108 | @item -MM |
d77de738 ML |
109 | Like @option{-M} but do not mention header files that are found in |
110 | system header directories, nor header files that are included, | |
111 | directly or indirectly, from such a header. | |
112 | ||
113 | This implies that the choice of angle brackets or double quotes in an | |
114 | @samp{#include} directive does not in itself determine whether that | |
115 | header appears in @option{-MM} dependency output. | |
116 | ||
117 | @anchor{dashMF} | |
d77de738 | 118 | @opindex MF |
ddf6fe37 | 119 | @item -MF @var{file} |
d77de738 ML |
120 | When used with @option{-M} or @option{-MM}, specifies a |
121 | file to write the dependencies to. If no @option{-MF} switch is given | |
122 | the preprocessor sends the rules to the same place it would send | |
123 | preprocessed output. | |
124 | ||
125 | When used with the driver options @option{-MD} or @option{-MMD}, | |
126 | @option{-MF} overrides the default dependency output file. | |
127 | ||
128 | If @var{file} is @file{-}, then the dependencies are written to @file{stdout}. | |
129 | ||
d77de738 | 130 | @opindex MG |
ddf6fe37 | 131 | @item -MG |
d77de738 ML |
132 | In conjunction with an option such as @option{-M} requesting |
133 | dependency generation, @option{-MG} assumes missing header files are | |
134 | generated files and adds them to the dependency list without raising | |
135 | an error. The dependency filename is taken directly from the | |
136 | @code{#include} directive without prepending any path. @option{-MG} | |
137 | also suppresses preprocessed output, as a missing header file renders | |
138 | this useless. | |
139 | ||
140 | This feature is used in automatic updating of makefiles. | |
141 | ||
d77de738 | 142 | @opindex Mno-modules |
ddf6fe37 | 143 | @item -Mno-modules |
d77de738 ML |
144 | Disable dependency generation for compiled module interfaces. |
145 | ||
d77de738 | 146 | @opindex MP |
ddf6fe37 | 147 | @item -MP |
d77de738 ML |
148 | This option instructs CPP to add a phony target for each dependency |
149 | other than the main file, causing each to depend on nothing. These | |
150 | dummy rules work around errors @command{make} gives if you remove header | |
151 | files without updating the @file{Makefile} to match. | |
152 | ||
153 | This is typical output: | |
154 | ||
155 | @smallexample | |
156 | test.o: test.c test.h | |
157 | ||
158 | test.h: | |
159 | @end smallexample | |
160 | ||
d77de738 | 161 | @opindex MT |
ddf6fe37 | 162 | @item -MT @var{target} |
d77de738 ML |
163 | |
164 | Change the target of the rule emitted by dependency generation. By | |
165 | default CPP takes the name of the main input file, deletes any | |
166 | directory components and any file suffix such as @samp{.c}, and | |
167 | appends the platform's usual object suffix. The result is the target. | |
168 | ||
169 | An @option{-MT} option sets the target to be exactly the string you | |
170 | specify. If you want multiple targets, you can specify them as a single | |
171 | argument to @option{-MT}, or use multiple @option{-MT} options. | |
172 | ||
173 | For example, @option{@w{-MT '$(objpfx)foo.o'}} might give | |
174 | ||
175 | @smallexample | |
176 | $(objpfx)foo.o: foo.c | |
177 | @end smallexample | |
178 | ||
d77de738 | 179 | @opindex MQ |
ddf6fe37 | 180 | @item -MQ @var{target} |
d77de738 ML |
181 | |
182 | Same as @option{-MT}, but it quotes any characters which are special to | |
183 | Make. @option{@w{-MQ '$(objpfx)foo.o'}} gives | |
184 | ||
185 | @smallexample | |
186 | $$(objpfx)foo.o: foo.c | |
187 | @end smallexample | |
188 | ||
189 | The default target is automatically quoted, as if it were given with | |
190 | @option{-MQ}. | |
191 | ||
d77de738 | 192 | @opindex MD |
ddf6fe37 | 193 | @item -MD |
d77de738 ML |
194 | @option{-MD} is equivalent to @option{-M -MF @var{file}}, except that |
195 | @option{-E} is not implied. The driver determines @var{file} based on | |
196 | whether an @option{-o} option is given. If it is, the driver uses its | |
197 | argument but with a suffix of @file{.d}, otherwise it takes the name | |
198 | of the input file, removes any directory components and suffix, and | |
199 | applies a @file{.d} suffix. | |
200 | ||
201 | If @option{-MD} is used in conjunction with @option{-E}, any | |
202 | @option{-o} switch is understood to specify the dependency output file | |
203 | (@pxref{dashMF,,-MF}), but if used without @option{-E}, each @option{-o} | |
204 | is understood to specify a target object file. | |
205 | ||
206 | Since @option{-E} is not implied, @option{-MD} can be used to generate | |
207 | a dependency output file as a side effect of the compilation process. | |
208 | ||
d77de738 | 209 | @opindex MMD |
ddf6fe37 | 210 | @item -MMD |
d77de738 ML |
211 | Like @option{-MD} except mention only user header files, not system |
212 | header files. | |
213 | ||
d77de738 | 214 | @opindex fpreprocessed |
ddf6fe37 | 215 | @item -fpreprocessed |
d77de738 ML |
216 | Indicate to the preprocessor that the input file has already been |
217 | preprocessed. This suppresses things like macro expansion, trigraph | |
218 | conversion, escaped newline splicing, and processing of most directives. | |
219 | The preprocessor still recognizes and removes comments, so that you can | |
220 | pass a file preprocessed with @option{-C} to the compiler without | |
221 | problems. In this mode the integrated preprocessor is little more than | |
222 | a tokenizer for the front ends. | |
223 | ||
224 | @option{-fpreprocessed} is implicit if the input file has one of the | |
225 | extensions @samp{.i}, @samp{.ii} or @samp{.mi}. These are the | |
226 | extensions that GCC uses for preprocessed files created by | |
227 | @option{-save-temps}. | |
228 | ||
d77de738 | 229 | @opindex fdirectives-only |
ddf6fe37 | 230 | @item -fdirectives-only |
d77de738 ML |
231 | When preprocessing, handle directives, but do not expand macros. |
232 | ||
233 | The option's behavior depends on the @option{-E} and @option{-fpreprocessed} | |
234 | options. | |
235 | ||
236 | With @option{-E}, preprocessing is limited to the handling of directives | |
237 | such as @code{#define}, @code{#ifdef}, and @code{#error}. Other | |
238 | preprocessor operations, such as macro expansion and trigraph | |
239 | conversion are not performed. In addition, the @option{-dD} option is | |
240 | implicitly enabled. | |
241 | ||
242 | With @option{-fpreprocessed}, predefinition of command line and most | |
243 | builtin macros is disabled. Macros such as @code{__LINE__}, which are | |
244 | contextually dependent, are handled normally. This enables compilation of | |
245 | files previously preprocessed with @code{-E -fdirectives-only}. | |
246 | ||
247 | With both @option{-E} and @option{-fpreprocessed}, the rules for | |
248 | @option{-fpreprocessed} take precedence. This enables full preprocessing of | |
249 | files previously preprocessed with @code{-E -fdirectives-only}. | |
250 | ||
d77de738 | 251 | @opindex fdollars-in-identifiers |
ddf6fe37 | 252 | @item -fdollars-in-identifiers |
d77de738 ML |
253 | @anchor{fdollars-in-identifiers} |
254 | Accept @samp{$} in identifiers. | |
255 | @ifset cppmanual | |
256 | @xref{Identifier characters}. | |
257 | @end ifset | |
258 | ||
d77de738 | 259 | @opindex fextended-identifiers |
ddf6fe37 | 260 | @item -fextended-identifiers |
d77de738 ML |
261 | Accept universal character names and extended characters in |
262 | identifiers. This option is enabled by default for C99 (and later C | |
263 | standard versions) and C++. | |
264 | ||
d77de738 | 265 | @opindex fno-canonical-system-headers |
ddf6fe37 | 266 | @item -fno-canonical-system-headers |
d77de738 ML |
267 | When preprocessing, do not shorten system header paths with canonicalization. |
268 | ||
d77de738 | 269 | @opindex fmax-include-depth |
ddf6fe37 | 270 | @item -fmax-include-depth=@var{depth} |
d77de738 ML |
271 | Set the maximum depth of the nested #include. The default is 200. |
272 | ||
d77de738 | 273 | @opindex ftabstop |
ddf6fe37 | 274 | @item -ftabstop=@var{width} |
d77de738 ML |
275 | Set the distance between tab stops. This helps the preprocessor report |
276 | correct column numbers in warnings or errors, even if tabs appear on the | |
277 | line. If the value is less than 1 or greater than 100, the option is | |
278 | ignored. The default is 8. | |
279 | ||
d77de738 | 280 | @opindex ftrack-macro-expansion |
ddf6fe37 | 281 | @item -ftrack-macro-expansion@r{[}=@var{level}@r{]} |
d77de738 ML |
282 | Track locations of tokens across macro expansions. This allows the |
283 | compiler to emit diagnostic about the current macro expansion stack | |
284 | when a compilation error occurs in a macro expansion. Using this | |
285 | option makes the preprocessor and the compiler consume more | |
286 | memory. The @var{level} parameter can be used to choose the level of | |
287 | precision of token location tracking thus decreasing the memory | |
288 | consumption if necessary. Value @samp{0} of @var{level} de-activates | |
289 | this option. Value @samp{1} tracks tokens locations in a | |
290 | degraded mode for the sake of minimal memory overhead. In this mode | |
291 | all tokens resulting from the expansion of an argument of a | |
292 | function-like macro have the same location. Value @samp{2} tracks | |
293 | tokens locations completely. This value is the most memory hungry. | |
294 | When this option is given no argument, the default parameter value is | |
295 | @samp{2}. | |
296 | ||
297 | Note that @code{-ftrack-macro-expansion=2} is activated by default. | |
298 | ||
d77de738 | 299 | @opindex fmacro-prefix-map |
ddf6fe37 | 300 | @item -fmacro-prefix-map=@var{old}=@var{new} |
d77de738 ML |
301 | When preprocessing files residing in directory @file{@var{old}}, |
302 | expand the @code{__FILE__} and @code{__BASE_FILE__} macros as if the | |
303 | files resided in directory @file{@var{new}} instead. This can be used | |
304 | to change an absolute path to a relative path by using @file{.} for | |
305 | @var{new} which can result in more reproducible builds that are | |
306 | location independent. This option also affects | |
307 | @code{__builtin_FILE()} during compilation. See also | |
2eb0191a | 308 | @option{-ffile-prefix-map} and @option{-fcanon-prefix-map}. |
d77de738 | 309 | |
d77de738 ML |
310 | @opindex fexec-charset |
311 | @cindex character set, execution | |
f33d7a88 | 312 | @item -fexec-charset=@var{charset} |
d77de738 ML |
313 | Set the execution character set, used for string and character |
314 | constants. The default is UTF-8. @var{charset} can be any encoding | |
315 | supported by the system's @code{iconv} library routine. | |
316 | ||
d77de738 ML |
317 | @opindex fwide-exec-charset |
318 | @cindex character set, wide execution | |
f33d7a88 | 319 | @item -fwide-exec-charset=@var{charset} |
d77de738 ML |
320 | Set the wide execution character set, used for wide string and |
321 | character constants. The default is one of UTF-32BE, UTF-32LE, UTF-16BE, | |
322 | or UTF-16LE, whichever corresponds to the width of @code{wchar_t} and the | |
323 | big-endian or little-endian byte order being used for code generation. As | |
324 | with @option{-fexec-charset}, @var{charset} can be any encoding supported | |
325 | by the system's @code{iconv} library routine; however, you will have | |
326 | problems with encodings that do not fit exactly in @code{wchar_t}. | |
327 | ||
d77de738 ML |
328 | @opindex finput-charset |
329 | @cindex character set, input | |
f33d7a88 | 330 | @item -finput-charset=@var{charset} |
d77de738 ML |
331 | Set the input character set, used for translation from the character |
332 | set of the input file to the source character set used by GCC@. If the | |
333 | locale does not specify, or GCC cannot get this information from the | |
334 | locale, the default is UTF-8. This can be overridden by either the locale | |
335 | or this command-line option. Currently the command-line option takes | |
336 | precedence if there's a conflict. @var{charset} can be any encoding | |
337 | supported by the system's @code{iconv} library routine. | |
338 | ||
339 | @ifclear cppmanual | |
d77de738 | 340 | @opindex fpch-deps |
ddf6fe37 | 341 | @item -fpch-deps |
d77de738 ML |
342 | When using precompiled headers (@pxref{Precompiled Headers}), this flag |
343 | causes the dependency-output flags to also list the files from the | |
344 | precompiled header's dependencies. If not specified, only the | |
345 | precompiled header are listed and not the files that were used to | |
346 | create it, because those files are not consulted when a precompiled | |
347 | header is used. | |
348 | ||
d77de738 | 349 | @opindex fpch-preprocess |
ddf6fe37 | 350 | @item -fpch-preprocess |
d77de738 ML |
351 | This option allows use of a precompiled header (@pxref{Precompiled |
352 | Headers}) together with @option{-E}. It inserts a special @code{#pragma}, | |
353 | @code{#pragma GCC pch_preprocess "@var{filename}"} in the output to mark | |
354 | the place where the precompiled header was found, and its @var{filename}. | |
355 | When @option{-fpreprocessed} is in use, GCC recognizes this @code{#pragma} | |
356 | and loads the PCH@. | |
357 | ||
358 | This option is off by default, because the resulting preprocessed output | |
359 | is only really suitable as input to GCC@. It is switched on by | |
360 | @option{-save-temps}. | |
361 | ||
362 | You should not write this @code{#pragma} in your own code, but it is | |
363 | safe to edit the filename if the PCH file is available in a different | |
364 | location. The filename may be absolute or it may be relative to GCC's | |
365 | current directory. | |
366 | @end ifclear | |
367 | ||
d77de738 ML |
368 | @opindex fworking-directory |
369 | @opindex fno-working-directory | |
ddf6fe37 | 370 | @item -fworking-directory |
d77de738 ML |
371 | Enable generation of linemarkers in the preprocessor output that |
372 | let the compiler know the current working directory at the time of | |
373 | preprocessing. When this option is enabled, the preprocessor | |
374 | emits, after the initial linemarker, a second linemarker with the | |
375 | current working directory followed by two slashes. GCC uses this | |
376 | directory, when it's present in the preprocessed input, as the | |
377 | directory emitted as the current working directory in some debugging | |
378 | information formats. This option is implicitly enabled if debugging | |
379 | information is enabled, but this can be inhibited with the negated | |
380 | form @option{-fno-working-directory}. If the @option{-P} flag is | |
381 | present in the command line, this option has no effect, since no | |
382 | @code{#line} directives are emitted whatsoever. | |
383 | ||
d77de738 | 384 | @opindex A |
ddf6fe37 | 385 | @item -A @var{predicate}=@var{answer} |
d77de738 ML |
386 | Make an assertion with the predicate @var{predicate} and answer |
387 | @var{answer}. This form is preferred to the older form @option{-A | |
388 | @var{predicate}(@var{answer})}, which is still supported, because | |
389 | it does not use shell special characters. | |
390 | @ifset cppmanual | |
391 | @xref{Obsolete Features}. | |
392 | @end ifset | |
393 | ||
394 | @item -A -@var{predicate}=@var{answer} | |
395 | Cancel an assertion with the predicate @var{predicate} and answer | |
396 | @var{answer}. | |
397 | ||
d77de738 | 398 | @opindex C |
ddf6fe37 | 399 | @item -C |
d77de738 ML |
400 | Do not discard comments. All comments are passed through to the output |
401 | file, except for comments in processed directives, which are deleted | |
402 | along with the directive. | |
403 | ||
404 | You should be prepared for side effects when using @option{-C}; it | |
405 | causes the preprocessor to treat comments as tokens in their own right. | |
406 | For example, comments appearing at the start of what would be a | |
407 | directive line have the effect of turning that line into an ordinary | |
408 | source line, since the first token on the line is no longer a @samp{#}. | |
409 | ||
d77de738 | 410 | @opindex CC |
ddf6fe37 | 411 | @item -CC |
d77de738 ML |
412 | Do not discard comments, including during macro expansion. This is |
413 | like @option{-C}, except that comments contained within macros are | |
414 | also passed through to the output file where the macro is expanded. | |
415 | ||
416 | In addition to the side effects of the @option{-C} option, the | |
417 | @option{-CC} option causes all C++-style comments inside a macro | |
418 | to be converted to C-style comments. This is to prevent later use | |
419 | of that macro from inadvertently commenting out the remainder of | |
420 | the source line. | |
421 | ||
422 | The @option{-CC} option is generally used to support lint comments. | |
423 | ||
d77de738 | 424 | @opindex P |
ddf6fe37 | 425 | @item -P |
d77de738 ML |
426 | Inhibit generation of linemarkers in the output from the preprocessor. |
427 | This might be useful when running the preprocessor on something that is | |
428 | not C code, and will be sent to a program which might be confused by the | |
429 | linemarkers. | |
430 | @ifset cppmanual | |
431 | @xref{Preprocessor Output}. | |
432 | @end ifset | |
433 | ||
434 | @cindex traditional C language | |
435 | @cindex C language, traditional | |
d77de738 ML |
436 | @opindex traditional-cpp |
437 | @opindex traditional | |
ddf6fe37 AA |
438 | @item -traditional |
439 | @itemx -traditional-cpp | |
d77de738 ML |
440 | |
441 | Try to imitate the behavior of pre-standard C preprocessors, as | |
442 | opposed to ISO C preprocessors. | |
443 | @ifset cppmanual | |
444 | @xref{Traditional Mode}. | |
445 | @end ifset | |
446 | @ifclear cppmanual | |
447 | See the GNU CPP manual for details. | |
448 | @end ifclear | |
449 | ||
450 | Note that GCC does not otherwise attempt to emulate a pre-standard | |
451 | C compiler, and these options are only supported with the @option{-E} | |
452 | switch, or when invoking CPP explicitly. | |
453 | ||
d77de738 | 454 | @opindex trigraphs |
ddf6fe37 | 455 | @item -trigraphs |
d77de738 ML |
456 | Support ISO C trigraphs. |
457 | These are three-character sequences, all starting with @samp{??}, that | |
458 | are defined by ISO C to stand for single characters. For example, | |
459 | @samp{??/} stands for @samp{\}, so @samp{'??/n'} is a character | |
460 | constant for a newline. | |
461 | @ifset cppmanual | |
462 | @xref{Initial processing}. | |
463 | @end ifset | |
464 | ||
465 | @ifclear cppmanual | |
466 | The nine trigraphs and their replacements are | |
467 | ||
468 | @smallexample | |
469 | Trigraph: ??( ??) ??< ??> ??= ??/ ??' ??! ??- | |
470 | Replacement: [ ] @{ @} # \ ^ | ~ | |
471 | @end smallexample | |
472 | @end ifclear | |
473 | ||
474 | By default, GCC ignores trigraphs, but in | |
475 | standard-conforming modes it converts them. See the @option{-std} and | |
476 | @option{-ansi} options. | |
477 | ||
d77de738 | 478 | @opindex remap |
ddf6fe37 | 479 | @item -remap |
d77de738 ML |
480 | Enable special code to work around file systems which only permit very |
481 | short file names, such as MS-DOS@. | |
482 | ||
d77de738 | 483 | @opindex H |
ddf6fe37 | 484 | @item -H |
d77de738 ML |
485 | Print the name of each header file used, in addition to other normal |
486 | activities. Each name is indented to show how deep in the | |
487 | @samp{#include} stack it is. Precompiled header files are also | |
488 | printed, even if they are found to be invalid; an invalid precompiled | |
489 | header file is printed with @samp{...x} and a valid one with @samp{...!} . | |
490 | ||
d77de738 | 491 | @opindex d |
ddf6fe37 | 492 | @item -d@var{letters} |
d77de738 ML |
493 | Says to make debugging dumps during compilation as specified by |
494 | @var{letters}. The flags documented here are those relevant to the | |
495 | preprocessor. Other @var{letters} are interpreted | |
496 | by the compiler proper, or reserved for future versions of GCC, and so | |
497 | are silently ignored. If you specify @var{letters} whose behavior | |
498 | conflicts, the result is undefined. | |
499 | @ifclear cppmanual | |
500 | @xref{Developer Options}, for more information. | |
501 | @end ifclear | |
502 | ||
503 | @table @gcctabopt | |
d77de738 | 504 | @opindex dM |
ddf6fe37 | 505 | @item -dM |
d77de738 ML |
506 | Instead of the normal output, generate a list of @samp{#define} |
507 | directives for all the macros defined during the execution of the | |
508 | preprocessor, including predefined macros. This gives you a way of | |
509 | finding out what is predefined in your version of the preprocessor. | |
510 | Assuming you have no file @file{foo.h}, the command | |
511 | ||
512 | @smallexample | |
513 | touch foo.h; cpp -dM foo.h | |
514 | @end smallexample | |
515 | ||
516 | @noindent | |
517 | shows all the predefined macros. | |
518 | ||
519 | @ifclear cppmanual | |
520 | If you use @option{-dM} without the @option{-E} option, @option{-dM} is | |
521 | interpreted as a synonym for @option{-fdump-rtl-mach}. | |
522 | @xref{Developer Options, , ,gcc}. | |
523 | @end ifclear | |
524 | ||
d77de738 | 525 | @opindex dD |
ddf6fe37 | 526 | @item -dD |
e2e4b603 | 527 | Like @option{-dM} except that it outputs @emph{both} the @samp{#define} |
d77de738 ML |
528 | directives and the result of preprocessing. Both kinds of output go to |
529 | the standard output file. | |
530 | ||
d77de738 | 531 | @opindex dN |
ddf6fe37 | 532 | @item -dN |
d77de738 ML |
533 | Like @option{-dD}, but emit only the macro names, not their expansions. |
534 | ||
d77de738 | 535 | @opindex dI |
ddf6fe37 | 536 | @item -dI |
d77de738 ML |
537 | Output @samp{#include} directives in addition to the result of |
538 | preprocessing. | |
539 | ||
d77de738 | 540 | @opindex dU |
ddf6fe37 | 541 | @item -dU |
d77de738 ML |
542 | Like @option{-dD} except that only macros that are expanded, or whose |
543 | definedness is tested in preprocessor directives, are output; the | |
544 | output is delayed until the use or test of the macro; and | |
545 | @samp{#undef} directives are also output for macros tested but | |
546 | undefined at the time. | |
547 | @end table | |
548 | ||
d77de738 | 549 | @opindex fdebug-cpp |
ddf6fe37 | 550 | @item -fdebug-cpp |
d77de738 ML |
551 | This option is only useful for debugging GCC. When used from CPP or with |
552 | @option{-E}, it dumps debugging information about location maps. Every | |
553 | token in the output is preceded by the dump of the map its location | |
554 | belongs to. | |
555 | ||
556 | When used from GCC without @option{-E}, this option has no effect. |