]> gcc.gnu.org Git - gcc.git/blob - gcc/cpp.1
texi2pod.pl: Handle @option and @env.
[gcc.git] / gcc / cpp.1
1 .\" Automatically generated by Pod::Man version 1.1
2 .\" Wed Jan 3 20:06:19 2001
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 Ip \" List item
19 .br
20 .ie \\n(.$>=3 .ne \\$3
21 .el .ne 3
22 .IP "\\$1" \\$2
23 ..
24 .de Vb \" Begin verbatim text
25 .ft CW
26 .nf
27 .ne \\$1
28 ..
29 .de Ve \" End verbatim text
30 .ft R
31
32 .fi
33 ..
34 .\" Set up some character translations and predefined strings. \*(-- will
35 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
36 .\" double quote, and \*(R" will give a right double quote. | will give a
37 .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
38 .\" to do unbreakable dashes and therefore won't be available. \*(C` and
39 .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
40 .tr \(*W-|\(bv\*(Tr
41 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
42 .ie n \{\
43 . ds -- \(*W-
44 . ds PI pi
45 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
46 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
47 . ds L" ""
48 . ds R" ""
49 . ds C` ""
50 . ds C' ""
51 'br\}
52 .el\{\
53 . ds -- \|\(em\|
54 . ds PI \(*p
55 . ds L" ``
56 . ds R" ''
57 'br\}
58 .\"
59 .\" If the F register is turned on, we'll generate index entries on stderr
60 .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
61 .\" index entries marked with X<> in POD. Of course, you'll have to process
62 .\" the output yourself in some meaningful fashion.
63 .if \nF \{\
64 . de IX
65 . tm Index:\\$1\t\\n%\t"\\$2"
66 ..
67 . nr % 0
68 . rr F
69 .\}
70 .\"
71 .\" For nroff, turn off justification. Always turn off hyphenation; it
72 .\" makes way too many mistakes in technical documents.
73 .hy 0
74 .if n .na
75 .\"
76 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
77 .\" Fear. Run. Save yourself. No user-serviceable parts.
78 .bd B 3
79 . \" fudge factors for nroff and troff
80 .if n \{\
81 . ds #H 0
82 . ds #V .8m
83 . ds #F .3m
84 . ds #[ \f1
85 . ds #] \fP
86 .\}
87 .if t \{\
88 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
89 . ds #V .6m
90 . ds #F 0
91 . ds #[ \&
92 . ds #] \&
93 .\}
94 . \" simple accents for nroff and troff
95 .if n \{\
96 . ds ' \&
97 . ds ` \&
98 . ds ^ \&
99 . ds , \&
100 . ds ~ ~
101 . ds /
102 .\}
103 .if t \{\
104 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
105 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
106 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
107 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
108 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
109 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
110 .\}
111 . \" troff and (daisy-wheel) nroff accents
112 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
113 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
114 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
115 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
116 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
117 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
118 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
119 .ds ae a\h'-(\w'a'u*4/10)'e
120 .ds Ae A\h'-(\w'A'u*4/10)'E
121 . \" corrections for vroff
122 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
123 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
124 . \" for low resolution devices (crt and lpr)
125 .if \n(.H>23 .if \n(.V>19 \
126 \{\
127 . ds : e
128 . ds 8 ss
129 . ds o a
130 . ds d- d\h'-1'\(ga
131 . ds D- D\h'-1'\(hy
132 . ds th \o'bp'
133 . ds Th \o'LP'
134 . ds ae ae
135 . ds Ae AE
136 .\}
137 .rm #[ #] #H #V #F C
138 .\" ======================================================================
139 .\"
140 .IX Title "CPP 1"
141 .TH CPP 1 "gcc-2.97" "2001-01-03" "GNU"
142 .UC
143 .SH "NAME"
144 cpp \- The C Preprocessor
145 .SH "SYNOPSIS"
146 .IX Header "SYNOPSIS"
147 cpp [\fB\-P\fR] [\fB\-C\fR] [\fB\-gcc\fR] [\fB\-traditional\fR]
148 [\fB\-undef\fR] [\fB\-trigraphs\fR] [\fB\-pedantic\fR]
149 [\fB\-W\fR\fIwarn\fR...] [\fB\-I\fR\fIdir\fR...]
150 [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
151 [\fB\-A\fR\fIpredicate\fR(\fIanswer\fR)]
152 [\fB\-M\fR|\fB\-MM\fR|\fB\-MD\fR|\fB\-MMD\fR [\fB\-MG\fR]]
153 [\fB\-x\fR \fIlanguage\fR] [\fB\-std=\fR\fIstandard\fR]
154 \fIinfile\fR \fIoutfile\fR
155 .PP
156 Only the most useful options are listed here; see below for the remainder.
157 .SH "DESCRIPTION"
158 .IX Header "DESCRIPTION"
159 The C preprocessor is a \fImacro processor\fR that is used automatically
160 by the C compiler to transform your program before actual compilation.
161 It is called a macro processor because it allows you to define
162 \&\fImacros\fR, which are brief abbreviations for longer constructs.
163 .PP
164 The C preprocessor is intended only for macro processing of C, \*(C+ and
165 Objective C source files. For macro processing of other files, you are
166 strongly encouraged to use alternatives like M4, which will likely give
167 you better results and avoid many problems. For example, normally the C
168 preprocessor does not preserve arbitrary whitespace verbatim, but
169 instead replaces each sequence with a single space.
170 .PP
171 For use on C-like source files, the C preprocessor provides four
172 separate facilities that you can use as you see fit:
173 .Ip "\(bu" 4
174 Inclusion of header files. These are files of declarations that can be
175 substituted into your program.
176 .Ip "\(bu" 4
177 Macro expansion. You can define \fImacros\fR, which are abbreviations
178 for arbitrary fragments of C code, and then the C preprocessor will
179 replace the macros with their definitions throughout the program.
180 .Ip "\(bu" 4
181 Conditional compilation. Using special preprocessing directives, you
182 can include or exclude parts of the program according to various
183 conditions.
184 .Ip "\(bu" 4
185 Line control. If you use a program to combine or rearrange source files
186 into an intermediate file which is then compiled, you can use line
187 control to inform the compiler of where each source line originally came
188 from.
189 .PP
190 C preprocessors vary in some details. This manual discusses the \s-1GNU\s0 C
191 preprocessor, which provides a small superset of the features of \s-1ISO\s0
192 Standard C.
193 .PP
194 In its default mode, the \s-1GNU\s0 C preprocessor does not do a few things
195 required by the standard. These are features which are rarely, if ever,
196 used, and may cause surprising changes to the meaning of a program which
197 does not expect them. To get strict \s-1ISO\s0 Standard C, you should use the
198 \&\fB\-std=c89\fR or \fB\-std=c99\fR options, depending on which version
199 of the standard you want. To get all the mandatory diagnostics, you
200 must also use \fB\-pedantic\fR.
201 .SH "OPTIONS"
202 .IX Header "OPTIONS"
203 The C preprocessor expects two file names as arguments, \fIinfile\fR and
204 \&\fIoutfile\fR. The preprocessor reads \fIinfile\fR together with any
205 other files it specifies with \fB#include\fR. All the output generated
206 by the combined input files is written in \fIoutfile\fR.
207 .PP
208 Either \fIinfile\fR or \fIoutfile\fR may be \fB-\fR, which as
209 \&\fIinfile\fR means to read from standard input and as \fIoutfile\fR
210 means to write to standard output. Also, if either file is omitted, it
211 means the same as if \fB-\fR had been specified for that file.
212 .PP
213 Here is a table of command options accepted by the C preprocessor.
214 These options can also be given when compiling a C program; they are
215 passed along automatically to the preprocessor when it is invoked by the
216 compiler.
217 .Ip "\fB\-P\fR" 4
218 .IX Item "-P"
219 Inhibit generation of \fB#\fR\-lines with line-number information in the
220 output from the preprocessor. This might be useful when running the
221 preprocessor on something that is not C code and will be sent to a
222 program which might be confused by the \fB#\fR\-lines.
223 .Ip "\fB\-C\fR" 4
224 .IX Item "-C"
225 Do not discard comments. All comments are passed through to the output
226 file, except for comments in processed directives, which are deleted
227 along with the directive. Comments appearing in the expansion list of a
228 macro will be preserved, and appear in place wherever the macro is
229 invoked.
230 .Sp
231 You should be prepared for side effects when using \fB\-C\fR; it causes
232 the preprocessor to treat comments as tokens in their own right. For
233 example, macro redefinitions that were trivial when comments were
234 replaced by a single space might become significant when comments are
235 retained. Also, comments appearing at the start of what would be a
236 directive line have the effect of turning that line into an ordinary
237 source line, since the first token on the line is no longer a \fB#\fR.
238 .Ip "\fB\-traditional\fR" 4
239 .IX Item "-traditional"
240 Try to imitate the behavior of old-fashioned C, as opposed to \s-1ISO\s0 C.
241 .RS 4
242 .Ip "\(bu" 4
243 Traditional macro expansion pays no attention to single-quote or
244 double-quote characters; macro argument symbols are replaced by the
245 argument values even when they appear within apparent string or
246 character constants.
247 .Ip "\(bu" 4
248 Traditionally, it is permissible for a macro expansion to end in the
249 middle of a string or character constant. The constant continues into
250 the text surrounding the macro call.
251 .Ip "\(bu" 4
252 However, traditionally the end of the line terminates a string or
253 character constant, with no error.
254 .Ip "\(bu" 4
255 In traditional C, a comment is equivalent to no text at all. (In \s-1ISO\s0
256 C, a comment counts as whitespace.)
257 .Ip "\(bu" 4
258 Traditional C does not have the concept of a ``preprocessing number''.
259 It considers \fB1.0e+4\fR to be three tokens: \fB1.0e\fR, \fB+\fR,
260 and \fB4\fR.
261 .Ip "\(bu" 4
262 A macro is not suppressed within its own definition, in traditional C.
263 Thus, any macro that is used recursively inevitably causes an error.
264 .Ip "\(bu" 4
265 The character \fB#\fR has no special meaning within a macro definition
266 in traditional C.
267 .Ip "\(bu" 4
268 In traditional C, the text at the end of a macro expansion can run
269 together with the text after the macro call, to produce a single token.
270 (This is impossible in \s-1ISO\s0 C.)
271 .Ip "\(bu" 4
272 None of the \s-1GNU\s0 extensions to the preprocessor are available in
273 \&\fB\-traditional\fR mode.
274 .RE
275 .RS 4
276 .Sp
277 Use the \fB\-traditional\fR option when preprocessing Fortran code, so
278 that single-quotes and double-quotes within Fortran comment lines (which
279 are generally not recognized as such by the preprocessor) do not cause
280 diagnostics about unterminated character or string constants.
281 .Sp
282 However, this option does not prevent diagnostics about unterminated
283 comments when a C-style comment appears to start, but not end, within
284 Fortran-style commentary.
285 .Sp
286 So, the following Fortran comment lines are accepted with
287 \&\fB\-traditional\fR:
288 .Sp
289 .Vb 3
290 \& C This isn't an unterminated character constant
291 \& C Neither is "20000000000, an octal constant
292 \& C in some dialects of Fortran
293 .Ve
294 However, this type of comment line will likely produce a diagnostic, or
295 at least unexpected output from the preprocessor, due to the
296 unterminated comment:
297 .Sp
298 .Vb 2
299 \& C Some Fortran compilers accept /* as starting
300 \& C an inline comment.
301 .Ve
302 Note that \f(CW\*(C`g77\*(C'\fR automatically supplies the \fB\-traditional\fR
303 option when it invokes the preprocessor. However, a future version of
304 \&\f(CW\*(C`g77\*(C'\fR might use a different, more-Fortran-aware preprocessor in
305 place of \f(CW\*(C`cpp\*(C'\fR.
306 .RE
307 .Ip "\fB\-trigraphs\fR" 4
308 .IX Item "-trigraphs"
309 Process \s-1ISO\s0 standard trigraph sequences. These are three-character
310 sequences, all starting with \fB??\fR, that are defined by \s-1ISO\s0 C to
311 stand for single characters. For example, \fB??/\fR stands for
312 \&\fB\e\fR, so \fB'??/n'\fR is a character constant for a newline. By
313 default, \s-1GCC\s0 ignores trigraphs, but in standard-conforming modes it
314 converts them. See the \fB\-std\fR option.
315 .Sp
316 The nine trigraph sequences are
317 .RS 4
318 .Ip "\fB??(\fR" 4
319 .IX Item "??("
320 -> \fB[\fR
321 .Ip "\fB??)\fR" 4
322 .IX Item "??)"
323 -> \fB]\fR
324 .Ip "\fB??<\fR" 4
325 .IX Item "??<"
326 -> \fB{\fR
327 .Ip "\fB??>\fR" 4
328 .IX Item "??>"
329 -> \fB}\fR
330 .Ip "\fB??=\fR" 4
331 .IX Item "??="
332 -> \fB#\fR
333 .Ip "\fB??/\fR" 4
334 .IX Item "??/"
335 -> \fB\e\fR
336 .Ip "\fB??'\fR" 4
337 .IX Item "??'"
338 -> \fB^\fR
339 .Ip "\fB??!\fR" 4
340 .IX Item "??!"
341 -> \fB|\fR
342 .Ip "\fB??-\fR" 4
343 .IX Item "??-"
344 -> \fB~\fR
345 .RE
346 .RS 4
347 .Sp
348 Trigraph support is not popular, so many compilers do not implement it
349 properly. Portable code should not rely on trigraphs being either
350 converted or ignored.
351 .RE
352 .Ip "\fB\-pedantic\fR" 4
353 .IX Item "-pedantic"
354 Issue warnings required by the \s-1ISO\s0 C standard in certain cases such
355 as when text other than a comment follows \fB#else\fR or \fB#endif\fR.
356 .Ip "\fB\-pedantic-errors\fR" 4
357 .IX Item "-pedantic-errors"
358 Like \fB\-pedantic\fR, except that errors are produced rather than
359 warnings.
360 .Ip "\fB\-Wcomment\fR" 4
361 .IX Item "-Wcomment"
362 .PD 0
363 .Ip "\fB\-Wcomments\fR" 4
364 .IX Item "-Wcomments"
365 .PD
366 (Both forms have the same effect).
367 Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
368 comment, or whenever a backslash-newline appears in a \fB//\fR comment.
369 .Ip "\fB\-Wtrigraphs\fR" 4
370 .IX Item "-Wtrigraphs"
371 Warn if any trigraphs are encountered. This option used to take effect
372 only if \fB\-trigraphs\fR was also specified, but now works
373 independently. Warnings are not given for trigraphs within comments, as
374 we feel this is obnoxious.
375 .Ip "\fB\-Wwhite-space\fR" 4
376 .IX Item "-Wwhite-space"
377 Warn about possible white space confusion, e.g. white space between a
378 backslash and a newline.
379 .Ip "\fB\-Wall\fR" 4
380 .IX Item "-Wall"
381 Requests \fB\-Wcomment\fR, \fB\-Wtrigraphs\fR, and \fB\-Wwhite-space\fR
382 (but not \fB\-Wtraditional\fR or \fB\-Wundef\fR).
383 .Ip "\fB\-Wtraditional\fR" 4
384 .IX Item "-Wtraditional"
385 Warn about certain constructs that behave differently in traditional and
386 \&\s-1ISO\s0 C.
387 .Ip "\fB\-Wundef\fR" 4
388 .IX Item "-Wundef"
389 Warn if an undefined identifier is evaluated in an \fB#if\fR directive.
390 .Ip "\fB\-I\fR \fIdirectory\fR" 4
391 .IX Item "-I directory"
392 Add the directory \fIdirectory\fR to the head of the list of
393 directories to be searched for header files.
394 This can be used to override a system header file, substituting your
395 own version, since these directories are searched before the system
396 header file directories. If you use more than one \fB\-I\fR option,
397 the directories are scanned in left-to-right order; the standard
398 system directories come after.
399 .Ip "\fB\-I-\fR" 4
400 .IX Item "-I-"
401 Any directories specified with \fB\-I\fR options before the \fB\-I-\fR
402 option are searched only for the case of \fB#include "\fR\fIfile\fR\fB"\fR;
403 they are not searched for \fB#include <\fR\fIfile\fR\fB>\fR.
404 .Sp
405 If additional directories are specified with \fB\-I\fR options after
406 the \fB\-I-\fR, these directories are searched for all \fB#include\fR
407 directives.
408 .Sp
409 In addition, the \fB\-I-\fR option inhibits the use of the current
410 directory as the first search directory for \fB#include "\fR\fIfile\fR\fB"\fR.
411 Therefore, the current directory is searched only if it is requested
412 explicitly with \fB\-I.\fR. Specifying both \fB\-I-\fR and \fB\-I.\fR
413 allows you to control precisely which directories are searched before
414 the current one and which are searched after.
415 .Ip "\fB\-nostdinc\fR" 4
416 .IX Item "-nostdinc"
417 Do not search the standard system directories for header files.
418 Only the directories you have specified with \fB\-I\fR options
419 (and the current directory, if appropriate) are searched.
420 .Ip "\fB\-nostdinc++\fR" 4
421 .IX Item "-nostdinc++"
422 Do not search for header files in the \*(C+\-specific standard directories,
423 but do still search the other standard directories. (This option is
424 used when building the \*(C+ library.)
425 .Ip "\fB\-remap\fR" 4
426 .IX Item "-remap"
427 When searching for a header file in a directory, remap file names if a
428 file named \fIheader.gcc\fR exists in that directory. This can be used
429 to work around limitations of file systems with file name restrictions.
430 The \fIheader.gcc\fR file should contain a series of lines with two
431 tokens on each line: the first token is the name to map, and the second
432 token is the actual name to use.
433 .Ip "\fB\-D\fR \fIname\fR" 4
434 .IX Item "-D name"
435 Predefine \fIname\fR as a macro, with definition \fB1\fR.
436 .Ip "\fB\-D\fR \fIname\fR\fB=\fR\fIdefinition\fR" 4
437 .IX Item "-D name=definition"
438 Predefine \fIname\fR as a macro, with definition \fIdefinition\fR.
439 There are no restrictions on the contents of \fIdefinition\fR, but if
440 you are invoking the preprocessor from a shell or shell-like program you
441 may need to use the shell's quoting syntax to protect characters such as
442 spaces that have a meaning in the shell syntax. If you use more than
443 one \fB\-D\fR for the same \fIname\fR, the rightmost definition takes
444 effect.
445 .Ip "\fB\-U\fR \fIname\fR" 4
446 .IX Item "-U name"
447 Do not predefine \fIname\fR. If both \fB\-U\fR and \fB\-D\fR are
448 specified for one name, whichever one appears later on the command line
449 wins.
450 .Ip "\fB\-undef\fR" 4
451 .IX Item "-undef"
452 Do not predefine any nonstandard macros.
453 .Ip "\fB\-gcc\fR" 4
454 .IX Item "-gcc"
455 Define the macros \fI_\|_GNUC_\|_\fR, \fI_\|_GNUC_MINOR_\|_\fR and
456 \&\fI_\|_GNUC_PATCHLEVEL_\|_\fR. These are defined automatically when you use
457 \&\fBgcc \-E\fR; you can turn them off in that case with \fB\-no-gcc\fR.
458 .Ip "\fB\-A\fR \fIpredicate\fR\fB=\fR\fIanswer\fR" 4
459 .IX Item "-A predicate=answer"
460 Make an assertion with the predicate \fIpredicate\fR and answer
461 \&\fIanswer\fR. This form is preferred to the older form \fB\-A\fR
462 \&\fIpredicate\fR\fB(\fR\fIanswer\fR\fB)\fR, which is still supported, because
463 it does not use shell special characters.
464 .Ip "\fB\-A -\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4
465 .IX Item "-A -predicate=answer"
466 Disable an assertion with the predicate \fIpredicate\fR and answer
467 \&\fIanswer\fR. Specifying no predicate, by \fB\-A-\fR or \fB\-A -\fR,
468 disables all predefined assertions and all assertions preceding it on
469 the command line; and also undefines all predefined macros and all
470 macros preceding it on the command line.
471 .Ip "\fB\-dM\fR" 4
472 .IX Item "-dM"
473 Instead of outputting the result of preprocessing, output a list of
474 \&\fB#define\fR directives for all the macros defined during the
475 execution of the preprocessor, including predefined macros. This gives
476 you a way of finding out what is predefined in your version of the
477 preprocessor; assuming you have no file \fBfoo.h\fR, the command
478 .Sp
479 .Vb 1
480 \& touch foo.h; cpp -dM foo.h
481 .Ve
482 will show the values of any predefined macros.
483 .Ip "\fB\-dD\fR" 4
484 .IX Item "-dD"
485 Like \fB\-dM\fR except in two respects: it does \fInot\fR include the
486 predefined macros, and it outputs \fIboth\fR the \fB#define\fR
487 directives and the result of preprocessing. Both kinds of output go to
488 the standard output file.
489 .Ip "\fB\-dN\fR" 4
490 .IX Item "-dN"
491 Like \fB\-dD\fR, but emit only the macro names, not their expansions.
492 .Ip "\fB\-dI\fR" 4
493 .IX Item "-dI"
494 Output \fB#include\fR directives in addition to the result of
495 preprocessing.
496 .Ip "\fB\-M [\-MG]\fR" 4
497 .IX Item "-M [-MG]"
498 Instead of outputting the result of preprocessing, output a rule
499 suitable for \f(CW\*(C`make\*(C'\fR describing the dependencies of the main source
500 file. The preprocessor outputs one \f(CW\*(C`make\*(C'\fR rule containing the
501 object file name for that source file, a colon, and the names of all the
502 included files. If there are many included files then the rule is split
503 into several lines using \fB\e\fR\-newline.
504 .Sp
505 \&\fB\-MG\fR says to treat missing header files as generated files and
506 assume they live in the same directory as the source file. It must be
507 specified in addition to \fB\-M\fR.
508 .Sp
509 This feature is used in automatic updating of makefiles.
510 .Ip "\fB\-MM [\-MG]\fR" 4
511 .IX Item "-MM [-MG]"
512 Like \fB\-M\fR but mention only the files included with \fB#include
513 "\fR\fIfile\fR\fB"\fR. System header files included with \fB#include
514 <\fR\fIfile\fR\fB>\fR are omitted.
515 .Ip "\fB\-MD\fR \fIfile\fR" 4
516 .IX Item "-MD file"
517 Like \fB\-M\fR but the dependency information is written to \fIfile\fR.
518 This is in addition to compiling the file as specified \-\-\- \fB\-MD\fR
519 does not inhibit ordinary compilation the way \fB\-M\fR does.
520 .Sp
521 When invoking \f(CW\*(C`gcc\*(C'\fR, do not specify the \fIfile\fR argument.
522 \&\f(CW\*(C`gcc\*(C'\fR will create file names made by replacing \*(L".c\*(R" with \*(L".d\*(R" at
523 the end of the input file names.
524 .Sp
525 In Mach, you can use the utility \f(CW\*(C`md\*(C'\fR to merge multiple dependency
526 files into a single dependency file suitable for using with the
527 \&\fBmake\fR command.
528 .Ip "\fB\-MMD\fR \fIfile\fR" 4
529 .IX Item "-MMD file"
530 Like \fB\-MD\fR except mention only user header files, not system
531 header files.
532 .Ip "\fB\-H\fR" 4
533 .IX Item "-H"
534 Print the name of each header file used, in addition to other normal
535 activities.
536 .Ip "\fB\-imacros\fR \fIfile\fR" 4
537 .IX Item "-imacros file"
538 Process \fIfile\fR as input, discarding the resulting output, before
539 processing the regular input file. Because the output generated from
540 \&\fIfile\fR is discarded, the only effect of \fB\-imacros\fR \fIfile\fR
541 is to make the macros defined in \fIfile\fR available for use in the
542 main input.
543 .Ip "\fB\-include\fR \fIfile\fR" 4
544 .IX Item "-include file"
545 Process \fIfile\fR as input, and include all the resulting output,
546 before processing the regular input file.
547 .Ip "\fB\-idirafter\fR \fIdir\fR" 4
548 .IX Item "-idirafter dir"
549 Add the directory \fIdir\fR to the second include path. The directories
550 on the second include path are searched when a header file is not found
551 in any of the directories in the main include path (the one that
552 \&\fB\-I\fR adds to).
553 .Ip "\fB\-iprefix\fR \fIprefix\fR" 4
554 .IX Item "-iprefix prefix"
555 Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR
556 options. If the prefix represents a directory, you should include the
557 final \fB/\fR.
558 .Ip "\fB\-iwithprefix\fR \fIdir\fR" 4
559 .IX Item "-iwithprefix dir"
560 Add a directory to the second include path. The directory's name is
561 made by concatenating \fIprefix\fR and \fIdir\fR, where \fIprefix\fR was
562 specified previously with \fB\-iprefix\fR.
563 .Ip "\fB\-isystem\fR \fIdir\fR" 4
564 .IX Item "-isystem dir"
565 Add a directory to the beginning of the second include path, marking it
566 as a system directory, so that it gets the same special treatment as
567 is applied to the standard system directories.
568 .Ip "\fB\-x c\fR" 4
569 .IX Item "-x c"
570 .PD 0
571 .Ip "\fB\-x c++\fR" 4
572 .IX Item "-x c++"
573 .Ip "\fB\-x objective-c\fR" 4
574 .IX Item "-x objective-c"
575 .Ip "\fB\-x assembler-with-cpp\fR" 4
576 .IX Item "-x assembler-with-cpp"
577 .PD
578 Specify the source language: C, \*(C+, Objective-C, or assembly. This has
579 nothing to do with standards conformance or extensions; it merely
580 selects which base syntax to expect. If you give none of these options,
581 cpp will deduce the language from the extension of the source file:
582 \&\fB.c\fR, \fB.cc\fR, \fB.m\fR, or \fB.S\fR. Some other common
583 extensions for \*(C+ and assembly are also recognized. If cpp does not
584 recognize the extension, it will treat the file as C; this is the most
585 generic mode.
586 .Sp
587 \&\fBNote:\fR Previous versions of cpp accepted a \fB\-lang\fR option
588 which selected both the language and the standards conformance level.
589 This option has been removed, because it conflicts with the \fB\-l\fR
590 option.
591 .Ip "\fB\-std=\fR\fIstandard\fR" 4
592 .IX Item "-std=standard"
593 .PD 0
594 .Ip "\fB\-ansi\fR" 4
595 .IX Item "-ansi"
596 .PD
597 Specify the standard to which the code should conform. Currently cpp
598 only knows about the standards for C; other language standards will be
599 added in the future.
600 .Sp
601 \&\fIstandard\fR
602 may be one of:
603 .RS 4
604 .if n .Ip "\f(CW""iso9899:1990""\fR" 4
605 .el .Ip "\f(CWiso9899:1990\fR" 4
606 .IX Item "iso9899:1990"
607 .PD 0
608 .if n .Ip "\f(CW""c89""\fR" 4
609 .el .Ip "\f(CWc89\fR" 4
610 .IX Item "c89"
611 .PD
612 The \s-1ISO\s0 C standard from 1990. \fBc89\fR is the customary shorthand for
613 this version of the standard.
614 .Sp
615 The \fB\-ansi\fR option is equivalent to \fB\-std=c89\fR.
616 .if n .Ip "\f(CW""iso9899:199409""\fR" 4
617 .el .Ip "\f(CWiso9899:199409\fR" 4
618 .IX Item "iso9899:199409"
619 The 1990 C standard, as amended in 1994.
620 .if n .Ip "\f(CW""iso9899:1999""\fR" 4
621 .el .Ip "\f(CWiso9899:1999\fR" 4
622 .IX Item "iso9899:1999"
623 .PD 0
624 .if n .Ip "\f(CW""c99""\fR" 4
625 .el .Ip "\f(CWc99\fR" 4
626 .IX Item "c99"
627 .if n .Ip "\f(CW""iso9899:199x""\fR" 4
628 .el .Ip "\f(CWiso9899:199x\fR" 4
629 .IX Item "iso9899:199x"
630 .if n .Ip "\f(CW""c9x""\fR" 4
631 .el .Ip "\f(CWc9x\fR" 4
632 .IX Item "c9x"
633 .PD
634 The revised \s-1ISO\s0 C standard, published in December 1999. Before
635 publication, this was known as C9X.
636 .if n .Ip "\f(CW""gnu89""\fR" 4
637 .el .Ip "\f(CWgnu89\fR" 4
638 .IX Item "gnu89"
639 The 1990 C standard plus \s-1GNU\s0 extensions. This is the default.
640 .if n .Ip "\f(CW""gnu99""\fR" 4
641 .el .Ip "\f(CWgnu99\fR" 4
642 .IX Item "gnu99"
643 .PD 0
644 .if n .Ip "\f(CW""gnu9x""\fR" 4
645 .el .Ip "\f(CWgnu9x\fR" 4
646 .IX Item "gnu9x"
647 .PD
648 The 1999 C standard plus \s-1GNU\s0 extensions.
649 .RE
650 .RS 4
651 .RE
652 .Ip "\fB\-ftabstop=NUMBER\fR" 4
653 .IX Item "-ftabstop=NUMBER"
654 Set the distance between tab stops. This helps the preprocessor
655 report correct column numbers in warnings or errors, even if tabs appear
656 on the line. Values less than 1 or greater than 100 are ignored. The
657 default is 8.
658 .Ip "\fB\-$\fR" 4
659 .IX Item "-$"
660 Forbid the use of \fB$\fR in identifiers. The C standard allows
661 implementations to define extra characters that can appear in
662 identifiers. By default the \s-1GNU\s0 C preprocessor permits \fB$\fR, a
663 common extension.
664 .SH "SEE ALSO"
665 .IX Header "SEE ALSO"
666 \&\fIgcc\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIcpp\fR, \fIgcc\fR, and
667 \&\fIbinutils\fR.
668 .SH "COPYRIGHT"
669 .IX Header "COPYRIGHT"
670 Copyright (c) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
671 1997, 1998, 1999, 2000
672 Free Software Foundation, Inc.
673 .PP
674 Permission is granted to make and distribute verbatim copies of
675 this manual provided the copyright notice and this permission notice
676 are preserved on all copies.
677 .PP
678 Permission is granted to copy and distribute modified versions of this
679 manual under the conditions for verbatim copying, provided also that
680 the entire resulting derived work is distributed under the terms of a
681 permission notice identical to this one.
682 .PP
683 Permission is granted to copy and distribute translations of this manual
684 into another language, under the above conditions for modified versions.
This page took 0.06825 seconds and 6 git commands to generate.