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