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