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