1 .\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
9 .de Vb \" Begin verbatim text
14 .de Ve \" End verbatim text
18 .\" Set up some character translations and predefined strings. \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
21 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
29 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
43 .\" Escape single quotes in literal strings from groff's Unicode transform.
47 .\" If the F register is turned on, we'll generate index entries on stderr for
48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
49 .\" entries marked with X<> in POD. Of course, you'll have to process the
50 .\" output yourself in some meaningful fashion.
53 . tm Index:\\$1\t\\n%\t"\\$2"
63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64 .\" Fear. Run. Save yourself. No user-serviceable parts.
65 . \" fudge factors for nroff and troff
74 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 . \" simple accents for nroff and troff
90 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
97 . \" troff and (daisy-wheel) nroff accents
98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105 .ds ae a\h'-(\w'a'u*4/10)'e
106 .ds Ae A\h'-(\w'A'u*4/10)'E
107 . \" corrections for vroff
108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
110 . \" for low resolution devices (crt and lpr)
111 .if \n(.H>23 .if \n(.V>19 \
124 .\" ========================================================================
127 .TH CPP 1 "2012-09-20" "gcc-4.7.2" "GNU"
128 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
129 .\" way too many mistakes in technical documents.
133 cpp \- The C Preprocessor
135 .IX Header "SYNOPSIS"
136 cpp [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
137 [\fB\-I\fR\fIdir\fR...] [\fB\-iquote\fR\fIdir\fR...]
138 [\fB\-W\fR\fIwarn\fR...]
139 [\fB\-M\fR|\fB\-MM\fR] [\fB\-MG\fR] [\fB\-MF\fR \fIfilename\fR]
140 [\fB\-MP\fR] [\fB\-MQ\fR \fItarget\fR...]
141 [\fB\-MT\fR \fItarget\fR...]
142 [\fB\-P\fR] [\fB\-fno\-working\-directory\fR]
143 [\fB\-x\fR \fIlanguage\fR] [\fB\-std=\fR\fIstandard\fR]
144 \fIinfile\fR \fIoutfile\fR
146 Only the most useful options are listed here; see below for the remainder.
148 .IX Header "DESCRIPTION"
149 The C preprocessor, often known as \fIcpp\fR, is a \fImacro processor\fR
150 that is used automatically by the C compiler to transform your program
151 before compilation. It is called a macro processor because it allows
152 you to define \fImacros\fR, which are brief abbreviations for longer
155 The C preprocessor is intended to be used only with C, \*(C+, and
156 Objective-C source code. In the past, it has been abused as a general
157 text processor. It will choke on input which does not obey C's lexical
158 rules. For example, apostrophes will be interpreted as the beginning of
159 character constants, and cause errors. Also, you cannot rely on it
160 preserving characteristics of the input which are not significant to
161 C\-family languages. If a Makefile is preprocessed, all the hard tabs
162 will be removed, and the Makefile will not work.
164 Having said that, you can often get away with using cpp on things which
165 are not C. Other Algol-ish programming languages are often safe
166 (Pascal, Ada, etc.) So is assembly, with caution. \fB\-traditional\-cpp\fR
167 mode preserves more white space, and is otherwise more permissive. Many
168 of the problems can be avoided by writing C or \*(C+ style comments
169 instead of native language comments, and keeping macros simple.
171 Wherever possible, you should use a preprocessor geared to the language
172 you are writing in. Modern versions of the \s-1GNU\s0 assembler have macro
173 facilities. Most high level programming languages have their own
174 conditional compilation and inclusion mechanism. If all else fails,
175 try a true general text processor, such as \s-1GNU\s0 M4.
177 C preprocessors vary in some details. This manual discusses the \s-1GNU\s0 C
178 preprocessor, which provides a small superset of the features of \s-1ISO\s0
179 Standard C. In its default mode, the \s-1GNU\s0 C preprocessor does not do a
180 few things required by the standard. These are features which are
181 rarely, if ever, used, and may cause surprising changes to the meaning
182 of a program which does not expect them. To get strict \s-1ISO\s0 Standard C,
183 you should use the \fB\-std=c90\fR, \fB\-std=c99\fR or
184 \&\fB\-std=c11\fR options, depending
185 on which version of the standard you want. To get all the mandatory
186 diagnostics, you must also use \fB\-pedantic\fR.
188 This manual describes the behavior of the \s-1ISO\s0 preprocessor. To
189 minimize gratuitous differences, where the \s-1ISO\s0 preprocessor's
190 behavior does not conflict with traditional semantics, the
191 traditional preprocessor should behave the same way. The various
192 differences that do exist are detailed in the section \fBTraditional
195 For clarity, unless noted otherwise, references to \fB\s-1CPP\s0\fR in this
196 manual refer to \s-1GNU\s0 \s-1CPP\s0.
199 The C preprocessor expects two file names as arguments, \fIinfile\fR and
200 \&\fIoutfile\fR. The preprocessor reads \fIinfile\fR together with any
201 other files it specifies with \fB#include\fR. All the output generated
202 by the combined input files is written in \fIoutfile\fR.
204 Either \fIinfile\fR or \fIoutfile\fR may be \fB\-\fR, which as
205 \&\fIinfile\fR means to read from standard input and as \fIoutfile\fR
206 means to write to standard output. Also, if either file is omitted, it
207 means the same as if \fB\-\fR had been specified for that file.
209 Unless otherwise noted, or the option ends in \fB=\fR, all options
210 which take an argument may have that argument appear either immediately
211 after the option, or with a space between option and argument:
212 \&\fB\-Ifoo\fR and \fB\-I foo\fR have the same effect.
214 Many options have multi-letter names; therefore multiple single-letter
215 options may \fInot\fR be grouped: \fB\-dM\fR is very different from
217 .IP "\fB\-D\fR \fIname\fR" 4
219 Predefine \fIname\fR as a macro, with definition \f(CW1\fR.
220 .IP "\fB\-D\fR \fIname\fR\fB=\fR\fIdefinition\fR" 4
221 .IX Item "-D name=definition"
222 The contents of \fIdefinition\fR are tokenized and processed as if
223 they appeared during translation phase three in a \fB#define\fR
224 directive. In particular, the definition will be truncated by
225 embedded newline characters.
227 If you are invoking the preprocessor from a shell or shell-like
228 program you may need to use the shell's quoting syntax to protect
229 characters such as spaces that have a meaning in the shell syntax.
231 If you wish to define a function-like macro on the command line, write
232 its argument list with surrounding parentheses before the equals sign
233 (if any). Parentheses are meaningful to most shells, so you will need
234 to quote the option. With \fBsh\fR and \fBcsh\fR,
235 \&\fB\-D'\fR\fIname\fR\fB(\fR\fIargs...\fR\fB)=\fR\fIdefinition\fR\fB'\fR works.
237 \&\fB\-D\fR and \fB\-U\fR options are processed in the order they
238 are given on the command line. All \fB\-imacros\fR \fIfile\fR and
239 \&\fB\-include\fR \fIfile\fR options are processed after all
240 \&\fB\-D\fR and \fB\-U\fR options.
241 .IP "\fB\-U\fR \fIname\fR" 4
243 Cancel any previous definition of \fIname\fR, either built in or
244 provided with a \fB\-D\fR option.
245 .IP "\fB\-undef\fR" 4
247 Do not predefine any system-specific or GCC-specific macros. The
248 standard predefined macros remain defined.
249 .IP "\fB\-I\fR \fIdir\fR" 4
251 Add the directory \fIdir\fR to the list of directories to be searched
254 Directories named by \fB\-I\fR are searched before the standard
255 system include directories. If the directory \fIdir\fR is a standard
256 system include directory, the option is ignored to ensure that the
257 default search order for system directories and the special treatment
258 of system headers are not defeated
260 If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
261 by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
262 .IP "\fB\-o\fR \fIfile\fR" 4
264 Write output to \fIfile\fR. This is the same as specifying \fIfile\fR
265 as the second non-option argument to \fBcpp\fR. \fBgcc\fR has a
266 different interpretation of a second non-option argument, so you must
267 use \fB\-o\fR to specify the output file.
270 Turns on all optional warnings which are desirable for normal code.
271 At present this is \fB\-Wcomment\fR, \fB\-Wtrigraphs\fR,
272 \&\fB\-Wmultichar\fR and a warning about integer promotion causing a
273 change of sign in \f(CW\*(C`#if\*(C'\fR expressions. Note that many of the
274 preprocessor's warnings are on by default and have no options to
276 .IP "\fB\-Wcomment\fR" 4
279 .IP "\fB\-Wcomments\fR" 4
280 .IX Item "-Wcomments"
282 Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
283 comment, or whenever a backslash-newline appears in a \fB//\fR comment.
284 (Both forms have the same effect.)
285 .IP "\fB\-Wtrigraphs\fR" 4
286 .IX Item "-Wtrigraphs"
287 Most trigraphs in comments cannot affect the meaning of the program.
288 However, a trigraph that would form an escaped newline (\fB??/\fR at
289 the end of a line) can, by changing where the comment begins or ends.
290 Therefore, only trigraphs that would form escaped newlines produce
291 warnings inside a comment.
293 This option is implied by \fB\-Wall\fR. If \fB\-Wall\fR is not
294 given, this option is still enabled unless trigraphs are enabled. To
295 get trigraph conversion without warnings, but get the other
296 \&\fB\-Wall\fR warnings, use \fB\-trigraphs \-Wall \-Wno\-trigraphs\fR.
297 .IP "\fB\-Wtraditional\fR" 4
298 .IX Item "-Wtraditional"
299 Warn about certain constructs that behave differently in traditional and
300 \&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C
301 equivalent, and problematic constructs which should be avoided.
302 .IP "\fB\-Wundef\fR" 4
304 Warn whenever an identifier which is not a macro is encountered in an
305 \&\fB#if\fR directive, outside of \fBdefined\fR. Such identifiers are
307 .IP "\fB\-Wunused\-macros\fR" 4
308 .IX Item "-Wunused-macros"
309 Warn about macros defined in the main file that are unused. A macro
310 is \fIused\fR if it is expanded or tested for existence at least once.
311 The preprocessor will also warn if the macro has not been used at the
312 time it is redefined or undefined.
314 Built-in macros, macros defined on the command line, and macros
315 defined in include files are not warned about.
317 \&\fINote:\fR If a macro is actually used, but only used in skipped
318 conditional blocks, then \s-1CPP\s0 will report it as unused. To avoid the
319 warning in such a case, you might improve the scope of the macro's
320 definition by, for example, moving it into the first skipped block.
321 Alternatively, you could provide a dummy use with something like:
324 \& #if defined the_macro_causing_the_warning
327 .IP "\fB\-Wendif\-labels\fR" 4
328 .IX Item "-Wendif-labels"
329 Warn whenever an \fB#else\fR or an \fB#endif\fR are followed by text.
330 This usually happens in code of the form
340 The second and third \f(CW\*(C`FOO\*(C'\fR should be in comments, but often are not
341 in older programs. This warning is on by default.
342 .IP "\fB\-Werror\fR" 4
344 Make all warnings into hard errors. Source code which triggers warnings
346 .IP "\fB\-Wsystem\-headers\fR" 4
347 .IX Item "-Wsystem-headers"
348 Issue warnings for code in system headers. These are normally unhelpful
349 in finding bugs in your own code, therefore suppressed. If you are
350 responsible for the system library, you may want to see them.
353 Suppress all warnings, including those which \s-1GNU\s0 \s-1CPP\s0 issues by default.
354 .IP "\fB\-pedantic\fR" 4
356 Issue all the mandatory diagnostics listed in the C standard. Some of
357 them are left out by default, since they trigger frequently on harmless
359 .IP "\fB\-pedantic\-errors\fR" 4
360 .IX Item "-pedantic-errors"
361 Issue all the mandatory diagnostics, and make all mandatory diagnostics
362 into errors. This includes mandatory diagnostics that \s-1GCC\s0 issues
363 without \fB\-pedantic\fR but treats as warnings.
366 Instead of outputting the result of preprocessing, output a rule
367 suitable for \fBmake\fR describing the dependencies of the main
368 source file. The preprocessor outputs one \fBmake\fR rule containing
369 the object file name for that source file, a colon, and the names of all
370 the included files, including those coming from \fB\-include\fR or
371 \&\fB\-imacros\fR command line options.
373 Unless specified explicitly (with \fB\-MT\fR or \fB\-MQ\fR), the
374 object file name consists of the name of the source file with any
375 suffix replaced with object file suffix and with any leading directory
376 parts removed. If there are many included files then the rule is
377 split into several lines using \fB\e\fR\-newline. The rule has no
380 This option does not suppress the preprocessor's debug output, such as
381 \&\fB\-dM\fR. To avoid mixing such debug output with the dependency
382 rules you should explicitly specify the dependency output file with
383 \&\fB\-MF\fR, or use an environment variable like
384 \&\fB\s-1DEPENDENCIES_OUTPUT\s0\fR. Debug output
385 will still be sent to the regular output stream as normal.
387 Passing \fB\-M\fR to the driver implies \fB\-E\fR, and suppresses
388 warnings with an implicit \fB\-w\fR.
391 Like \fB\-M\fR but do not mention header files that are found in
392 system header directories, nor header files that are included,
393 directly or indirectly, from such a header.
395 This implies that the choice of angle brackets or double quotes in an
396 \&\fB#include\fR directive does not in itself determine whether that
397 header will appear in \fB\-MM\fR dependency output. This is a
398 slight change in semantics from \s-1GCC\s0 versions 3.0 and earlier.
399 .IP "\fB\-MF\fR \fIfile\fR" 4
401 When used with \fB\-M\fR or \fB\-MM\fR, specifies a
402 file to write the dependencies to. If no \fB\-MF\fR switch is given
403 the preprocessor sends the rules to the same place it would have sent
406 When used with the driver options \fB\-MD\fR or \fB\-MMD\fR,
407 \&\fB\-MF\fR overrides the default dependency output file.
410 In conjunction with an option such as \fB\-M\fR requesting
411 dependency generation, \fB\-MG\fR assumes missing header files are
412 generated files and adds them to the dependency list without raising
413 an error. The dependency filename is taken directly from the
414 \&\f(CW\*(C`#include\*(C'\fR directive without prepending any path. \fB\-MG\fR
415 also suppresses preprocessed output, as a missing header file renders
418 This feature is used in automatic updating of makefiles.
421 This option instructs \s-1CPP\s0 to add a phony target for each dependency
422 other than the main file, causing each to depend on nothing. These
423 dummy rules work around errors \fBmake\fR gives if you remove header
424 files without updating the \fIMakefile\fR to match.
426 This is typical output:
429 \& test.o: test.c test.h
433 .IP "\fB\-MT\fR \fItarget\fR" 4
434 .IX Item "-MT target"
435 Change the target of the rule emitted by dependency generation. By
436 default \s-1CPP\s0 takes the name of the main input file, deletes any
437 directory components and any file suffix such as \fB.c\fR, and
438 appends the platform's usual object suffix. The result is the target.
440 An \fB\-MT\fR option will set the target to be exactly the string you
441 specify. If you want multiple targets, you can specify them as a single
442 argument to \fB\-MT\fR, or use multiple \fB\-MT\fR options.
444 For example, \fB\-MT\ '$(objpfx)foo.o'\fR might give
447 \& $(objpfx)foo.o: foo.c
449 .IP "\fB\-MQ\fR \fItarget\fR" 4
450 .IX Item "-MQ target"
451 Same as \fB\-MT\fR, but it quotes any characters which are special to
452 Make. \fB\-MQ\ '$(objpfx)foo.o'\fR gives
455 \& $$(objpfx)foo.o: foo.c
458 The default target is automatically quoted, as if it were given with
462 \&\fB\-MD\fR is equivalent to \fB\-M \-MF\fR \fIfile\fR, except that
463 \&\fB\-E\fR is not implied. The driver determines \fIfile\fR based on
464 whether an \fB\-o\fR option is given. If it is, the driver uses its
465 argument but with a suffix of \fI.d\fR, otherwise it takes the name
466 of the input file, removes any directory components and suffix, and
467 applies a \fI.d\fR suffix.
469 If \fB\-MD\fR is used in conjunction with \fB\-E\fR, any
470 \&\fB\-o\fR switch is understood to specify the dependency output file, but if used without \fB\-E\fR, each \fB\-o\fR
471 is understood to specify a target object file.
473 Since \fB\-E\fR is not implied, \fB\-MD\fR can be used to generate
474 a dependency output file as a side-effect of the compilation process.
477 Like \fB\-MD\fR except mention only user header files, not system
482 .IP "\fB\-x c++\fR" 4
484 .IP "\fB\-x objective-c\fR" 4
485 .IX Item "-x objective-c"
486 .IP "\fB\-x assembler-with-cpp\fR" 4
487 .IX Item "-x assembler-with-cpp"
489 Specify the source language: C, \*(C+, Objective-C, or assembly. This has
490 nothing to do with standards conformance or extensions; it merely
491 selects which base syntax to expect. If you give none of these options,
492 cpp will deduce the language from the extension of the source file:
493 \&\fB.c\fR, \fB.cc\fR, \fB.m\fR, or \fB.S\fR. Some other common
494 extensions for \*(C+ and assembly are also recognized. If cpp does not
495 recognize the extension, it will treat the file as C; this is the most
498 \&\fINote:\fR Previous versions of cpp accepted a \fB\-lang\fR option
499 which selected both the language and the standards conformance level.
500 This option has been removed, because it conflicts with the \fB\-l\fR
502 .IP "\fB\-std=\fR\fIstandard\fR" 4
503 .IX Item "-std=standard"
508 Specify the standard to which the code should conform. Currently \s-1CPP\s0
509 knows about C and \*(C+ standards; others may be added in the future.
514 .ie n .IP """c90""" 4
515 .el .IP "\f(CWc90\fR" 4
518 .ie n .IP """c89""" 4
519 .el .IP "\f(CWc89\fR" 4
521 .ie n .IP """iso9899:1990""" 4
522 .el .IP "\f(CWiso9899:1990\fR" 4
523 .IX Item "iso9899:1990"
525 The \s-1ISO\s0 C standard from 1990. \fBc90\fR is the customary shorthand for
526 this version of the standard.
528 The \fB\-ansi\fR option is equivalent to \fB\-std=c90\fR.
529 .ie n .IP """iso9899:199409""" 4
530 .el .IP "\f(CWiso9899:199409\fR" 4
531 .IX Item "iso9899:199409"
532 The 1990 C standard, as amended in 1994.
533 .ie n .IP """iso9899:1999""" 4
534 .el .IP "\f(CWiso9899:1999\fR" 4
535 .IX Item "iso9899:1999"
537 .ie n .IP """c99""" 4
538 .el .IP "\f(CWc99\fR" 4
540 .ie n .IP """iso9899:199x""" 4
541 .el .IP "\f(CWiso9899:199x\fR" 4
542 .IX Item "iso9899:199x"
543 .ie n .IP """c9x""" 4
544 .el .IP "\f(CWc9x\fR" 4
547 The revised \s-1ISO\s0 C standard, published in December 1999. Before
548 publication, this was known as C9X.
549 .ie n .IP """iso9899:2011""" 4
550 .el .IP "\f(CWiso9899:2011\fR" 4
551 .IX Item "iso9899:2011"
553 .ie n .IP """c11""" 4
554 .el .IP "\f(CWc11\fR" 4
556 .ie n .IP """c1x""" 4
557 .el .IP "\f(CWc1x\fR" 4
560 The revised \s-1ISO\s0 C standard, published in December 2011. Before
561 publication, this was known as C1X.
562 .ie n .IP """gnu90""" 4
563 .el .IP "\f(CWgnu90\fR" 4
566 .ie n .IP """gnu89""" 4
567 .el .IP "\f(CWgnu89\fR" 4
570 The 1990 C standard plus \s-1GNU\s0 extensions. This is the default.
571 .ie n .IP """gnu99""" 4
572 .el .IP "\f(CWgnu99\fR" 4
575 .ie n .IP """gnu9x""" 4
576 .el .IP "\f(CWgnu9x\fR" 4
579 The 1999 C standard plus \s-1GNU\s0 extensions.
580 .ie n .IP """gnu11""" 4
581 .el .IP "\f(CWgnu11\fR" 4
584 .ie n .IP """gnu1x""" 4
585 .el .IP "\f(CWgnu1x\fR" 4
588 The 2011 C standard plus \s-1GNU\s0 extensions.
589 .ie n .IP """c++98""" 4
590 .el .IP "\f(CWc++98\fR" 4
592 The 1998 \s-1ISO\s0 \*(C+ standard plus amendments.
593 .ie n .IP """gnu++98""" 4
594 .el .IP "\f(CWgnu++98\fR" 4
596 The same as \fB\-std=c++98\fR plus \s-1GNU\s0 extensions. This is the
597 default for \*(C+ code.
603 Split the include path. Any directories specified with \fB\-I\fR
604 options before \fB\-I\-\fR are searched only for headers requested with
605 \&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for
606 \&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR. If additional directories are
607 specified with \fB\-I\fR options after the \fB\-I\-\fR, those
608 directories are searched for all \fB#include\fR directives.
610 In addition, \fB\-I\-\fR inhibits the use of the directory of the current
611 file directory as the first search directory for \f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR.
613 This option has been deprecated.
614 .IP "\fB\-nostdinc\fR" 4
616 Do not search the standard system directories for header files.
617 Only the directories you have specified with \fB\-I\fR options
618 (and the directory of the current file, if appropriate) are searched.
619 .IP "\fB\-nostdinc++\fR" 4
620 .IX Item "-nostdinc++"
621 Do not search for header files in the \*(C+\-specific standard directories,
622 but do still search the other standard directories. (This option is
623 used when building the \*(C+ library.)
624 .IP "\fB\-include\fR \fIfile\fR" 4
625 .IX Item "-include file"
626 Process \fIfile\fR as if \f(CW\*(C`#include "file"\*(C'\fR appeared as the first
627 line of the primary source file. However, the first directory searched
628 for \fIfile\fR is the preprocessor's working directory \fIinstead of\fR
629 the directory containing the main source file. If not found there, it
630 is searched for in the remainder of the \f(CW\*(C`#include "..."\*(C'\fR search
633 If multiple \fB\-include\fR options are given, the files are included
634 in the order they appear on the command line.
635 .IP "\fB\-imacros\fR \fIfile\fR" 4
636 .IX Item "-imacros file"
637 Exactly like \fB\-include\fR, except that any output produced by
638 scanning \fIfile\fR is thrown away. Macros it defines remain defined.
639 This allows you to acquire all the macros from a header without also
640 processing its declarations.
642 All files specified by \fB\-imacros\fR are processed before all files
643 specified by \fB\-include\fR.
644 .IP "\fB\-idirafter\fR \fIdir\fR" 4
645 .IX Item "-idirafter dir"
646 Search \fIdir\fR for header files, but do it \fIafter\fR all
647 directories specified with \fB\-I\fR and the standard system directories
648 have been exhausted. \fIdir\fR is treated as a system include directory.
649 If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
650 by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
651 .IP "\fB\-iprefix\fR \fIprefix\fR" 4
652 .IX Item "-iprefix prefix"
653 Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
654 options. If the prefix represents a directory, you should include the
656 .IP "\fB\-iwithprefix\fR \fIdir\fR" 4
657 .IX Item "-iwithprefix dir"
659 .IP "\fB\-iwithprefixbefore\fR \fIdir\fR" 4
660 .IX Item "-iwithprefixbefore dir"
662 Append \fIdir\fR to the prefix specified previously with
663 \&\fB\-iprefix\fR, and add the resulting directory to the include search
664 path. \fB\-iwithprefixbefore\fR puts it in the same place \fB\-I\fR
665 would; \fB\-iwithprefix\fR puts it where \fB\-idirafter\fR would.
666 .IP "\fB\-isysroot\fR \fIdir\fR" 4
667 .IX Item "-isysroot dir"
668 This option is like the \fB\-\-sysroot\fR option, but applies only to
669 header files (except for Darwin targets, where it applies to both header
670 files and libraries). See the \fB\-\-sysroot\fR option for more
672 .IP "\fB\-imultilib\fR \fIdir\fR" 4
673 .IX Item "-imultilib dir"
674 Use \fIdir\fR as a subdirectory of the directory containing
675 target-specific \*(C+ headers.
676 .IP "\fB\-isystem\fR \fIdir\fR" 4
677 .IX Item "-isystem dir"
678 Search \fIdir\fR for header files, after all directories specified by
679 \&\fB\-I\fR but before the standard system directories. Mark it
680 as a system directory, so that it gets the same special treatment as
681 is applied to the standard system directories.
683 If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
684 by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
685 .IP "\fB\-iquote\fR \fIdir\fR" 4
686 .IX Item "-iquote dir"
687 Search \fIdir\fR only for header files requested with
688 \&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for
689 \&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR, before all directories specified by
690 \&\fB\-I\fR and before the standard system directories.
692 If \fIdir\fR begins with \f(CW\*(C`=\*(C'\fR, then the \f(CW\*(C`=\*(C'\fR will be replaced
693 by the sysroot prefix; see \fB\-\-sysroot\fR and \fB\-isysroot\fR.
694 .IP "\fB\-fdirectives\-only\fR" 4
695 .IX Item "-fdirectives-only"
696 When preprocessing, handle directives, but do not expand macros.
698 The option's behavior depends on the \fB\-E\fR and \fB\-fpreprocessed\fR
701 With \fB\-E\fR, preprocessing is limited to the handling of directives
702 such as \f(CW\*(C`#define\*(C'\fR, \f(CW\*(C`#ifdef\*(C'\fR, and \f(CW\*(C`#error\*(C'\fR. Other
703 preprocessor operations, such as macro expansion and trigraph
704 conversion are not performed. In addition, the \fB\-dD\fR option is
707 With \fB\-fpreprocessed\fR, predefinition of command line and most
708 builtin macros is disabled. Macros such as \f(CW\*(C`_\|_LINE_\|_\*(C'\fR, which are
709 contextually dependent, are handled normally. This enables compilation of
710 files previously preprocessed with \f(CW\*(C`\-E \-fdirectives\-only\*(C'\fR.
712 With both \fB\-E\fR and \fB\-fpreprocessed\fR, the rules for
713 \&\fB\-fpreprocessed\fR take precedence. This enables full preprocessing of
714 files previously preprocessed with \f(CW\*(C`\-E \-fdirectives\-only\*(C'\fR.
715 .IP "\fB\-fdollars\-in\-identifiers\fR" 4
716 .IX Item "-fdollars-in-identifiers"
717 Accept \fB$\fR in identifiers.
718 .IP "\fB\-fextended\-identifiers\fR" 4
719 .IX Item "-fextended-identifiers"
720 Accept universal character names in identifiers. This option is
721 experimental; in a future version of \s-1GCC\s0, it will be enabled by
722 default for C99 and \*(C+.
723 .IP "\fB\-fpreprocessed\fR" 4
724 .IX Item "-fpreprocessed"
725 Indicate to the preprocessor that the input file has already been
726 preprocessed. This suppresses things like macro expansion, trigraph
727 conversion, escaped newline splicing, and processing of most directives.
728 The preprocessor still recognizes and removes comments, so that you can
729 pass a file preprocessed with \fB\-C\fR to the compiler without
730 problems. In this mode the integrated preprocessor is little more than
731 a tokenizer for the front ends.
733 \&\fB\-fpreprocessed\fR is implicit if the input file has one of the
734 extensions \fB.i\fR, \fB.ii\fR or \fB.mi\fR. These are the
735 extensions that \s-1GCC\s0 uses for preprocessed files created by
736 \&\fB\-save\-temps\fR.
737 .IP "\fB\-ftabstop=\fR\fIwidth\fR" 4
738 .IX Item "-ftabstop=width"
739 Set the distance between tab stops. This helps the preprocessor report
740 correct column numbers in warnings or errors, even if tabs appear on the
741 line. If the value is less than 1 or greater than 100, the option is
742 ignored. The default is 8.
743 .IP "\fB\-fdebug\-cpp\fR" 4
744 .IX Item "-fdebug-cpp"
745 This option is only useful for debugging \s-1GCC\s0. When used with
746 \&\fB\-E\fR, dumps debugging information about location maps. Every
747 token in the output is preceded by the dump of the map its location
748 belongs to. The dump of the map holding the location of a token would
752 \& {"P":F</file/path>;"F":F</includer/path>;"L":<line_num>;"C":<col_num>;"S":<system_header_p>;"M":<map_address>;"E":<macro_expansion_p>,"loc":<location>}
755 When used without \fB\-E\fR, this option has no effect.
756 .IP "\fB\-ftrack\-macro\-expansion\fR[\fB=\fR\fIlevel\fR]" 4
757 .IX Item "-ftrack-macro-expansion[=level]"
758 Track locations of tokens across macro expansions. This allows the
759 compiler to emit diagnostic about the current macro expansion stack
760 when a compilation error occurs in a macro expansion. Using this
761 option makes the preprocessor and the compiler consume more
762 memory. The \fIlevel\fR parameter can be used to choose the level of
763 precision of token location tracking thus decreasing the memory
764 consumption if necessary. Value \fB0\fR of \fIlevel\fR de-activates
765 this option just as if no \fB\-ftrack\-macro\-expansion\fR was present
766 on the command line. Value \fB1\fR tracks tokens locations in a
767 degraded mode for the sake of minimal memory overhead. In this mode
768 all tokens resulting from the expansion of an argument of a
769 function-like macro have the same location. Value \fB2\fR tracks
770 tokens locations completely. This value is the most memory hungry.
771 When this option is given no argument, the default parameter value is
773 .IP "\fB\-fexec\-charset=\fR\fIcharset\fR" 4
774 .IX Item "-fexec-charset=charset"
775 Set the execution character set, used for string and character
776 constants. The default is \s-1UTF\-8\s0. \fIcharset\fR can be any encoding
777 supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine.
778 .IP "\fB\-fwide\-exec\-charset=\fR\fIcharset\fR" 4
779 .IX Item "-fwide-exec-charset=charset"
780 Set the wide execution character set, used for wide string and
781 character constants. The default is \s-1UTF\-32\s0 or \s-1UTF\-16\s0, whichever
782 corresponds to the width of \f(CW\*(C`wchar_t\*(C'\fR. As with
783 \&\fB\-fexec\-charset\fR, \fIcharset\fR can be any encoding supported
784 by the system's \f(CW\*(C`iconv\*(C'\fR library routine; however, you will have
785 problems with encodings that do not fit exactly in \f(CW\*(C`wchar_t\*(C'\fR.
786 .IP "\fB\-finput\-charset=\fR\fIcharset\fR" 4
787 .IX Item "-finput-charset=charset"
788 Set the input character set, used for translation from the character
789 set of the input file to the source character set used by \s-1GCC\s0. If the
790 locale does not specify, or \s-1GCC\s0 cannot get this information from the
791 locale, the default is \s-1UTF\-8\s0. This can be overridden by either the locale
792 or this command line option. Currently the command line option takes
793 precedence if there's a conflict. \fIcharset\fR can be any encoding
794 supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine.
795 .IP "\fB\-fworking\-directory\fR" 4
796 .IX Item "-fworking-directory"
797 Enable generation of linemarkers in the preprocessor output that will
798 let the compiler know the current working directory at the time of
799 preprocessing. When this option is enabled, the preprocessor will
800 emit, after the initial linemarker, a second linemarker with the
801 current working directory followed by two slashes. \s-1GCC\s0 will use this
802 directory, when it's present in the preprocessed input, as the
803 directory emitted as the current working directory in some debugging
804 information formats. This option is implicitly enabled if debugging
805 information is enabled, but this can be inhibited with the negated
806 form \fB\-fno\-working\-directory\fR. If the \fB\-P\fR flag is
807 present in the command line, this option has no effect, since no
808 \&\f(CW\*(C`#line\*(C'\fR directives are emitted whatsoever.
809 .IP "\fB\-fno\-show\-column\fR" 4
810 .IX Item "-fno-show-column"
811 Do not print column numbers in diagnostics. This may be necessary if
812 diagnostics are being scanned by a program that does not understand the
813 column numbers, such as \fBdejagnu\fR.
814 .IP "\fB\-A\fR \fIpredicate\fR\fB=\fR\fIanswer\fR" 4
815 .IX Item "-A predicate=answer"
816 Make an assertion with the predicate \fIpredicate\fR and answer
817 \&\fIanswer\fR. This form is preferred to the older form \fB\-A\fR
818 \&\fIpredicate\fR\fB(\fR\fIanswer\fR\fB)\fR, which is still supported, because
819 it does not use shell special characters.
820 .IP "\fB\-A \-\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4
821 .IX Item "-A -predicate=answer"
822 Cancel an assertion with the predicate \fIpredicate\fR and answer
824 .IP "\fB\-dCHARS\fR" 4
826 \&\fI\s-1CHARS\s0\fR is a sequence of one or more of the following characters,
827 and must not be preceded by a space. Other characters are interpreted
828 by the compiler proper, or reserved for future versions of \s-1GCC\s0, and so
829 are silently ignored. If you specify characters whose behavior
830 conflicts, the result is undefined.
834 Instead of the normal output, generate a list of \fB#define\fR
835 directives for all the macros defined during the execution of the
836 preprocessor, including predefined macros. This gives you a way of
837 finding out what is predefined in your version of the preprocessor.
838 Assuming you have no file \fIfoo.h\fR, the command
841 \& touch foo.h; cpp \-dM foo.h
844 will show all the predefined macros.
846 If you use \fB\-dM\fR without the \fB\-E\fR option, \fB\-dM\fR is
847 interpreted as a synonym for \fB\-fdump\-rtl\-mach\fR.
850 Like \fBM\fR except in two respects: it does \fInot\fR include the
851 predefined macros, and it outputs \fIboth\fR the \fB#define\fR
852 directives and the result of preprocessing. Both kinds of output go to
853 the standard output file.
856 Like \fBD\fR, but emit only the macro names, not their expansions.
859 Output \fB#include\fR directives in addition to the result of
863 Like \fBD\fR except that only macros that are expanded, or whose
864 definedness is tested in preprocessor directives, are output; the
865 output is delayed until the use or test of the macro; and
866 \&\fB#undef\fR directives are also output for macros tested but
867 undefined at the time.
873 Inhibit generation of linemarkers in the output from the preprocessor.
874 This might be useful when running the preprocessor on something that is
875 not C code, and will be sent to a program which might be confused by the
879 Do not discard comments. All comments are passed through to the output
880 file, except for comments in processed directives, which are deleted
881 along with the directive.
883 You should be prepared for side effects when using \fB\-C\fR; it
884 causes the preprocessor to treat comments as tokens in their own right.
885 For example, comments appearing at the start of what would be a
886 directive line have the effect of turning that line into an ordinary
887 source line, since the first token on the line is no longer a \fB#\fR.
890 Do not discard comments, including during macro expansion. This is
891 like \fB\-C\fR, except that comments contained within macros are
892 also passed through to the output file where the macro is expanded.
894 In addition to the side-effects of the \fB\-C\fR option, the
895 \&\fB\-CC\fR option causes all \*(C+\-style comments inside a macro
896 to be converted to C\-style comments. This is to prevent later use
897 of that macro from inadvertently commenting out the remainder of
900 The \fB\-CC\fR option is generally used to support lint comments.
901 .IP "\fB\-traditional\-cpp\fR" 4
902 .IX Item "-traditional-cpp"
903 Try to imitate the behavior of old-fashioned C preprocessors, as
904 opposed to \s-1ISO\s0 C preprocessors.
905 .IP "\fB\-trigraphs\fR" 4
906 .IX Item "-trigraphs"
907 Process trigraph sequences.
908 .IP "\fB\-remap\fR" 4
910 Enable special code to work around file systems which only permit very
911 short file names, such as MS-DOS.
912 .IP "\fB\-\-help\fR" 4
915 .IP "\fB\-\-target\-help\fR" 4
916 .IX Item "--target-help"
918 Print text describing all the command line options instead of
919 preprocessing anything.
922 Verbose mode. Print out \s-1GNU\s0 \s-1CPP\s0's version number at the beginning of
923 execution, and report the final form of the include path.
926 Print the name of each header file used, in addition to other normal
927 activities. Each name is indented to show how deep in the
928 \&\fB#include\fR stack it is. Precompiled header files are also
929 printed, even if they are found to be invalid; an invalid precompiled
930 header file is printed with \fB...x\fR and a valid one with \fB...!\fR .
931 .IP "\fB\-version\fR" 4
934 .IP "\fB\-\-version\fR" 4
937 Print out \s-1GNU\s0 \s-1CPP\s0's version number. With one dash, proceed to
938 preprocess as normal. With two dashes, exit immediately.
940 .IX Header "ENVIRONMENT"
941 This section describes the environment variables that affect how \s-1CPP\s0
942 operates. You can use them to specify directories or prefixes to use
943 when searching for include files, or to control dependency output.
945 Note that you can also specify places to search using options such as
946 \&\fB\-I\fR, and control dependency output with options like
947 \&\fB\-M\fR. These take precedence over
948 environment variables, which in turn take precedence over the
949 configuration of \s-1GCC\s0.
950 .IP "\fB\s-1CPATH\s0\fR" 4
953 .IP "\fBC_INCLUDE_PATH\fR" 4
954 .IX Item "C_INCLUDE_PATH"
955 .IP "\fB\s-1CPLUS_INCLUDE_PATH\s0\fR" 4
956 .IX Item "CPLUS_INCLUDE_PATH"
957 .IP "\fB\s-1OBJC_INCLUDE_PATH\s0\fR" 4
958 .IX Item "OBJC_INCLUDE_PATH"
960 Each variable's value is a list of directories separated by a special
961 character, much like \fB\s-1PATH\s0\fR, in which to look for header files.
962 The special character, \f(CW\*(C`PATH_SEPARATOR\*(C'\fR, is target-dependent and
963 determined at \s-1GCC\s0 build time. For Microsoft Windows-based targets it is a
964 semicolon, and for almost all other targets it is a colon.
966 \&\fB\s-1CPATH\s0\fR specifies a list of directories to be searched as if
967 specified with \fB\-I\fR, but after any paths given with \fB\-I\fR
968 options on the command line. This environment variable is used
969 regardless of which language is being preprocessed.
971 The remaining environment variables apply only when preprocessing the
972 particular language indicated. Each specifies a list of directories
973 to be searched as if specified with \fB\-isystem\fR, but after any
974 paths given with \fB\-isystem\fR options on the command line.
976 In all these variables, an empty element instructs the compiler to
977 search its current working directory. Empty elements can appear at the
978 beginning or end of a path. For instance, if the value of
979 \&\fB\s-1CPATH\s0\fR is \f(CW\*(C`:/special/include\*(C'\fR, that has the same
980 effect as \fB\-I.\ \-I/special/include\fR.
981 .IP "\fB\s-1DEPENDENCIES_OUTPUT\s0\fR" 4
982 .IX Item "DEPENDENCIES_OUTPUT"
983 If this variable is set, its value specifies how to output
984 dependencies for Make based on the non-system header files processed
985 by the compiler. System header files are ignored in the dependency
988 The value of \fB\s-1DEPENDENCIES_OUTPUT\s0\fR can be just a file name, in
989 which case the Make rules are written to that file, guessing the target
990 name from the source file name. Or the value can have the form
991 \&\fIfile\fR\fB \fR\fItarget\fR, in which case the rules are written to
992 file \fIfile\fR using \fItarget\fR as the target name.
994 In other words, this environment variable is equivalent to combining
995 the options \fB\-MM\fR and \fB\-MF\fR,
996 with an optional \fB\-MT\fR switch too.
997 .IP "\fB\s-1SUNPRO_DEPENDENCIES\s0\fR" 4
998 .IX Item "SUNPRO_DEPENDENCIES"
999 This variable is the same as \fB\s-1DEPENDENCIES_OUTPUT\s0\fR (see above),
1000 except that system header files are not ignored, so it implies
1001 \&\fB\-M\fR rather than \fB\-MM\fR. However, the dependence on the
1002 main input file is omitted.
1004 .IX Header "SEE ALSO"
1005 \&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7),
1006 \&\fIgcc\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIcpp\fR, \fIgcc\fR, and
1009 .IX Header "COPYRIGHT"
1010 Copyright (c) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
1011 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
1012 2008, 2009, 2010, 2011
1013 Free Software Foundation, Inc.
1015 Permission is granted to copy, distribute and/or modify this document
1016 under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 or
1017 any later version published by the Free Software Foundation. A copy of
1018 the license is included in the
1019 man page \fIgfdl\fR\|(7).
1020 This manual contains no Invariant Sections. The Front-Cover Texts are
1021 (a) (see below), and the Back-Cover Texts are (b) (see below).
1023 (a) The \s-1FSF\s0's Front-Cover Text is:
1029 (b) The \s-1FSF\s0's Back-Cover Text is:
1032 \& You have freedom to copy and modify this GNU Manual, like GNU
1033 \& software. Copies published by the Free Software Foundation raise
1034 \& funds for GNU development.