Merge branch 'vendor/GCC44'
[dragonfly.git] / contrib / gcc-4.4 / gcc / doc / g++.1
CommitLineData
4b1e227d 1.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
c251ad9e
SS
2.\"
3.\" Standard preamble:
4.\" ========================================================================
c251ad9e
SS
5.de Sp \" Vertical space (when we can't use .PP)
6.if t .sp .5v
7.if n .sp
8..
9.de Vb \" Begin verbatim text
10.ft CW
11.nf
12.ne \\$1
13..
14.de Ve \" End verbatim text
15.ft R
16.fi
17..
18.\" Set up some character translations and predefined strings. \*(-- will
19.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20.\" double quote, and \*(R" will give a right double quote. \*(C+ will
21.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
22.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
23.\" nothing in troff, for use with C<>.
24.tr \(*W-
25.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26.ie n \{\
27. ds -- \(*W-
28. ds PI pi
29. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
31. ds L" ""
32. ds R" ""
33. ds C` ""
34. ds C' ""
35'br\}
36.el\{\
37. ds -- \|\(em\|
38. ds PI \(*p
39. ds L" ``
40. ds R" ''
41'br\}
42.\"
43.\" Escape single quotes in literal strings from groff's Unicode transform.
44.ie \n(.g .ds Aq \(aq
45.el .ds Aq '
46.\"
47.\" If the F register is turned on, we'll generate index entries on stderr for
4b1e227d 48.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
c251ad9e
SS
49.\" entries marked with X<> in POD. Of course, you'll have to process the
50.\" output yourself in some meaningful fashion.
51.ie \nF \{\
52. de IX
53. tm Index:\\$1\t\\n%\t"\\$2"
54..
55. nr % 0
56. rr F
57.\}
58.el \{\
59. de IX
60..
61.\}
62.\"
63.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64.\" Fear. Run. Save yourself. No user-serviceable parts.
65. \" fudge factors for nroff and troff
66.if n \{\
67. ds #H 0
68. ds #V .8m
69. ds #F .3m
70. ds #[ \f1
71. ds #] \fP
72.\}
73.if t \{\
74. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
75. ds #V .6m
76. ds #F 0
77. ds #[ \&
78. ds #] \&
79.\}
80. \" simple accents for nroff and troff
81.if n \{\
82. ds ' \&
83. ds ` \&
84. ds ^ \&
85. ds , \&
86. ds ~ ~
87. ds /
88.\}
89.if t \{\
90. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
96.\}
97. \" troff and (daisy-wheel) nroff accents
98.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105.ds ae a\h'-(\w'a'u*4/10)'e
106.ds Ae A\h'-(\w'A'u*4/10)'E
107. \" corrections for vroff
108.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
110. \" for low resolution devices (crt and lpr)
111.if \n(.H>23 .if \n(.V>19 \
112\{\
113. ds : e
114. ds 8 ss
115. ds o a
116. ds d- d\h'-1'\(ga
117. ds D- D\h'-1'\(hy
118. ds th \o'bp'
119. ds Th \o'LP'
120. ds ae ae
121. ds Ae AE
122.\}
123.rm #[ #] #H #V #F C
124.\" ========================================================================
125.\"
126.IX Title "GCC 1"
4b1e227d 127.TH GCC 1 "2010-10-01" "gcc-4.4.5" "GNU"
c251ad9e
SS
128.\" For nroff, turn off justification. Always turn off hyphenation; it makes
129.\" way too many mistakes in technical documents.
130.if n .ad l
131.nh
132.SH "NAME"
133gcc \- GNU project C and C++ compiler
134.SH "SYNOPSIS"
135.IX Header "SYNOPSIS"
136gcc [\fB\-c\fR|\fB\-S\fR|\fB\-E\fR] [\fB\-std=\fR\fIstandard\fR]
137 [\fB\-g\fR] [\fB\-pg\fR] [\fB\-O\fR\fIlevel\fR]
138 [\fB\-W\fR\fIwarn\fR...] [\fB\-pedantic\fR]
139 [\fB\-I\fR\fIdir\fR...] [\fB\-L\fR\fIdir\fR...]
140 [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR]
141 [\fB\-f\fR\fIoption\fR...] [\fB\-m\fR\fImachine-option\fR...]
142 [\fB\-o\fR \fIoutfile\fR] [@\fIfile\fR] \fIinfile\fR...
143.PP
144Only the most useful options are listed here; see below for the
145remainder. \fBg++\fR accepts mostly the same options as \fBgcc\fR.
146.SH "DESCRIPTION"
147.IX Header "DESCRIPTION"
148When you invoke \s-1GCC\s0, it normally does preprocessing, compilation,
149assembly and linking. The \*(L"overall options\*(R" allow you to stop this
150process at an intermediate stage. For example, the \fB\-c\fR option
151says not to run the linker. Then the output consists of object files
152output by the assembler.
153.PP
154Other options are passed on to one stage of processing. Some options
155control the preprocessor and others the compiler itself. Yet other
156options control the assembler and linker; most of these are not
157documented here, since you rarely need to use any of them.
158.PP
159Most of the command line options that you can use with \s-1GCC\s0 are useful
160for C programs; when an option is only useful with another language
161(usually \*(C+), the explanation says so explicitly. If the description
162for a particular option does not mention a source language, you can use
163that option with all supported languages.
164.PP
165The \fBgcc\fR program accepts options and file names as operands. Many
166options have multi-letter names; therefore multiple single-letter options
167may \fInot\fR be grouped: \fB\-dv\fR is very different from \fB\-d\ \-v\fR.
168.PP
169You can mix options and other arguments. For the most part, the order
170you use doesn't matter. Order does matter when you use several
171options of the same kind; for example, if you specify \fB\-L\fR more
172than once, the directories are searched in the order specified. Also,
173the placement of the \fB\-l\fR option is significant.
174.PP
175Many options have long names starting with \fB\-f\fR or with
176\&\fB\-W\fR\-\-\-for example,
177\&\fB\-fmove\-loop\-invariants\fR, \fB\-Wformat\fR and so on. Most of
178these have both positive and negative forms; the negative form of
179\&\fB\-ffoo\fR would be \fB\-fno\-foo\fR. This manual documents
180only one of these two forms, whichever one is not the default.
181.SH "OPTIONS"
182.IX Header "OPTIONS"
4b1e227d 183.SS "Option Summary"
c251ad9e
SS
184.IX Subsection "Option Summary"
185Here is a summary of all the options, grouped by type. Explanations are
186in the following sections.
187.IP "\fIOverall Options\fR" 4
188.IX Item "Overall Options"
189\&\fB\-c \-S \-E \-o\fR \fIfile\fR \fB\-combine \-pipe \-pass\-exit\-codes
190\&\-x\fR \fIlanguage\fR \fB\-v \-### \-\-help\fR[\fB=\fR\fIclass\fR[\fB,...\fR]] \fB\-\-target\-help
191\&\-\-version \-wrapper@\fR\fIfile\fR
192.IP "\fIC Language Options\fR" 4
193.IX Item "C Language Options"
194\&\fB\-ansi \-std=\fR\fIstandard\fR \fB\-fgnu89\-inline
195\&\-aux\-info\fR \fIfilename\fR
196\&\fB\-fno\-asm \-fno\-builtin \-fno\-builtin\-\fR\fIfunction\fR
197\&\fB\-fhosted \-ffreestanding \-fopenmp \-fms\-extensions
198\&\-trigraphs \-no\-integrated\-cpp \-traditional \-traditional\-cpp
199\&\-fallow\-single\-precision \-fcond\-mismatch \-flax\-vector\-conversions
200\&\-fsigned\-bitfields \-fsigned\-char
201\&\-funsigned\-bitfields \-funsigned\-char\fR
202.IP "\fI\*(C+ Language Options\fR" 4
203.IX Item " Language Options"
204\&\fB\-fabi\-version=\fR\fIn\fR \fB\-fno\-access\-control \-fcheck\-new
205\&\-fconserve\-space \-ffriend\-injection
206\&\-fno\-elide\-constructors
207\&\-fno\-enforce\-eh\-specs
208\&\-ffor\-scope \-fno\-for\-scope \-fno\-gnu\-keywords
209\&\-fno\-implicit\-templates
210\&\-fno\-implicit\-inline\-templates
211\&\-fno\-implement\-inlines \-fms\-extensions
212\&\-fno\-nonansi\-builtins \-fno\-operator\-names
213\&\-fno\-optional\-diags \-fpermissive
214\&\-frepo \-fno\-rtti \-fstats \-ftemplate\-depth\-\fR\fIn\fR
215\&\fB\-fno\-threadsafe\-statics \-fuse\-cxa\-atexit \-fno\-weak \-nostdinc++
216\&\-fno\-default\-inline \-fvisibility\-inlines\-hidden
217\&\-fvisibility\-ms\-compat
218\&\-Wabi \-Wctor\-dtor\-privacy
219\&\-Wnon\-virtual\-dtor \-Wreorder
220\&\-Weffc++ \-Wstrict\-null\-sentinel
221\&\-Wno\-non\-template\-friend \-Wold\-style\-cast
222\&\-Woverloaded\-virtual \-Wno\-pmf\-conversions
223\&\-Wsign\-promo\fR
224.IP "\fIObjective-C and Objective\-\*(C+ Language Options\fR" 4
225.IX Item "Objective-C and Objective- Language Options"
226\&\fB\-fconstant\-string\-class=\fR\fIclass-name\fR
227\&\fB\-fgnu\-runtime \-fnext\-runtime
228\&\-fno\-nil\-receivers
229\&\-fobjc\-call\-cxx\-cdtors
230\&\-fobjc\-direct\-dispatch
231\&\-fobjc\-exceptions
232\&\-fobjc\-gc
233\&\-freplace\-objc\-classes
234\&\-fzero\-link
235\&\-gen\-decls
236\&\-Wassign\-intercept
237\&\-Wno\-protocol \-Wselector
238\&\-Wstrict\-selector\-match
239\&\-Wundeclared\-selector\fR
240.IP "\fILanguage Independent Options\fR" 4
241.IX Item "Language Independent Options"
242\&\fB\-fmessage\-length=\fR\fIn\fR
243\&\fB\-fdiagnostics\-show\-location=\fR[\fBonce\fR|\fBevery-line\fR]
244\&\fB\-fdiagnostics\-show\-option\fR
245.IP "\fIWarning Options\fR" 4
246.IX Item "Warning Options"
247\&\fB\-fsyntax\-only \-pedantic \-pedantic\-errors
248\&\-w \-Wextra \-Wall \-Waddress \-Waggregate\-return \-Warray\-bounds
249\&\-Wno\-attributes \-Wno\-builtin\-macro\-redefined
250\&\-Wc++\-compat \-Wc++0x\-compat \-Wcast\-align \-Wcast\-qual
251\&\-Wchar\-subscripts \-Wclobbered \-Wcomment
252\&\-Wconversion \-Wcoverage\-mismatch \-Wno\-deprecated
253\&\-Wno\-deprecated\-declarations \-Wdisabled\-optimization
254\&\-Wno\-div\-by\-zero \-Wempty\-body \-Wenum\-compare \-Wno\-endif\-labels
255\&\-Werror \-Werror=*
256\&\-Wfatal\-errors \-Wfloat\-equal \-Wformat \-Wformat=2
257\&\-Wno\-format\-contains\-nul \-Wno\-format\-extra\-args \-Wformat\-nonliteral
258\&\-Wformat\-security \-Wformat\-y2k
259\&\-Wframe\-larger\-than=\fR\fIlen\fR \fB\-Wignored\-qualifiers
260\&\-Wimplicit \-Wimplicit\-function\-declaration \-Wimplicit\-int
261\&\-Winit\-self \-Winline
262\&\-Wno\-int\-to\-pointer\-cast \-Wno\-invalid\-offsetof
263\&\-Winvalid\-pch \-Wlarger\-than=\fR\fIlen\fR \fB\-Wunsafe\-loop\-optimizations
264\&\-Wlogical\-op \-Wlong\-long
265\&\-Wmain \-Wmissing\-braces \-Wmissing\-field\-initializers
266\&\-Wmissing\-format\-attribute \-Wmissing\-include\-dirs
267\&\-Wmissing\-noreturn \-Wno\-mudflap
268\&\-Wno\-multichar \-Wnonnull \-Wno\-overflow
269\&\-Woverlength\-strings \-Wpacked \-Wpacked\-bitfield\-compat \-Wpadded
270\&\-Wparentheses \-Wpedantic\-ms\-format \-Wno\-pedantic\-ms\-format
271\&\-Wpointer\-arith \-Wno\-pointer\-to\-int\-cast
272\&\-Wredundant\-decls
273\&\-Wreturn\-type \-Wsequence\-point \-Wshadow
274\&\-Wsign\-compare \-Wsign\-conversion \-Wstack\-protector
275\&\-Wstrict\-aliasing \-Wstrict\-aliasing=n
276\&\-Wstrict\-overflow \-Wstrict\-overflow=\fR\fIn\fR
277\&\fB\-Wswitch \-Wswitch\-default \-Wswitch\-enum \-Wsync\-nand
278\&\-Wsystem\-headers \-Wtrigraphs \-Wtype\-limits \-Wundef \-Wuninitialized
279\&\-Wunknown\-pragmas \-Wno\-pragmas \-Wunreachable\-code
280\&\-Wunused \-Wunused\-function \-Wunused\-label \-Wunused\-parameter
281\&\-Wunused\-value \-Wunused\-variable
282\&\-Wvariadic\-macros \-Wvla
283\&\-Wvolatile\-register\-var \-Wwrite\-strings\fR
284.IP "\fIC and Objective-C-only Warning Options\fR" 4
285.IX Item "C and Objective-C-only Warning Options"
286\&\fB\-Wbad\-function\-cast \-Wmissing\-declarations
287\&\-Wmissing\-parameter\-type \-Wmissing\-prototypes \-Wnested\-externs
288\&\-Wold\-style\-declaration \-Wold\-style\-definition
289\&\-Wstrict\-prototypes \-Wtraditional \-Wtraditional\-conversion
290\&\-Wdeclaration\-after\-statement \-Wpointer\-sign\fR
291.IP "\fIDebugging Options\fR" 4
292.IX Item "Debugging Options"
293\&\fB\-d\fR\fIletters\fR \fB\-dumpspecs \-dumpmachine \-dumpversion
294\&\-fdbg\-cnt\-list \-fdbg\-cnt=\fR\fIcounter-value-list\fR
295\&\fB\-fdump\-noaddr \-fdump\-unnumbered
296\&\-fdump\-translation\-unit\fR[\fB\-\fR\fIn\fR]
297\&\fB\-fdump\-class\-hierarchy\fR[\fB\-\fR\fIn\fR]
298\&\fB\-fdump\-ipa\-all \-fdump\-ipa\-cgraph \-fdump\-ipa\-inline
299\&\-fdump\-statistics
300\&\-fdump\-tree\-all
301\&\-fdump\-tree\-original\fR[\fB\-\fR\fIn\fR]
302\&\fB\-fdump\-tree\-optimized\fR[\fB\-\fR\fIn\fR]
303\&\fB\-fdump\-tree\-cfg \-fdump\-tree\-vcg \-fdump\-tree\-alias
304\&\-fdump\-tree\-ch
305\&\-fdump\-tree\-ssa\fR[\fB\-\fR\fIn\fR] \fB\-fdump\-tree\-pre\fR[\fB\-\fR\fIn\fR]
306\&\fB\-fdump\-tree\-ccp\fR[\fB\-\fR\fIn\fR] \fB\-fdump\-tree\-dce\fR[\fB\-\fR\fIn\fR]
307\&\fB\-fdump\-tree\-gimple\fR[\fB\-raw\fR] \fB\-fdump\-tree\-mudflap\fR[\fB\-\fR\fIn\fR]
308\&\fB\-fdump\-tree\-dom\fR[\fB\-\fR\fIn\fR]
309\&\fB\-fdump\-tree\-dse\fR[\fB\-\fR\fIn\fR]
310\&\fB\-fdump\-tree\-phiopt\fR[\fB\-\fR\fIn\fR]
311\&\fB\-fdump\-tree\-forwprop\fR[\fB\-\fR\fIn\fR]
312\&\fB\-fdump\-tree\-copyrename\fR[\fB\-\fR\fIn\fR]
313\&\fB\-fdump\-tree\-nrv \-fdump\-tree\-vect
314\&\-fdump\-tree\-sink
315\&\-fdump\-tree\-sra\fR[\fB\-\fR\fIn\fR]
316\&\fB\-fdump\-tree\-fre\fR[\fB\-\fR\fIn\fR]
317\&\fB\-fdump\-tree\-vrp\fR[\fB\-\fR\fIn\fR]
318\&\fB\-ftree\-vectorizer\-verbose=\fR\fIn\fR
319\&\fB\-fdump\-tree\-storeccp\fR[\fB\-\fR\fIn\fR]
320\&\fB\-feliminate\-dwarf2\-dups \-feliminate\-unused\-debug\-types
321\&\-feliminate\-unused\-debug\-symbols \-femit\-class\-debug\-always
322\&\-fmem\-report \-fpre\-ipa\-mem\-report \-fpost\-ipa\-mem\-report \-fprofile\-arcs
323\&\-frandom\-seed=\fR\fIstring\fR \fB\-fsched\-verbose=\fR\fIn\fR
324\&\fB\-fsel\-sched\-verbose \-fsel\-sched\-dump\-cfg \-fsel\-sched\-pipelining\-verbose
325\&\-ftest\-coverage \-ftime\-report \-fvar\-tracking
326\&\-g \-g\fR\fIlevel\fR \fB\-gcoff \-gdwarf\-2
327\&\-ggdb \-gstabs \-gstabs+ \-gvms \-gxcoff \-gxcoff+
328\&\-fno\-merge\-debug\-strings \-fno\-dwarf2\-cfi\-asm
329\&\-fdebug\-prefix\-map=\fR\fIold\fR\fB=\fR\fInew\fR
330\&\fB\-femit\-struct\-debug\-baseonly \-femit\-struct\-debug\-reduced
331\&\-femit\-struct\-debug\-detailed\fR[\fB=\fR\fIspec-list\fR]
332\&\fB\-p \-pg \-print\-file\-name=\fR\fIlibrary\fR \fB\-print\-libgcc\-file\-name
333\&\-print\-multi\-directory \-print\-multi\-lib
334\&\-print\-prog\-name=\fR\fIprogram\fR \fB\-print\-search\-dirs \-Q
335\&\-print\-sysroot \-print\-sysroot\-headers\-suffix
336\&\-save\-temps \-time\fR
337.IP "\fIOptimization Options\fR" 4
338.IX Item "Optimization Options"
339\&\fB\-falign\-functions[=\fR\fIn\fR\fB] \-falign\-jumps[=\fR\fIn\fR\fB]
340\&\-falign\-labels[=\fR\fIn\fR\fB] \-falign\-loops[=\fR\fIn\fR\fB] \-fassociative\-math
341\&\-fauto\-inc\-dec \-fbranch\-probabilities \-fbranch\-target\-load\-optimize
342\&\-fbranch\-target\-load\-optimize2 \-fbtr\-bb\-exclusive \-fcaller\-saves
343\&\-fcheck\-data\-deps \-fconserve\-stack \-fcprop\-registers \-fcrossjumping
344\&\-fcse\-follow\-jumps \-fcse\-skip\-blocks \-fcx\-fortran\-rules \-fcx\-limited\-range
345\&\-fdata\-sections \-fdce \-fdce
346\&\-fdelayed\-branch \-fdelete\-null\-pointer\-checks \-fdse \-fdse
347\&\-fearly\-inlining \-fexpensive\-optimizations \-ffast\-math
348\&\-ffinite\-math\-only \-ffloat\-store \-fforward\-propagate
349\&\-ffunction\-sections \-fgcse \-fgcse\-after\-reload \-fgcse\-las \-fgcse\-lm
350\&\-fgcse\-sm \-fif\-conversion \-fif\-conversion2 \-findirect\-inlining
351\&\-finline\-functions \-finline\-functions\-called\-once \-finline\-limit=\fR\fIn\fR
352\&\fB\-finline\-small\-functions \-fipa\-cp \-fipa\-cp\-clone \-fipa\-matrix\-reorg \-fipa\-pta
353\&\-fipa\-pure\-const \-fipa\-reference \-fipa\-struct\-reorg
354\&\-fipa\-type\-escape \-fira\-algorithm=\fR\fIalgorithm\fR
355\&\fB\-fira\-region=\fR\fIregion\fR \fB\-fira\-coalesce \-fno\-ira\-share\-save\-slots
356\&\-fno\-ira\-share\-spill\-slots \-fira\-verbose=\fR\fIn\fR
357\&\fB\-fivopts \-fkeep\-inline\-functions \-fkeep\-static\-consts
358\&\-floop\-block \-floop\-interchange \-floop\-strip\-mine
359\&\-fmerge\-all\-constants \-fmerge\-constants \-fmodulo\-sched
360\&\-fmodulo\-sched\-allow\-regmoves \-fmove\-loop\-invariants \-fmudflap
361\&\-fmudflapir \-fmudflapth \-fno\-branch\-count\-reg \-fno\-default\-inline
362\&\-fno\-defer\-pop \-fno\-function\-cse \-fno\-guess\-branch\-probability
363\&\-fno\-inline \-fno\-math\-errno \-fno\-peephole \-fno\-peephole2
364\&\-fno\-sched\-interblock \-fno\-sched\-spec \-fno\-signed\-zeros
365\&\-fno\-toplevel\-reorder \-fno\-trapping\-math \-fno\-zero\-initialized\-in\-bss
366\&\-fomit\-frame\-pointer \-foptimize\-register\-move \-foptimize\-sibling\-calls
367\&\-fpeel\-loops \-fpredictive\-commoning \-fprefetch\-loop\-arrays
368\&\-fprofile\-correction \-fprofile\-dir=\fR\fIpath\fR \fB\-fprofile\-generate
369\&\-fprofile\-generate=\fR\fIpath\fR
370\&\fB\-fprofile\-use \-fprofile\-use=\fR\fIpath\fR \fB\-fprofile\-values
371\&\-freciprocal\-math \-fregmove \-frename\-registers \-freorder\-blocks
372\&\-freorder\-blocks\-and\-partition \-freorder\-functions
373\&\-frerun\-cse\-after\-loop \-freschedule\-modulo\-scheduled\-loops
374\&\-frounding\-math \-frtl\-abstract\-sequences \-fsched2\-use\-superblocks
375\&\-fsched2\-use\-traces \-fsched\-spec\-load \-fsched\-spec\-load\-dangerous
376\&\-fsched\-stalled\-insns\-dep[=\fR\fIn\fR\fB] \-fsched\-stalled\-insns[=\fR\fIn\fR\fB]
377\&\-fschedule\-insns \-fschedule\-insns2 \-fsection\-anchors \-fsee
378\&\-fselective\-scheduling \-fselective\-scheduling2
379\&\-fsel\-sched\-pipelining \-fsel\-sched\-pipelining\-outer\-loops
380\&\-fsignaling\-nans \-fsingle\-precision\-constant \-fsplit\-ivs\-in\-unroller
381\&\-fsplit\-wide\-types \-fstack\-protector \-fstack\-protector\-all
382\&\-fstrict\-aliasing \-fstrict\-overflow \-fthread\-jumps \-ftracer
383\&\-ftree\-builtin\-call\-dce \-ftree\-ccp \-ftree\-ch \-ftree\-copy\-prop
384\&\-ftree\-copyrename \-ftree\-dce
385\&\-ftree\-dominator\-opts \-ftree\-dse \-ftree\-fre \-ftree\-loop\-im
386\&\-ftree\-loop\-distribution
387\&\-ftree\-loop\-ivcanon \-ftree\-loop\-linear \-ftree\-loop\-optimize
388\&\-ftree\-parallelize\-loops=\fR\fIn\fR \fB\-ftree\-pre \-ftree\-reassoc
389\&\-ftree\-sink \-ftree\-sra \-ftree\-switch\-conversion
390\&\-ftree\-ter \-ftree\-vect\-loop\-version \-ftree\-vectorize \-ftree\-vrp
391\&\-funit\-at\-a\-time \-funroll\-all\-loops \-funroll\-loops
392\&\-funsafe\-loop\-optimizations \-funsafe\-math\-optimizations \-funswitch\-loops
393\&\-fvariable\-expansion\-in\-unroller \-fvect\-cost\-model \-fvpt \-fweb
394\&\-fwhole\-program
395\&\-\-param\fR \fIname\fR\fB=\fR\fIvalue\fR
396\&\fB\-O \-O0 \-O1 \-O2 \-O3 \-Os\fR
397.IP "\fIPreprocessor Options\fR" 4
398.IX Item "Preprocessor Options"
399\&\fB\-A\fR\fIquestion\fR\fB=\fR\fIanswer\fR
400\&\fB\-A\-\fR\fIquestion\fR[\fB=\fR\fIanswer\fR]
401\&\fB\-C \-dD \-dI \-dM \-dN
402\&\-D\fR\fImacro\fR[\fB=\fR\fIdefn\fR] \fB\-E \-H
403\&\-idirafter\fR \fIdir\fR
404\&\fB\-include\fR \fIfile\fR \fB\-imacros\fR \fIfile\fR
405\&\fB\-iprefix\fR \fIfile\fR \fB\-iwithprefix\fR \fIdir\fR
406\&\fB\-iwithprefixbefore\fR \fIdir\fR \fB\-isystem\fR \fIdir\fR
407\&\fB\-imultilib\fR \fIdir\fR \fB\-isysroot\fR \fIdir\fR
408\&\fB\-M \-MM \-MF \-MG \-MP \-MQ \-MT \-nostdinc
409\&\-P \-fworking\-directory \-remap
410\&\-trigraphs \-undef \-U\fR\fImacro\fR \fB\-Wp,\fR\fIoption\fR
411\&\fB\-Xpreprocessor\fR \fIoption\fR
412.IP "\fIAssembler Option\fR" 4
413.IX Item "Assembler Option"
414\&\fB\-Wa,\fR\fIoption\fR \fB\-Xassembler\fR \fIoption\fR
415.IP "\fILinker Options\fR" 4
416.IX Item "Linker Options"
417\&\fIobject-file-name\fR \fB\-l\fR\fIlibrary\fR
418\&\fB\-nostartfiles \-nodefaultlibs \-nostdlib \-pie \-rdynamic
419\&\-s \-static \-static\-libgcc \-shared \-shared\-libgcc \-symbolic
420\&\-T\fR \fIscript\fR \fB\-Wl,\fR\fIoption\fR \fB\-Xlinker\fR \fIoption\fR
421\&\fB\-u\fR \fIsymbol\fR
422.IP "\fIDirectory Options\fR" 4
423.IX Item "Directory Options"
424\&\fB\-B\fR\fIprefix\fR \fB\-I\fR\fIdir\fR \fB\-iquote\fR\fIdir\fR \fB\-L\fR\fIdir\fR
425\&\fB\-specs=\fR\fIfile\fR \fB\-I\- \-\-sysroot=\fR\fIdir\fR
426.IP "\fITarget Options\fR" 4
427.IX Item "Target Options"
428\&\fB\-V\fR \fIversion\fR \fB\-b\fR \fImachine\fR
429.IP "\fIMachine Dependent Options\fR" 4
430.IX Item "Machine Dependent Options"
431\&\fI\s-1ARC\s0 Options\fR
432\&\fB\-EB \-EL
433\&\-mmangle\-cpu \-mcpu=\fR\fIcpu\fR \fB\-mtext=\fR\fItext-section\fR
434\&\fB\-mdata=\fR\fIdata-section\fR \fB\-mrodata=\fR\fIreadonly-data-section\fR
435.Sp
436\&\fI\s-1ARM\s0 Options\fR
437\&\fB\-mapcs\-frame \-mno\-apcs\-frame
438\&\-mabi=\fR\fIname\fR
439\&\fB\-mapcs\-stack\-check \-mno\-apcs\-stack\-check
440\&\-mapcs\-float \-mno\-apcs\-float
441\&\-mapcs\-reentrant \-mno\-apcs\-reentrant
442\&\-msched\-prolog \-mno\-sched\-prolog
443\&\-mlittle\-endian \-mbig\-endian \-mwords\-little\-endian
444\&\-mfloat\-abi=\fR\fIname\fR \fB\-msoft\-float \-mhard\-float \-mfpe
445\&\-mthumb\-interwork \-mno\-thumb\-interwork
446\&\-mcpu=\fR\fIname\fR \fB\-march=\fR\fIname\fR \fB\-mfpu=\fR\fIname\fR
447\&\fB\-mstructure\-size\-boundary=\fR\fIn\fR
448\&\fB\-mabort\-on\-noreturn
449\&\-mlong\-calls \-mno\-long\-calls
450\&\-msingle\-pic\-base \-mno\-single\-pic\-base
451\&\-mpic\-register=\fR\fIreg\fR
452\&\fB\-mnop\-fun\-dllimport
453\&\-mcirrus\-fix\-invalid\-insns \-mno\-cirrus\-fix\-invalid\-insns
454\&\-mpoke\-function\-name
455\&\-mthumb \-marm
456\&\-mtpcs\-frame \-mtpcs\-leaf\-frame
457\&\-mcaller\-super\-interworking \-mcallee\-super\-interworking
458\&\-mtp=\fR\fIname\fR
459\&\fB\-mword\-relocations
460\&\-mfix\-cortex\-m3\-ldrd\fR
461.Sp
462\&\fI\s-1AVR\s0 Options\fR
dff90b41 463\&\fB\-mmcu=\fR\fImcu\fR \fB\-msize \-mno\-interrupts
c251ad9e
SS
464\&\-mcall\-prologues \-mno\-tablejump \-mtiny\-stack \-mint8\fR
465.Sp
466\&\fIBlackfin Options\fR
467\&\fB\-mcpu=\fR\fIcpu\fR[\fB\-\fR\fIsirevision\fR]
468\&\fB\-msim \-momit\-leaf\-frame\-pointer \-mno\-omit\-leaf\-frame\-pointer
469\&\-mspecld\-anomaly \-mno\-specld\-anomaly \-mcsync\-anomaly \-mno\-csync\-anomaly
470\&\-mlow\-64k \-mno\-low64k \-mstack\-check\-l1 \-mid\-shared\-library
471\&\-mno\-id\-shared\-library \-mshared\-library\-id=\fR\fIn\fR
472\&\fB\-mleaf\-id\-shared\-library \-mno\-leaf\-id\-shared\-library
473\&\-msep\-data \-mno\-sep\-data \-mlong\-calls \-mno\-long\-calls
474\&\-mfast\-fp \-minline\-plt \-mmulticore \-mcorea \-mcoreb \-msdram
475\&\-micplb\fR
476.Sp
477\&\fI\s-1CRIS\s0 Options\fR
478\&\fB\-mcpu=\fR\fIcpu\fR \fB\-march=\fR\fIcpu\fR \fB\-mtune=\fR\fIcpu\fR
479\&\fB\-mmax\-stack\-frame=\fR\fIn\fR \fB\-melinux\-stacksize=\fR\fIn\fR
480\&\fB\-metrax4 \-metrax100 \-mpdebug \-mcc\-init \-mno\-side\-effects
481\&\-mstack\-align \-mdata\-align \-mconst\-align
482\&\-m32\-bit \-m16\-bit \-m8\-bit \-mno\-prologue\-epilogue \-mno\-gotplt
483\&\-melf \-maout \-melinux \-mlinux \-sim \-sim2
484\&\-mmul\-bug\-workaround \-mno\-mul\-bug\-workaround\fR
485.Sp
486\&\fI\s-1CRX\s0 Options\fR
487\&\fB\-mmac \-mpush\-args\fR
488.Sp
489\&\fIDarwin Options\fR
490\&\fB\-all_load \-allowable_client \-arch \-arch_errors_fatal
491\&\-arch_only \-bind_at_load \-bundle \-bundle_loader
492\&\-client_name \-compatibility_version \-current_version
493\&\-dead_strip
494\&\-dependency\-file \-dylib_file \-dylinker_install_name
495\&\-dynamic \-dynamiclib \-exported_symbols_list
496\&\-filelist \-flat_namespace \-force_cpusubtype_ALL
497\&\-force_flat_namespace \-headerpad_max_install_names
498\&\-iframework
499\&\-image_base \-init \-install_name \-keep_private_externs
500\&\-multi_module \-multiply_defined \-multiply_defined_unused
501\&\-noall_load \-no_dead_strip_inits_and_terms
502\&\-nofixprebinding \-nomultidefs \-noprebind \-noseglinkedit
503\&\-pagezero_size \-prebind \-prebind_all_twolevel_modules
504\&\-private_bundle \-read_only_relocs \-sectalign
505\&\-sectobjectsymbols \-whyload \-seg1addr
506\&\-sectcreate \-sectobjectsymbols \-sectorder
507\&\-segaddr \-segs_read_only_addr \-segs_read_write_addr
508\&\-seg_addr_table \-seg_addr_table_filename \-seglinkedit
509\&\-segprot \-segs_read_only_addr \-segs_read_write_addr
510\&\-single_module \-static \-sub_library \-sub_umbrella
511\&\-twolevel_namespace \-umbrella \-undefined
512\&\-unexported_symbols_list \-weak_reference_mismatches
513\&\-whatsloaded \-F \-gused \-gfull \-mmacosx\-version\-min=\fR\fIversion\fR
514\&\fB\-mkernel \-mone\-byte\-bool\fR
515.Sp
516\&\fI\s-1DEC\s0 Alpha Options\fR
517\&\fB\-mno\-fp\-regs \-msoft\-float \-malpha\-as \-mgas
518\&\-mieee \-mieee\-with\-inexact \-mieee\-conformant
519\&\-mfp\-trap\-mode=\fR\fImode\fR \fB\-mfp\-rounding\-mode=\fR\fImode\fR
520\&\fB\-mtrap\-precision=\fR\fImode\fR \fB\-mbuild\-constants
521\&\-mcpu=\fR\fIcpu-type\fR \fB\-mtune=\fR\fIcpu-type\fR
522\&\fB\-mbwx \-mmax \-mfix \-mcix
523\&\-mfloat\-vax \-mfloat\-ieee
524\&\-mexplicit\-relocs \-msmall\-data \-mlarge\-data
525\&\-msmall\-text \-mlarge\-text
526\&\-mmemory\-latency=\fR\fItime\fR
527.Sp
528\&\fI\s-1DEC\s0 Alpha/VMS Options\fR
529\&\fB\-mvms\-return\-codes\fR
530.Sp
531\&\fI\s-1FR30\s0 Options\fR
532\&\fB\-msmall\-model \-mno\-lsim\fR
533.Sp
534\&\fI\s-1FRV\s0 Options\fR
535\&\fB\-mgpr\-32 \-mgpr\-64 \-mfpr\-32 \-mfpr\-64
536\&\-mhard\-float \-msoft\-float
537\&\-malloc\-cc \-mfixed\-cc \-mdword \-mno\-dword
538\&\-mdouble \-mno\-double
539\&\-mmedia \-mno\-media \-mmuladd \-mno\-muladd
540\&\-mfdpic \-minline\-plt \-mgprel\-ro \-multilib\-library\-pic
541\&\-mlinked\-fp \-mlong\-calls \-malign\-labels
542\&\-mlibrary\-pic \-macc\-4 \-macc\-8
543\&\-mpack \-mno\-pack \-mno\-eflags \-mcond\-move \-mno\-cond\-move
544\&\-moptimize\-membar \-mno\-optimize\-membar
545\&\-mscc \-mno\-scc \-mcond\-exec \-mno\-cond\-exec
546\&\-mvliw\-branch \-mno\-vliw\-branch
547\&\-mmulti\-cond\-exec \-mno\-multi\-cond\-exec \-mnested\-cond\-exec
548\&\-mno\-nested\-cond\-exec \-mtomcat\-stats
549\&\-mTLS \-mtls
550\&\-mcpu=\fR\fIcpu\fR
551.Sp
552\&\fIGNU/Linux Options\fR
553\&\fB\-muclibc\fR
554.Sp
555\&\fIH8/300 Options\fR
556\&\fB\-mrelax \-mh \-ms \-mn \-mint32 \-malign\-300\fR
557.Sp
558\&\fI\s-1HPPA\s0 Options\fR
559\&\fB\-march=\fR\fIarchitecture-type\fR
560\&\fB\-mbig\-switch \-mdisable\-fpregs \-mdisable\-indexing
561\&\-mfast\-indirect\-calls \-mgas \-mgnu\-ld \-mhp\-ld
562\&\-mfixed\-range=\fR\fIregister-range\fR
563\&\fB\-mjump\-in\-delay \-mlinker\-opt \-mlong\-calls
564\&\-mlong\-load\-store \-mno\-big\-switch \-mno\-disable\-fpregs
565\&\-mno\-disable\-indexing \-mno\-fast\-indirect\-calls \-mno\-gas
566\&\-mno\-jump\-in\-delay \-mno\-long\-load\-store
567\&\-mno\-portable\-runtime \-mno\-soft\-float
568\&\-mno\-space\-regs \-msoft\-float \-mpa\-risc\-1\-0
569\&\-mpa\-risc\-1\-1 \-mpa\-risc\-2\-0 \-mportable\-runtime
570\&\-mschedule=\fR\fIcpu-type\fR \fB\-mspace\-regs \-msio \-mwsio
571\&\-munix=\fR\fIunix-std\fR \fB\-nolibdld \-static \-threads\fR
572.Sp
573\&\fIi386 and x86\-64 Options\fR
574\&\fB\-mtune=\fR\fIcpu-type\fR \fB\-march=\fR\fIcpu-type\fR
575\&\fB\-mfpmath=\fR\fIunit\fR
576\&\fB\-masm=\fR\fIdialect\fR \fB\-mno\-fancy\-math\-387
577\&\-mno\-fp\-ret\-in\-387 \-msoft\-float
578\&\-mno\-wide\-multiply \-mrtd \-malign\-double
579\&\-mpreferred\-stack\-boundary=\fR\fInum\fR
580\&\fB\-mincoming\-stack\-boundary=\fR\fInum\fR
581\&\fB\-mcld \-mcx16 \-msahf \-mrecip
582\&\-mmmx \-msse \-msse2 \-msse3 \-mssse3 \-msse4.1 \-msse4.2 \-msse4 \-mavx
583\&\-maes \-mpclmul
584\&\-msse4a \-m3dnow \-mpopcnt \-mabm \-msse5
585\&\-mthreads \-mno\-align\-stringops \-minline\-all\-stringops
586\&\-minline\-stringops\-dynamically \-mstringop\-strategy=\fR\fIalg\fR
587\&\fB\-mpush\-args \-maccumulate\-outgoing\-args \-m128bit\-long\-double
588\&\-m96bit\-long\-double \-mregparm=\fR\fInum\fR \fB\-msseregparm
589\&\-mveclibabi=\fR\fItype\fR \fB\-mpc32 \-mpc64 \-mpc80 \-mstackrealign
590\&\-momit\-leaf\-frame\-pointer \-mno\-red\-zone \-mno\-tls\-direct\-seg\-refs
591\&\-mcmodel=\fR\fIcode-model\fR
592\&\fB\-m32 \-m64 \-mlarge\-data\-threshold=\fR\fInum\fR
593\&\fB\-mfused\-madd \-mno\-fused\-madd \-msse2avx\fR
594.Sp
595\&\fI\s-1IA\-64\s0 Options\fR
596\&\fB\-mbig\-endian \-mlittle\-endian \-mgnu\-as \-mgnu\-ld \-mno\-pic
597\&\-mvolatile\-asm\-stop \-mregister\-names \-mno\-sdata
598\&\-mconstant\-gp \-mauto\-pic \-minline\-float\-divide\-min\-latency
599\&\-minline\-float\-divide\-max\-throughput
600\&\-minline\-int\-divide\-min\-latency
601\&\-minline\-int\-divide\-max\-throughput
602\&\-minline\-sqrt\-min\-latency \-minline\-sqrt\-max\-throughput
603\&\-mno\-dwarf2\-asm \-mearly\-stop\-bits
604\&\-mfixed\-range=\fR\fIregister-range\fR \fB\-mtls\-size=\fR\fItls-size\fR
605\&\fB\-mtune=\fR\fIcpu-type\fR \fB\-mt \-pthread \-milp32 \-mlp64
606\&\-mno\-sched\-br\-data\-spec \-msched\-ar\-data\-spec \-mno\-sched\-control\-spec
607\&\-msched\-br\-in\-data\-spec \-msched\-ar\-in\-data\-spec \-msched\-in\-control\-spec
608\&\-msched\-ldc \-mno\-sched\-control\-ldc \-mno\-sched\-spec\-verbose
609\&\-mno\-sched\-prefer\-non\-data\-spec\-insns
610\&\-mno\-sched\-prefer\-non\-control\-spec\-insns
611\&\-mno\-sched\-count\-spec\-in\-critical\-path\fR
612.Sp
613\&\fIM32R/D Options\fR
614\&\fB\-m32r2 \-m32rx \-m32r
615\&\-mdebug
616\&\-malign\-loops \-mno\-align\-loops
617\&\-missue\-rate=\fR\fInumber\fR
618\&\fB\-mbranch\-cost=\fR\fInumber\fR
619\&\fB\-mmodel=\fR\fIcode-size-model-type\fR
620\&\fB\-msdata=\fR\fIsdata-type\fR
621\&\fB\-mno\-flush\-func \-mflush\-func=\fR\fIname\fR
622\&\fB\-mno\-flush\-trap \-mflush\-trap=\fR\fInumber\fR
623\&\fB\-G\fR \fInum\fR
624.Sp
625\&\fIM32C Options\fR
626\&\fB\-mcpu=\fR\fIcpu\fR \fB\-msim \-memregs=\fR\fInumber\fR
627.Sp
628\&\fIM680x0 Options\fR
629\&\fB\-march=\fR\fIarch\fR \fB\-mcpu=\fR\fIcpu\fR \fB\-mtune=\fR\fItune\fR
630\&\fB\-m68000 \-m68020 \-m68020\-40 \-m68020\-60 \-m68030 \-m68040
631\&\-m68060 \-mcpu32 \-m5200 \-m5206e \-m528x \-m5307 \-m5407
632\&\-mcfv4e \-mbitfield \-mno\-bitfield \-mc68000 \-mc68020
633\&\-mnobitfield \-mrtd \-mno\-rtd \-mdiv \-mno\-div \-mshort
634\&\-mno\-short \-mhard\-float \-m68881 \-msoft\-float \-mpcrel
635\&\-malign\-int \-mstrict\-align \-msep\-data \-mno\-sep\-data
636\&\-mshared\-library\-id=n \-mid\-shared\-library \-mno\-id\-shared\-library
637\&\-mxgot \-mno\-xgot\fR
638.Sp
639\&\fIM68hc1x Options\fR
640\&\fB\-m6811 \-m6812 \-m68hc11 \-m68hc12 \-m68hcs12
641\&\-mauto\-incdec \-minmax \-mlong\-calls \-mshort
642\&\-msoft\-reg\-count=\fR\fIcount\fR
643.Sp
644\&\fIMCore Options\fR
645\&\fB\-mhardlit \-mno\-hardlit \-mdiv \-mno\-div \-mrelax\-immediates
646\&\-mno\-relax\-immediates \-mwide\-bitfields \-mno\-wide\-bitfields
647\&\-m4byte\-functions \-mno\-4byte\-functions \-mcallgraph\-data
648\&\-mno\-callgraph\-data \-mslow\-bytes \-mno\-slow\-bytes \-mno\-lsim
649\&\-mlittle\-endian \-mbig\-endian \-m210 \-m340 \-mstack\-increment\fR
650.Sp
651\&\fI\s-1MIPS\s0 Options\fR
652\&\fB\-EL \-EB \-march=\fR\fIarch\fR \fB\-mtune=\fR\fIarch\fR
653\&\fB\-mips1 \-mips2 \-mips3 \-mips4 \-mips32 \-mips32r2
654\&\-mips64 \-mips64r2
655\&\-mips16 \-mno\-mips16 \-mflip\-mips16
656\&\-minterlink\-mips16 \-mno\-interlink\-mips16
657\&\-mabi=\fR\fIabi\fR \fB\-mabicalls \-mno\-abicalls
658\&\-mshared \-mno\-shared \-mplt \-mno\-plt \-mxgot \-mno\-xgot
659\&\-mgp32 \-mgp64 \-mfp32 \-mfp64 \-mhard\-float \-msoft\-float
660\&\-msingle\-float \-mdouble\-float \-mdsp \-mno\-dsp \-mdspr2 \-mno\-dspr2
661\&\-mfpu=\fR\fIfpu-type\fR
662\&\fB\-msmartmips \-mno\-smartmips
663\&\-mpaired\-single \-mno\-paired\-single \-mdmx \-mno\-mdmx
664\&\-mips3d \-mno\-mips3d \-mmt \-mno\-mt \-mllsc \-mno\-llsc
665\&\-mlong64 \-mlong32 \-msym32 \-mno\-sym32
666\&\-G\fR\fInum\fR \fB\-mlocal\-sdata \-mno\-local\-sdata
667\&\-mextern\-sdata \-mno\-extern\-sdata \-mgpopt \-mno\-gopt
668\&\-membedded\-data \-mno\-embedded\-data
669\&\-muninit\-const\-in\-rodata \-mno\-uninit\-const\-in\-rodata
670\&\-mcode\-readable=\fR\fIsetting\fR
671\&\fB\-msplit\-addresses \-mno\-split\-addresses
672\&\-mexplicit\-relocs \-mno\-explicit\-relocs
673\&\-mcheck\-zero\-division \-mno\-check\-zero\-division
674\&\-mdivide\-traps \-mdivide\-breaks
675\&\-mmemcpy \-mno\-memcpy \-mlong\-calls \-mno\-long\-calls
676\&\-mmad \-mno\-mad \-mfused\-madd \-mno\-fused\-madd \-nocpp
677\&\-mfix\-r4000 \-mno\-fix\-r4000 \-mfix\-r4400 \-mno\-fix\-r4400
678\&\-mfix\-r10000 \-mno\-fix\-r10000 \-mfix\-vr4120 \-mno\-fix\-vr4120
679\&\-mfix\-vr4130 \-mno\-fix\-vr4130 \-mfix\-sb1 \-mno\-fix\-sb1
680\&\-mflush\-func=\fR\fIfunc\fR \fB\-mno\-flush\-func
681\&\-mbranch\-cost=\fR\fInum\fR \fB\-mbranch\-likely \-mno\-branch\-likely
682\&\-mfp\-exceptions \-mno\-fp\-exceptions
683\&\-mvr4130\-align \-mno\-vr4130\-align\fR
684.Sp
685\&\fI\s-1MMIX\s0 Options\fR
686\&\fB\-mlibfuncs \-mno\-libfuncs \-mepsilon \-mno\-epsilon \-mabi=gnu
687\&\-mabi=mmixware \-mzero\-extend \-mknuthdiv \-mtoplevel\-symbols
688\&\-melf \-mbranch\-predict \-mno\-branch\-predict \-mbase\-addresses
689\&\-mno\-base\-addresses \-msingle\-exit \-mno\-single\-exit\fR
690.Sp
691\&\fI\s-1MN10300\s0 Options\fR
692\&\fB\-mmult\-bug \-mno\-mult\-bug
693\&\-mam33 \-mno\-am33
694\&\-mam33\-2 \-mno\-am33\-2
695\&\-mreturn\-pointer\-on\-d0
696\&\-mno\-crt0 \-mrelax\fR
697.Sp
698\&\fI\s-1PDP\-11\s0 Options\fR
699\&\fB\-mfpu \-msoft\-float \-mac0 \-mno\-ac0 \-m40 \-m45 \-m10
700\&\-mbcopy \-mbcopy\-builtin \-mint32 \-mno\-int16
701\&\-mint16 \-mno\-int32 \-mfloat32 \-mno\-float64
702\&\-mfloat64 \-mno\-float32 \-mabshi \-mno\-abshi
703\&\-mbranch\-expensive \-mbranch\-cheap
704\&\-msplit \-mno\-split \-munix\-asm \-mdec\-asm\fR
705.Sp
706\&\fIpicoChip Options\fR
707\&\fB\-mae=\fR\fIae_type\fR \fB\-mvliw\-lookahead=\fR\fIN\fR
708\&\fB\-msymbol\-as\-address \-mno\-inefficient\-warnings\fR
709.Sp
710\&\fIPowerPC Options\fR
711See \s-1RS/6000\s0 and PowerPC Options.
712.Sp
713\&\fI\s-1RS/6000\s0 and PowerPC Options\fR
714\&\fB\-mcpu=\fR\fIcpu-type\fR
715\&\fB\-mtune=\fR\fIcpu-type\fR
716\&\fB\-mpower \-mno\-power \-mpower2 \-mno\-power2
717\&\-mpowerpc \-mpowerpc64 \-mno\-powerpc
718\&\-maltivec \-mno\-altivec
719\&\-mpowerpc\-gpopt \-mno\-powerpc\-gpopt
720\&\-mpowerpc\-gfxopt \-mno\-powerpc\-gfxopt
721\&\-mmfcrf \-mno\-mfcrf \-mpopcntb \-mno\-popcntb \-mfprnd \-mno\-fprnd
722\&\-mcmpb \-mno\-cmpb \-mmfpgpr \-mno\-mfpgpr \-mhard\-dfp \-mno\-hard\-dfp
723\&\-mnew\-mnemonics \-mold\-mnemonics
724\&\-mfull\-toc \-mminimal\-toc \-mno\-fp\-in\-toc \-mno\-sum\-in\-toc
725\&\-m64 \-m32 \-mxl\-compat \-mno\-xl\-compat \-mpe
726\&\-malign\-power \-malign\-natural
727\&\-msoft\-float \-mhard\-float \-mmultiple \-mno\-multiple
728\&\-msingle\-float \-mdouble\-float \-msimple\-fpu
729\&\-mstring \-mno\-string \-mupdate \-mno\-update
730\&\-mavoid\-indexed\-addresses \-mno\-avoid\-indexed\-addresses
731\&\-mfused\-madd \-mno\-fused\-madd \-mbit\-align \-mno\-bit\-align
732\&\-mstrict\-align \-mno\-strict\-align \-mrelocatable
733\&\-mno\-relocatable \-mrelocatable\-lib \-mno\-relocatable\-lib
734\&\-mtoc \-mno\-toc \-mlittle \-mlittle\-endian \-mbig \-mbig\-endian
735\&\-mdynamic\-no\-pic \-maltivec \-mswdiv
736\&\-mprioritize\-restricted\-insns=\fR\fIpriority\fR
737\&\fB\-msched\-costly\-dep=\fR\fIdependence_type\fR
738\&\fB\-minsert\-sched\-nops=\fR\fIscheme\fR
739\&\fB\-mcall\-sysv \-mcall\-netbsd
740\&\-maix\-struct\-return \-msvr4\-struct\-return
741\&\-mabi=\fR\fIabi-type\fR \fB\-msecure\-plt \-mbss\-plt
742\&\-misel \-mno\-isel
743\&\-misel=yes \-misel=no
744\&\-mspe \-mno\-spe
745\&\-mspe=yes \-mspe=no
746\&\-mpaired
747\&\-mgen\-cell\-microcode \-mwarn\-cell\-microcode
748\&\-mvrsave \-mno\-vrsave
749\&\-mmulhw \-mno\-mulhw
750\&\-mdlmzb \-mno\-dlmzb
751\&\-mfloat\-gprs=yes \-mfloat\-gprs=no \-mfloat\-gprs=single \-mfloat\-gprs=double
752\&\-mprototype \-mno\-prototype
753\&\-msim \-mmvme \-mads \-myellowknife \-memb \-msdata
754\&\-msdata=\fR\fIopt\fR \fB\-mvxworks \-G\fR \fInum\fR \fB\-pthread\fR
755.Sp
756\&\fIS/390 and zSeries Options\fR
757\&\fB\-mtune=\fR\fIcpu-type\fR \fB\-march=\fR\fIcpu-type\fR
758\&\fB\-mhard\-float \-msoft\-float \-mhard\-dfp \-mno\-hard\-dfp
759\&\-mlong\-double\-64 \-mlong\-double\-128
760\&\-mbackchain \-mno\-backchain \-mpacked\-stack \-mno\-packed\-stack
761\&\-msmall\-exec \-mno\-small\-exec \-mmvcle \-mno\-mvcle
762\&\-m64 \-m31 \-mdebug \-mno\-debug \-mesa \-mzarch
763\&\-mtpf\-trace \-mno\-tpf\-trace \-mfused\-madd \-mno\-fused\-madd
764\&\-mwarn\-framesize \-mwarn\-dynamicstack \-mstack\-size \-mstack\-guard\fR
765.Sp
766\&\fIScore Options\fR
767\&\fB\-meb \-mel
768\&\-mnhwloop
769\&\-muls
770\&\-mmac
771\&\-mscore5 \-mscore5u \-mscore7 \-mscore7d\fR
772.Sp
773\&\fI\s-1SH\s0 Options\fR
774\&\fB\-m1 \-m2 \-m2e \-m3 \-m3e
775\&\-m4\-nofpu \-m4\-single\-only \-m4\-single \-m4
776\&\-m4a\-nofpu \-m4a\-single\-only \-m4a\-single \-m4a \-m4al
777\&\-m5\-64media \-m5\-64media\-nofpu
778\&\-m5\-32media \-m5\-32media\-nofpu
779\&\-m5\-compact \-m5\-compact\-nofpu
780\&\-mb \-ml \-mdalign \-mrelax
781\&\-mbigtable \-mfmovd \-mhitachi \-mrenesas \-mno\-renesas \-mnomacsave
782\&\-mieee \-mbitops \-misize \-minline\-ic_invalidate \-mpadstruct \-mspace
783\&\-mprefergot \-musermode \-multcost=\fR\fInumber\fR \fB\-mdiv=\fR\fIstrategy\fR
784\&\fB\-mdivsi3_libfunc=\fR\fIname\fR \fB\-mfixed\-range=\fR\fIregister-range\fR
785\&\fB\-madjust\-unroll \-mindexed\-addressing \-mgettrcost=\fR\fInumber\fR \fB\-mpt\-fixed
786\&\-minvalid\-symbols\fR
787.Sp
788\&\fI\s-1SPARC\s0 Options\fR
789\&\fB\-mcpu=\fR\fIcpu-type\fR
790\&\fB\-mtune=\fR\fIcpu-type\fR
791\&\fB\-mcmodel=\fR\fIcode-model\fR
792\&\fB\-m32 \-m64 \-mapp\-regs \-mno\-app\-regs
793\&\-mfaster\-structs \-mno\-faster\-structs
794\&\-mfpu \-mno\-fpu \-mhard\-float \-msoft\-float
795\&\-mhard\-quad\-float \-msoft\-quad\-float
796\&\-mimpure\-text \-mno\-impure\-text \-mlittle\-endian
797\&\-mstack\-bias \-mno\-stack\-bias
798\&\-munaligned\-doubles \-mno\-unaligned\-doubles
799\&\-mv8plus \-mno\-v8plus \-mvis \-mno\-vis
800\&\-threads \-pthreads \-pthread\fR
801.Sp
802\&\fI\s-1SPU\s0 Options\fR
803\&\fB\-mwarn\-reloc \-merror\-reloc
804\&\-msafe\-dma \-munsafe\-dma
805\&\-mbranch\-hints
806\&\-msmall\-mem \-mlarge\-mem \-mstdmain
807\&\-mfixed\-range=\fR\fIregister-range\fR
808.Sp
809\&\fISystem V Options\fR
810\&\fB\-Qy \-Qn \-YP,\fR\fIpaths\fR \fB\-Ym,\fR\fIdir\fR
811.Sp
812\&\fIV850 Options\fR
813\&\fB\-mlong\-calls \-mno\-long\-calls \-mep \-mno\-ep
814\&\-mprolog\-function \-mno\-prolog\-function \-mspace
815\&\-mtda=\fR\fIn\fR \fB\-msda=\fR\fIn\fR \fB\-mzda=\fR\fIn\fR
816\&\fB\-mapp\-regs \-mno\-app\-regs
817\&\-mdisable\-callt \-mno\-disable\-callt
818\&\-mv850e1
819\&\-mv850e
820\&\-mv850 \-mbig\-switch\fR
821.Sp
822\&\fI\s-1VAX\s0 Options\fR
823\&\fB\-mg \-mgnu \-munix\fR
824.Sp
825\&\fIVxWorks Options\fR
826\&\fB\-mrtp \-non\-static \-Bstatic \-Bdynamic
827\&\-Xbind\-lazy \-Xbind\-now\fR
828.Sp
829\&\fIx86\-64 Options\fR
830See i386 and x86\-64 Options.
831.Sp
832\&\fIi386 and x86\-64 Windows Options\fR
833\&\fB\-mconsole \-mcygwin \-mno\-cygwin \-mdll
834\&\-mnop\-fun\-dllimport \-mthread \-mwin32 \-mwindows\fR
835.Sp
836\&\fIXstormy16 Options\fR
837\&\fB\-msim\fR
838.Sp
839\&\fIXtensa Options\fR
840\&\fB\-mconst16 \-mno\-const16
841\&\-mfused\-madd \-mno\-fused\-madd
842\&\-mserialize\-volatile \-mno\-serialize\-volatile
843\&\-mtext\-section\-literals \-mno\-text\-section\-literals
844\&\-mtarget\-align \-mno\-target\-align
845\&\-mlongcalls \-mno\-longcalls\fR
846.Sp
847\&\fIzSeries Options\fR
848See S/390 and zSeries Options.
849.IP "\fICode Generation Options\fR" 4
850.IX Item "Code Generation Options"
851\&\fB\-fcall\-saved\-\fR\fIreg\fR \fB\-fcall\-used\-\fR\fIreg\fR
852\&\fB\-ffixed\-\fR\fIreg\fR \fB\-fexceptions
853\&\-fnon\-call\-exceptions \-funwind\-tables
854\&\-fasynchronous\-unwind\-tables
855\&\-finhibit\-size\-directive \-finstrument\-functions
856\&\-finstrument\-functions\-exclude\-function\-list=\fR\fIsym\fR\fB,\fR\fIsym\fR\fB,...
857\&\-finstrument\-functions\-exclude\-file\-list=\fR\fIfile\fR\fB,\fR\fIfile\fR\fB,...
858\&\-fno\-common \-fno\-ident
859\&\-fpcc\-struct\-return \-fpic \-fPIC \-fpie \-fPIE
860\&\-fno\-jump\-tables
861\&\-frecord\-gcc\-switches
862\&\-freg\-struct\-return \-fshort\-enums
863\&\-fshort\-double \-fshort\-wchar
864\&\-fverbose\-asm \-fpack\-struct[=\fR\fIn\fR\fB] \-fstack\-check
865\&\-fstack\-limit\-register=\fR\fIreg\fR \fB\-fstack\-limit\-symbol=\fR\fIsym\fR
866\&\fB\-fno\-stack\-limit \-fargument\-alias \-fargument\-noalias
867\&\-fargument\-noalias\-global \-fargument\-noalias\-anything
868\&\-fleading\-underscore \-ftls\-model=\fR\fImodel\fR
869\&\fB\-ftrapv \-fwrapv \-fbounds\-check
870\&\-fvisibility\fR
4b1e227d 871.SS "Options Controlling the Kind of Output"
c251ad9e
SS
872.IX Subsection "Options Controlling the Kind of Output"
873Compilation can involve up to four stages: preprocessing, compilation
874proper, assembly and linking, always in that order. \s-1GCC\s0 is capable of
875preprocessing and compiling several files either into several
876assembler input files, or into one assembler input file; then each
877assembler input file produces an object file, and linking combines all
878the object files (those newly compiled, and those specified as input)
879into an executable file.
880.PP
881For any given input file, the file name suffix determines what kind of
882compilation is done:
883.IP "\fIfile\fR\fB.c\fR" 4
884.IX Item "file.c"
885C source code which must be preprocessed.
886.IP "\fIfile\fR\fB.i\fR" 4
887.IX Item "file.i"
888C source code which should not be preprocessed.
889.IP "\fIfile\fR\fB.ii\fR" 4
890.IX Item "file.ii"
891\&\*(C+ source code which should not be preprocessed.
892.IP "\fIfile\fR\fB.m\fR" 4
893.IX Item "file.m"
894Objective-C source code. Note that you must link with the \fIlibobjc\fR
895library to make an Objective-C program work.
896.IP "\fIfile\fR\fB.mi\fR" 4
897.IX Item "file.mi"
898Objective-C source code which should not be preprocessed.
899.IP "\fIfile\fR\fB.mm\fR" 4
900.IX Item "file.mm"
901.PD 0
902.IP "\fIfile\fR\fB.M\fR" 4
903.IX Item "file.M"
904.PD
905Objective\-\*(C+ source code. Note that you must link with the \fIlibobjc\fR
906library to make an Objective\-\*(C+ program work. Note that \fB.M\fR refers
907to a literal capital M.
908.IP "\fIfile\fR\fB.mii\fR" 4
909.IX Item "file.mii"
910Objective\-\*(C+ source code which should not be preprocessed.
911.IP "\fIfile\fR\fB.h\fR" 4
912.IX Item "file.h"
913C, \*(C+, Objective-C or Objective\-\*(C+ header file to be turned into a
914precompiled header.
915.IP "\fIfile\fR\fB.cc\fR" 4
916.IX Item "file.cc"
917.PD 0
918.IP "\fIfile\fR\fB.cp\fR" 4
919.IX Item "file.cp"
920.IP "\fIfile\fR\fB.cxx\fR" 4
921.IX Item "file.cxx"
922.IP "\fIfile\fR\fB.cpp\fR" 4
923.IX Item "file.cpp"
924.IP "\fIfile\fR\fB.CPP\fR" 4
925.IX Item "file.CPP"
926.IP "\fIfile\fR\fB.c++\fR" 4
927.IX Item "file.c++"
928.IP "\fIfile\fR\fB.C\fR" 4
929.IX Item "file.C"
930.PD
931\&\*(C+ source code which must be preprocessed. Note that in \fB.cxx\fR,
932the last two letters must both be literally \fBx\fR. Likewise,
933\&\fB.C\fR refers to a literal capital C.
934.IP "\fIfile\fR\fB.mm\fR" 4
935.IX Item "file.mm"
936.PD 0
937.IP "\fIfile\fR\fB.M\fR" 4
938.IX Item "file.M"
939.PD
940Objective\-\*(C+ source code which must be preprocessed.
941.IP "\fIfile\fR\fB.mii\fR" 4
942.IX Item "file.mii"
943Objective\-\*(C+ source code which should not be preprocessed.
944.IP "\fIfile\fR\fB.hh\fR" 4
945.IX Item "file.hh"
946.PD 0
947.IP "\fIfile\fR\fB.H\fR" 4
948.IX Item "file.H"
949.IP "\fIfile\fR\fB.hp\fR" 4
950.IX Item "file.hp"
951.IP "\fIfile\fR\fB.hxx\fR" 4
952.IX Item "file.hxx"
953.IP "\fIfile\fR\fB.hpp\fR" 4
954.IX Item "file.hpp"
955.IP "\fIfile\fR\fB.HPP\fR" 4
956.IX Item "file.HPP"
957.IP "\fIfile\fR\fB.h++\fR" 4
958.IX Item "file.h++"
959.IP "\fIfile\fR\fB.tcc\fR" 4
960.IX Item "file.tcc"
961.PD
962\&\*(C+ header file to be turned into a precompiled header.
963.IP "\fIfile\fR\fB.f\fR" 4
964.IX Item "file.f"
965.PD 0
966.IP "\fIfile\fR\fB.for\fR" 4
967.IX Item "file.for"
968.IP "\fIfile\fR\fB.ftn\fR" 4
969.IX Item "file.ftn"
970.PD
971Fixed form Fortran source code which should not be preprocessed.
972.IP "\fIfile\fR\fB.F\fR" 4
973.IX Item "file.F"
974.PD 0
975.IP "\fIfile\fR\fB.FOR\fR" 4
976.IX Item "file.FOR"
977.IP "\fIfile\fR\fB.fpp\fR" 4
978.IX Item "file.fpp"
979.IP "\fIfile\fR\fB.FPP\fR" 4
980.IX Item "file.FPP"
981.IP "\fIfile\fR\fB.FTN\fR" 4
982.IX Item "file.FTN"
983.PD
984Fixed form Fortran source code which must be preprocessed (with the traditional
985preprocessor).
986.IP "\fIfile\fR\fB.f90\fR" 4
987.IX Item "file.f90"
988.PD 0
989.IP "\fIfile\fR\fB.f95\fR" 4
990.IX Item "file.f95"
991.IP "\fIfile\fR\fB.f03\fR" 4
992.IX Item "file.f03"
993.IP "\fIfile\fR\fB.f08\fR" 4
994.IX Item "file.f08"
995.PD
996Free form Fortran source code which should not be preprocessed.
997.IP "\fIfile\fR\fB.F90\fR" 4
998.IX Item "file.F90"
999.PD 0
1000.IP "\fIfile\fR\fB.F95\fR" 4
1001.IX Item "file.F95"
1002.IP "\fIfile\fR\fB.F03\fR" 4
1003.IX Item "file.F03"
1004.IP "\fIfile\fR\fB.F08\fR" 4
1005.IX Item "file.F08"
1006.PD
1007Free form Fortran source code which must be preprocessed (with the
1008traditional preprocessor).
1009.IP "\fIfile\fR\fB.ads\fR" 4
1010.IX Item "file.ads"
1011Ada source code file which contains a library unit declaration (a
1012declaration of a package, subprogram, or generic, or a generic
1013instantiation), or a library unit renaming declaration (a package,
1014generic, or subprogram renaming declaration). Such files are also
1015called \fIspecs\fR.
1016.IP "\fIfile\fR\fB.adb\fR" 4
1017.IX Item "file.adb"
1018Ada source code file containing a library unit body (a subprogram or
1019package body). Such files are also called \fIbodies\fR.
1020.IP "\fIfile\fR\fB.s\fR" 4
1021.IX Item "file.s"
1022Assembler code.
1023.IP "\fIfile\fR\fB.S\fR" 4
1024.IX Item "file.S"
1025.PD 0
1026.IP "\fIfile\fR\fB.sx\fR" 4
1027.IX Item "file.sx"
1028.PD
1029Assembler code which must be preprocessed.
1030.IP "\fIother\fR" 4
1031.IX Item "other"
1032An object file to be fed straight into linking.
1033Any file name with no recognized suffix is treated this way.
1034.PP
1035You can specify the input language explicitly with the \fB\-x\fR option:
1036.IP "\fB\-x\fR \fIlanguage\fR" 4
1037.IX Item "-x language"
1038Specify explicitly the \fIlanguage\fR for the following input files
1039(rather than letting the compiler choose a default based on the file
1040name suffix). This option applies to all following input files until
1041the next \fB\-x\fR option. Possible values for \fIlanguage\fR are:
1042.Sp
1043.Vb 8
1044\& c c\-header c\-cpp\-output
1045\& c++ c++\-header c++\-cpp\-output
1046\& objective\-c objective\-c\-header objective\-c\-cpp\-output
1047\& objective\-c++ objective\-c++\-header objective\-c++\-cpp\-output
1048\& assembler assembler\-with\-cpp
1049\& ada
1050\& f77 f77\-cpp\-input f95 f95\-cpp\-input
1051\& java
1052.Ve
1053.IP "\fB\-x none\fR" 4
1054.IX Item "-x none"
1055Turn off any specification of a language, so that subsequent files are
1056handled according to their file name suffixes (as they are if \fB\-x\fR
1057has not been used at all).
1058.IP "\fB\-pass\-exit\-codes\fR" 4
1059.IX Item "-pass-exit-codes"
1060Normally the \fBgcc\fR program will exit with the code of 1 if any
1061phase of the compiler returns a non-success return code. If you specify
1062\&\fB\-pass\-exit\-codes\fR, the \fBgcc\fR program will instead return with
1063numerically highest error produced by any phase that returned an error
1064indication. The C, \*(C+, and Fortran frontends return 4, if an internal
1065compiler error is encountered.
1066.PP
1067If you only want some of the stages of compilation, you can use
1068\&\fB\-x\fR (or filename suffixes) to tell \fBgcc\fR where to start, and
1069one of the options \fB\-c\fR, \fB\-S\fR, or \fB\-E\fR to say where
1070\&\fBgcc\fR is to stop. Note that some combinations (for example,
1071\&\fB\-x cpp-output \-E\fR) instruct \fBgcc\fR to do nothing at all.
1072.IP "\fB\-c\fR" 4
1073.IX Item "-c"
1074Compile or assemble the source files, but do not link. The linking
1075stage simply is not done. The ultimate output is in the form of an
1076object file for each source file.
1077.Sp
1078By default, the object file name for a source file is made by replacing
1079the suffix \fB.c\fR, \fB.i\fR, \fB.s\fR, etc., with \fB.o\fR.
1080.Sp
1081Unrecognized input files, not requiring compilation or assembly, are
1082ignored.
1083.IP "\fB\-S\fR" 4
1084.IX Item "-S"
1085Stop after the stage of compilation proper; do not assemble. The output
1086is in the form of an assembler code file for each non-assembler input
1087file specified.
1088.Sp
1089By default, the assembler file name for a source file is made by
1090replacing the suffix \fB.c\fR, \fB.i\fR, etc., with \fB.s\fR.
1091.Sp
1092Input files that don't require compilation are ignored.
1093.IP "\fB\-E\fR" 4
1094.IX Item "-E"
1095Stop after the preprocessing stage; do not run the compiler proper. The
1096output is in the form of preprocessed source code, which is sent to the
1097standard output.
1098.Sp
1099Input files which don't require preprocessing are ignored.
1100.IP "\fB\-o\fR \fIfile\fR" 4
1101.IX Item "-o file"
1102Place output in file \fIfile\fR. This applies regardless to whatever
1103sort of output is being produced, whether it be an executable file,
1104an object file, an assembler file or preprocessed C code.
1105.Sp
1106If \fB\-o\fR is not specified, the default is to put an executable
1107file in \fIa.out\fR, the object file for
1108\&\fI\fIsource\fI.\fIsuffix\fI\fR in \fI\fIsource\fI.o\fR, its
1109assembler file in \fI\fIsource\fI.s\fR, a precompiled header file in
1110\&\fI\fIsource\fI.\fIsuffix\fI.gch\fR, and all preprocessed C source on
1111standard output.
1112.IP "\fB\-v\fR" 4
1113.IX Item "-v"
1114Print (on standard error output) the commands executed to run the stages
1115of compilation. Also print the version number of the compiler driver
1116program and of the preprocessor and the compiler proper.
1117.IP "\fB\-###\fR" 4
1118.IX Item "-###"
1119Like \fB\-v\fR except the commands are not executed and all command
1120arguments are quoted. This is useful for shell scripts to capture the
1121driver-generated command lines.
1122.IP "\fB\-pipe\fR" 4
1123.IX Item "-pipe"
1124Use pipes rather than temporary files for communication between the
1125various stages of compilation. This fails to work on some systems where
1126the assembler is unable to read from a pipe; but the \s-1GNU\s0 assembler has
1127no trouble.
1128.IP "\fB\-combine\fR" 4
1129.IX Item "-combine"
1130If you are compiling multiple source files, this option tells the driver
1131to pass all the source files to the compiler at once (for those
1132languages for which the compiler can handle this). This will allow
1133intermodule analysis (\s-1IMA\s0) to be performed by the compiler. Currently the only
1134language for which this is supported is C. If you pass source files for
1135multiple languages to the driver, using this option, the driver will invoke
1136the compiler(s) that support \s-1IMA\s0 once each, passing each compiler all the
1137source files appropriate for it. For those languages that do not support
1138\&\s-1IMA\s0 this option will be ignored, and the compiler will be invoked once for
1139each source file in that language. If you use this option in conjunction
1140with \fB\-save\-temps\fR, the compiler will generate multiple
1141pre-processed files
1142(one for each source file), but only one (combined) \fI.o\fR or
1143\&\fI.s\fR file.
1144.IP "\fB\-\-help\fR" 4
1145.IX Item "--help"
1146Print (on the standard output) a description of the command line options
1147understood by \fBgcc\fR. If the \fB\-v\fR option is also specified
1148then \fB\-\-help\fR will also be passed on to the various processes
1149invoked by \fBgcc\fR, so that they can display the command line options
1150they accept. If the \fB\-Wextra\fR option has also been specified
1151(prior to the \fB\-\-help\fR option), then command line options which
1152have no documentation associated with them will also be displayed.
1153.IP "\fB\-\-target\-help\fR" 4
1154.IX Item "--target-help"
1155Print (on the standard output) a description of target-specific command
1156line options for each tool. For some targets extra target-specific
1157information may also be printed.
1158.IP "\fB\-\-help={\fR\fIclass\fR|[\fB^\fR]\fIqualifier\fR\fB}\fR[\fB,...\fR]" 4
1159.IX Item "--help={class|[^]qualifier}[,...]"
1160Print (on the standard output) a description of the command line
1161options understood by the compiler that fit into all specified classes
1162and qualifiers. These are the supported classes:
1163.RS 4
1164.IP "\fBoptimizers\fR" 4
1165.IX Item "optimizers"
1166This will display all of the optimization options supported by the
1167compiler.
1168.IP "\fBwarnings\fR" 4
1169.IX Item "warnings"
1170This will display all of the options controlling warning messages
1171produced by the compiler.
1172.IP "\fBtarget\fR" 4
1173.IX Item "target"
1174This will display target-specific options. Unlike the
1175\&\fB\-\-target\-help\fR option however, target-specific options of the
1176linker and assembler will not be displayed. This is because those
1177tools do not currently support the extended \fB\-\-help=\fR syntax.
1178.IP "\fBparams\fR" 4
1179.IX Item "params"
1180This will display the values recognized by the \fB\-\-param\fR
1181option.
1182.IP "\fIlanguage\fR" 4
1183.IX Item "language"
1184This will display the options supported for \fIlanguage\fR, where
1185\&\fIlanguage\fR is the name of one of the languages supported in this
1186version of \s-1GCC\s0.
1187.IP "\fBcommon\fR" 4
1188.IX Item "common"
1189This will display the options that are common to all languages.
1190.RE
1191.RS 4
1192.Sp
1193These are the supported qualifiers:
1194.IP "\fBundocumented\fR" 4
1195.IX Item "undocumented"
1196Display only those options which are undocumented.
1197.IP "\fBjoined\fR" 4
1198.IX Item "joined"
1199Display options which take an argument that appears after an equal
1200sign in the same continuous piece of text, such as:
1201\&\fB\-\-help=target\fR.
1202.IP "\fBseparate\fR" 4
1203.IX Item "separate"
1204Display options which take an argument that appears as a separate word
1205following the original option, such as: \fB\-o output-file\fR.
1206.RE
1207.RS 4
1208.Sp
1209Thus for example to display all the undocumented target-specific
1210switches supported by the compiler the following can be used:
1211.Sp
1212.Vb 1
1213\& \-\-help=target,undocumented
1214.Ve
1215.Sp
1216The sense of a qualifier can be inverted by prefixing it with the
1217\&\fB^\fR character, so for example to display all binary warning
1218options (i.e., ones that are either on or off and that do not take an
1219argument), which have a description the following can be used:
1220.Sp
1221.Vb 1
1222\& \-\-help=warnings,^joined,^undocumented
1223.Ve
1224.Sp
1225The argument to \fB\-\-help=\fR should not consist solely of inverted
1226qualifiers.
1227.Sp
1228Combining several classes is possible, although this usually
1229restricts the output by so much that there is nothing to display. One
1230case where it does work however is when one of the classes is
1231\&\fItarget\fR. So for example to display all the target-specific
1232optimization options the following can be used:
1233.Sp
1234.Vb 1
1235\& \-\-help=target,optimizers
1236.Ve
1237.Sp
1238The \fB\-\-help=\fR option can be repeated on the command line. Each
1239successive use will display its requested class of options, skipping
1240those that have already been displayed.
1241.Sp
1242If the \fB\-Q\fR option appears on the command line before the
1243\&\fB\-\-help=\fR option, then the descriptive text displayed by
1244\&\fB\-\-help=\fR is changed. Instead of describing the displayed
1245options, an indication is given as to whether the option is enabled,
1246disabled or set to a specific value (assuming that the compiler
1247knows this at the point where the \fB\-\-help=\fR option is used).
1248.Sp
1249Here is a truncated example from the \s-1ARM\s0 port of \fBgcc\fR:
1250.Sp
1251.Vb 5
1252\& % gcc \-Q \-mabi=2 \-\-help=target \-c
1253\& The following options are target specific:
1254\& \-mabi= 2
1255\& \-mabort\-on\-noreturn [disabled]
1256\& \-mapcs [disabled]
1257.Ve
1258.Sp
1259The output is sensitive to the effects of previous command line
1260options, so for example it is possible to find out which optimizations
1261are enabled at \fB\-O2\fR by using:
1262.Sp
1263.Vb 1
1264\& \-Q \-O2 \-\-help=optimizers
1265.Ve
1266.Sp
1267Alternatively you can discover which binary optimizations are enabled
1268by \fB\-O3\fR by using:
1269.Sp
1270.Vb 3
1271\& gcc \-c \-Q \-O3 \-\-help=optimizers > /tmp/O3\-opts
1272\& gcc \-c \-Q \-O2 \-\-help=optimizers > /tmp/O2\-opts
1273\& diff /tmp/O2\-opts /tmp/O3\-opts | grep enabled
1274.Ve
1275.RE
1276.IP "\fB\-\-version\fR" 4
1277.IX Item "--version"
1278Display the version number and copyrights of the invoked \s-1GCC\s0.
1279.IP "\fB\-wrapper\fR" 4
1280.IX Item "-wrapper"
1281Invoke all subcommands under a wrapper program. It takes a single
1282comma separated list as an argument, which will be used to invoke
1283the wrapper:
1284.Sp
1285.Vb 1
1286\& gcc \-c t.c \-wrapper gdb,\-\-args
1287.Ve
1288.Sp
1289This will invoke all subprograms of gcc under \*(L"gdb \-\-args\*(R",
1290thus cc1 invocation will be \*(L"gdb \-\-args cc1 ...\*(R".
1291.IP "\fB@\fR\fIfile\fR" 4
1292.IX Item "@file"
1293Read command-line options from \fIfile\fR. The options read are
1294inserted in place of the original @\fIfile\fR option. If \fIfile\fR
1295does not exist, or cannot be read, then the option will be treated
1296literally, and not removed.
1297.Sp
1298Options in \fIfile\fR are separated by whitespace. A whitespace
1299character may be included in an option by surrounding the entire
1300option in either single or double quotes. Any character (including a
1301backslash) may be included by prefixing the character to be included
1302with a backslash. The \fIfile\fR may itself contain additional
1303@\fIfile\fR options; any such options will be processed recursively.
4b1e227d 1304.SS "Compiling \*(C+ Programs"
c251ad9e
SS
1305.IX Subsection "Compiling Programs"
1306\&\*(C+ source files conventionally use one of the suffixes \fB.C\fR,
1307\&\fB.cc\fR, \fB.cpp\fR, \fB.CPP\fR, \fB.c++\fR, \fB.cp\fR, or
1308\&\fB.cxx\fR; \*(C+ header files often use \fB.hh\fR, \fB.hpp\fR,
1309\&\fB.H\fR, or (for shared template code) \fB.tcc\fR; and
1310preprocessed \*(C+ files use the suffix \fB.ii\fR. \s-1GCC\s0 recognizes
1311files with these names and compiles them as \*(C+ programs even if you
1312call the compiler the same way as for compiling C programs (usually
1313with the name \fBgcc\fR).
1314.PP
1315However, the use of \fBgcc\fR does not add the \*(C+ library.
1316\&\fBg++\fR is a program that calls \s-1GCC\s0 and treats \fB.c\fR,
1317\&\fB.h\fR and \fB.i\fR files as \*(C+ source files instead of C source
1318files unless \fB\-x\fR is used, and automatically specifies linking
1319against the \*(C+ library. This program is also useful when
1320precompiling a C header file with a \fB.h\fR extension for use in \*(C+
1321compilations. On many systems, \fBg++\fR is also installed with
1322the name \fBc++\fR.
1323.PP
1324When you compile \*(C+ programs, you may specify many of the same
1325command-line options that you use for compiling programs in any
1326language; or command-line options meaningful for C and related
1327languages; or options that are meaningful only for \*(C+ programs.
4b1e227d 1328.SS "Options Controlling C Dialect"
c251ad9e
SS
1329.IX Subsection "Options Controlling C Dialect"
1330The following options control the dialect of C (or languages derived
1331from C, such as \*(C+, Objective-C and Objective\-\*(C+) that the compiler
1332accepts:
1333.IP "\fB\-ansi\fR" 4
1334.IX Item "-ansi"
1335In C mode, this is equivalent to \fB\-std=c89\fR. In \*(C+ mode, it is
1336equivalent to \fB\-std=c++98\fR.
1337.Sp
1338This turns off certain features of \s-1GCC\s0 that are incompatible with \s-1ISO\s0
1339C90 (when compiling C code), or of standard \*(C+ (when compiling \*(C+ code),
1340such as the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, and
1341predefined macros such as \f(CW\*(C`unix\*(C'\fR and \f(CW\*(C`vax\*(C'\fR that identify the
1342type of system you are using. It also enables the undesirable and
1343rarely used \s-1ISO\s0 trigraph feature. For the C compiler,
1344it disables recognition of \*(C+ style \fB//\fR comments as well as
1345the \f(CW\*(C`inline\*(C'\fR keyword.
1346.Sp
1347The alternate keywords \f(CW\*(C`_\|_asm_\|_\*(C'\fR, \f(CW\*(C`_\|_extension_\|_\*(C'\fR,
1348\&\f(CW\*(C`_\|_inline_\|_\*(C'\fR and \f(CW\*(C`_\|_typeof_\|_\*(C'\fR continue to work despite
1349\&\fB\-ansi\fR. You would not want to use them in an \s-1ISO\s0 C program, of
1350course, but it is useful to put them in header files that might be included
1351in compilations done with \fB\-ansi\fR. Alternate predefined macros
1352such as \f(CW\*(C`_\|_unix_\|_\*(C'\fR and \f(CW\*(C`_\|_vax_\|_\*(C'\fR are also available, with or
1353without \fB\-ansi\fR.
1354.Sp
1355The \fB\-ansi\fR option does not cause non-ISO programs to be
1356rejected gratuitously. For that, \fB\-pedantic\fR is required in
1357addition to \fB\-ansi\fR.
1358.Sp
1359The macro \f(CW\*(C`_\|_STRICT_ANSI_\|_\*(C'\fR is predefined when the \fB\-ansi\fR
1360option is used. Some header files may notice this macro and refrain
1361from declaring certain functions or defining certain macros that the
1362\&\s-1ISO\s0 standard doesn't call for; this is to avoid interfering with any
1363programs that might use these names for other things.
1364.Sp
1365Functions that would normally be built in but do not have semantics
1366defined by \s-1ISO\s0 C (such as \f(CW\*(C`alloca\*(C'\fR and \f(CW\*(C`ffs\*(C'\fR) are not built-in
1367functions when \fB\-ansi\fR is used.
1368.IP "\fB\-std=\fR" 4
1369.IX Item "-std="
1370Determine the language standard. This option
1371is currently only supported when compiling C or \*(C+.
1372.Sp
1373The compiler can accept several base standards, such as \fBc89\fR or
1374\&\fBc++98\fR, and \s-1GNU\s0 dialects of those standards, such as
1375\&\fBgnu89\fR or \fBgnu++98\fR. By specifying a base standard, the
1376compiler will accept all programs following that standard and those
1377using \s-1GNU\s0 extensions that do not contradict it. For example,
1378\&\fB\-std=c89\fR turns off certain features of \s-1GCC\s0 that are
1379incompatible with \s-1ISO\s0 C90, such as the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR
1380keywords, but not other \s-1GNU\s0 extensions that do not have a meaning in
1381\&\s-1ISO\s0 C90, such as omitting the middle term of a \f(CW\*(C`?:\*(C'\fR
1382expression. On the other hand, by specifying a \s-1GNU\s0 dialect of a
1383standard, all features the compiler support are enabled, even when
1384those features change the meaning of the base standard and some
1385strict-conforming programs may be rejected. The particular standard
1386is used by \fB\-pedantic\fR to identify which features are \s-1GNU\s0
1387extensions given that version of the standard. For example
1388\&\fB\-std=gnu89 \-pedantic\fR would warn about \*(C+ style \fB//\fR
1389comments, while \fB\-std=gnu99 \-pedantic\fR would not.
1390.Sp
1391A value for this option must be provided; possible values are
1392.RS 4
1393.IP "\fBc89\fR" 4
1394.IX Item "c89"
1395.PD 0
1396.IP "\fBiso9899:1990\fR" 4
1397.IX Item "iso9899:1990"
1398.PD
1399Support all \s-1ISO\s0 C90 programs (certain \s-1GNU\s0 extensions that conflict
1400with \s-1ISO\s0 C90 are disabled). Same as \fB\-ansi\fR for C code.
1401.IP "\fBiso9899:199409\fR" 4
1402.IX Item "iso9899:199409"
1403\&\s-1ISO\s0 C90 as modified in amendment 1.
1404.IP "\fBc99\fR" 4
1405.IX Item "c99"
1406.PD 0
1407.IP "\fBc9x\fR" 4
1408.IX Item "c9x"
1409.IP "\fBiso9899:1999\fR" 4
1410.IX Item "iso9899:1999"
1411.IP "\fBiso9899:199x\fR" 4
1412.IX Item "iso9899:199x"
1413.PD
1414\&\s-1ISO\s0 C99. Note that this standard is not yet fully supported; see
1415<\fBhttp://gcc.gnu.org/gcc\-4.4/c99status.html\fR> for more information. The
1416names \fBc9x\fR and \fBiso9899:199x\fR are deprecated.
1417.IP "\fBgnu89\fR" 4
1418.IX Item "gnu89"
1419\&\s-1GNU\s0 dialect of \s-1ISO\s0 C90 (including some C99 features). This
1420is the default for C code.
1421.IP "\fBgnu99\fR" 4
1422.IX Item "gnu99"
1423.PD 0
1424.IP "\fBgnu9x\fR" 4
1425.IX Item "gnu9x"
1426.PD
1427\&\s-1GNU\s0 dialect of \s-1ISO\s0 C99. When \s-1ISO\s0 C99 is fully implemented in \s-1GCC\s0,
1428this will become the default. The name \fBgnu9x\fR is deprecated.
1429.IP "\fBc++98\fR" 4
1430.IX Item "c++98"
1431The 1998 \s-1ISO\s0 \*(C+ standard plus amendments. Same as \fB\-ansi\fR for
1432\&\*(C+ code.
1433.IP "\fBgnu++98\fR" 4
1434.IX Item "gnu++98"
1435\&\s-1GNU\s0 dialect of \fB\-std=c++98\fR. This is the default for
1436\&\*(C+ code.
1437.IP "\fBc++0x\fR" 4
1438.IX Item "c++0x"
1439The working draft of the upcoming \s-1ISO\s0 \*(C+0x standard. This option
1440enables experimental features that are likely to be included in
1441\&\*(C+0x. The working draft is constantly changing, and any feature that is
1442enabled by this flag may be removed from future versions of \s-1GCC\s0 if it is
1443not part of the \*(C+0x standard.
1444.IP "\fBgnu++0x\fR" 4
1445.IX Item "gnu++0x"
1446\&\s-1GNU\s0 dialect of \fB\-std=c++0x\fR. This option enables
1447experimental features that may be removed in future versions of \s-1GCC\s0.
1448.RE
1449.RS 4
1450.RE
1451.IP "\fB\-fgnu89\-inline\fR" 4
1452.IX Item "-fgnu89-inline"
1453The option \fB\-fgnu89\-inline\fR tells \s-1GCC\s0 to use the traditional
1454\&\s-1GNU\s0 semantics for \f(CW\*(C`inline\*(C'\fR functions when in C99 mode.
1455 This option
1456is accepted and ignored by \s-1GCC\s0 versions 4.1.3 up to but not including
14574.3. In \s-1GCC\s0 versions 4.3 and later it changes the behavior of \s-1GCC\s0 in
1458C99 mode. Using this option is roughly equivalent to adding the
1459\&\f(CW\*(C`gnu_inline\*(C'\fR function attribute to all inline functions.
1460.Sp
1461The option \fB\-fno\-gnu89\-inline\fR explicitly tells \s-1GCC\s0 to use the
1462C99 semantics for \f(CW\*(C`inline\*(C'\fR when in C99 or gnu99 mode (i.e., it
1463specifies the default behavior). This option was first supported in
1464\&\s-1GCC\s0 4.3. This option is not supported in C89 or gnu89 mode.
1465.Sp
1466The preprocessor macros \f(CW\*(C`_\|_GNUC_GNU_INLINE_\|_\*(C'\fR and
1467\&\f(CW\*(C`_\|_GNUC_STDC_INLINE_\|_\*(C'\fR may be used to check which semantics are
1468in effect for \f(CW\*(C`inline\*(C'\fR functions.
1469.IP "\fB\-aux\-info\fR \fIfilename\fR" 4
1470.IX Item "-aux-info filename"
1471Output to the given filename prototyped declarations for all functions
1472declared and/or defined in a translation unit, including those in header
1473files. This option is silently ignored in any language other than C.
1474.Sp
1475Besides declarations, the file indicates, in comments, the origin of
1476each declaration (source file and line), whether the declaration was
1477implicit, prototyped or unprototyped (\fBI\fR, \fBN\fR for new or
1478\&\fBO\fR for old, respectively, in the first character after the line
1479number and the colon), and whether it came from a declaration or a
1480definition (\fBC\fR or \fBF\fR, respectively, in the following
1481character). In the case of function definitions, a K&R\-style list of
1482arguments followed by their declarations is also provided, inside
1483comments, after the declaration.
1484.IP "\fB\-fno\-asm\fR" 4
1485.IX Item "-fno-asm"
1486Do not recognize \f(CW\*(C`asm\*(C'\fR, \f(CW\*(C`inline\*(C'\fR or \f(CW\*(C`typeof\*(C'\fR as a
1487keyword, so that code can use these words as identifiers. You can use
1488the keywords \f(CW\*(C`_\|_asm_\|_\*(C'\fR, \f(CW\*(C`_\|_inline_\|_\*(C'\fR and \f(CW\*(C`_\|_typeof_\|_\*(C'\fR
1489instead. \fB\-ansi\fR implies \fB\-fno\-asm\fR.
1490.Sp
1491In \*(C+, this switch only affects the \f(CW\*(C`typeof\*(C'\fR keyword, since
1492\&\f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`inline\*(C'\fR are standard keywords. You may want to
1493use the \fB\-fno\-gnu\-keywords\fR flag instead, which has the same
1494effect. In C99 mode (\fB\-std=c99\fR or \fB\-std=gnu99\fR), this
1495switch only affects the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, since
1496\&\f(CW\*(C`inline\*(C'\fR is a standard keyword in \s-1ISO\s0 C99.
1497.IP "\fB\-fno\-builtin\fR" 4
1498.IX Item "-fno-builtin"
1499.PD 0
1500.IP "\fB\-fno\-builtin\-\fR\fIfunction\fR" 4
1501.IX Item "-fno-builtin-function"
1502.PD
1503Don't recognize built-in functions that do not begin with
1504\&\fB_\|_builtin_\fR as prefix.
1505.Sp
1506\&\s-1GCC\s0 normally generates special code to handle certain built-in functions
1507more efficiently; for instance, calls to \f(CW\*(C`alloca\*(C'\fR may become single
1508instructions that adjust the stack directly, and calls to \f(CW\*(C`memcpy\*(C'\fR
1509may become inline copy loops. The resulting code is often both smaller
1510and faster, but since the function calls no longer appear as such, you
1511cannot set a breakpoint on those calls, nor can you change the behavior
1512of the functions by linking with a different library. In addition,
1513when a function is recognized as a built-in function, \s-1GCC\s0 may use
1514information about that function to warn about problems with calls to
1515that function, or to generate more efficient code, even if the
1516resulting code still contains calls to that function. For example,
1517warnings are given with \fB\-Wformat\fR for bad calls to
1518\&\f(CW\*(C`printf\*(C'\fR, when \f(CW\*(C`printf\*(C'\fR is built in, and \f(CW\*(C`strlen\*(C'\fR is
1519known not to modify global memory.
1520.Sp
1521With the \fB\-fno\-builtin\-\fR\fIfunction\fR option
1522only the built-in function \fIfunction\fR is
1523disabled. \fIfunction\fR must not begin with \fB_\|_builtin_\fR. If a
1524function is named that is not built-in in this version of \s-1GCC\s0, this
1525option is ignored. There is no corresponding
1526\&\fB\-fbuiltin\-\fR\fIfunction\fR option; if you wish to enable
1527built-in functions selectively when using \fB\-fno\-builtin\fR or
1528\&\fB\-ffreestanding\fR, you may define macros such as:
1529.Sp
1530.Vb 2
1531\& #define abs(n) _\|_builtin_abs ((n))
1532\& #define strcpy(d, s) _\|_builtin_strcpy ((d), (s))
1533.Ve
1534.IP "\fB\-fhosted\fR" 4
1535.IX Item "-fhosted"
1536Assert that compilation takes place in a hosted environment. This implies
1537\&\fB\-fbuiltin\fR. A hosted environment is one in which the
1538entire standard library is available, and in which \f(CW\*(C`main\*(C'\fR has a return
1539type of \f(CW\*(C`int\*(C'\fR. Examples are nearly everything except a kernel.
1540This is equivalent to \fB\-fno\-freestanding\fR.
1541.IP "\fB\-ffreestanding\fR" 4
1542.IX Item "-ffreestanding"
1543Assert that compilation takes place in a freestanding environment. This
1544implies \fB\-fno\-builtin\fR. A freestanding environment
1545is one in which the standard library may not exist, and program startup may
1546not necessarily be at \f(CW\*(C`main\*(C'\fR. The most obvious example is an \s-1OS\s0 kernel.
1547This is equivalent to \fB\-fno\-hosted\fR.
1548.IP "\fB\-fopenmp\fR" 4
1549.IX Item "-fopenmp"
1550Enable handling of OpenMP directives \f(CW\*(C`#pragma omp\*(C'\fR in C/\*(C+ and
1551\&\f(CW\*(C`!$omp\*(C'\fR in Fortran. When \fB\-fopenmp\fR is specified, the
1552compiler generates parallel code according to the OpenMP Application
1553Program Interface v2.5 <\fBhttp://www.openmp.org/\fR>. This option
1554implies \fB\-pthread\fR, and thus is only supported on targets that
1555have support for \fB\-pthread\fR.
1556.IP "\fB\-fms\-extensions\fR" 4
1557.IX Item "-fms-extensions"
1558Accept some non-standard constructs used in Microsoft header files.
1559.Sp
1560Some cases of unnamed fields in structures and unions are only
1561accepted with this option.
1562.IP "\fB\-trigraphs\fR" 4
1563.IX Item "-trigraphs"
1564Support \s-1ISO\s0 C trigraphs. The \fB\-ansi\fR option (and \fB\-std\fR
1565options for strict \s-1ISO\s0 C conformance) implies \fB\-trigraphs\fR.
1566.IP "\fB\-no\-integrated\-cpp\fR" 4
1567.IX Item "-no-integrated-cpp"
1568Performs a compilation in two passes: preprocessing and compiling. This
1569option allows a user supplied \*(L"cc1\*(R", \*(L"cc1plus\*(R", or \*(L"cc1obj\*(R" via the
1570\&\fB\-B\fR option. The user supplied compilation step can then add in
1571an additional preprocessing step after normal preprocessing but before
1572compiling. The default is to use the integrated cpp (internal cpp)
1573.Sp
1574The semantics of this option will change if \*(L"cc1\*(R", \*(L"cc1plus\*(R", and
1575\&\*(L"cc1obj\*(R" are merged.
1576.IP "\fB\-traditional\fR" 4
1577.IX Item "-traditional"
1578.PD 0
1579.IP "\fB\-traditional\-cpp\fR" 4
1580.IX Item "-traditional-cpp"
1581.PD
1582Formerly, these options caused \s-1GCC\s0 to attempt to emulate a pre-standard
1583C compiler. They are now only supported with the \fB\-E\fR switch.
1584The preprocessor continues to support a pre-standard mode. See the \s-1GNU\s0
1585\&\s-1CPP\s0 manual for details.
1586.IP "\fB\-fcond\-mismatch\fR" 4
1587.IX Item "-fcond-mismatch"
1588Allow conditional expressions with mismatched types in the second and
1589third arguments. The value of such an expression is void. This option
1590is not supported for \*(C+.
1591.IP "\fB\-flax\-vector\-conversions\fR" 4
1592.IX Item "-flax-vector-conversions"
1593Allow implicit conversions between vectors with differing numbers of
1594elements and/or incompatible element types. This option should not be
1595used for new code.
1596.IP "\fB\-funsigned\-char\fR" 4
1597.IX Item "-funsigned-char"
1598Let the type \f(CW\*(C`char\*(C'\fR be unsigned, like \f(CW\*(C`unsigned char\*(C'\fR.
1599.Sp
1600Each kind of machine has a default for what \f(CW\*(C`char\*(C'\fR should
1601be. It is either like \f(CW\*(C`unsigned char\*(C'\fR by default or like
1602\&\f(CW\*(C`signed char\*(C'\fR by default.
1603.Sp
1604Ideally, a portable program should always use \f(CW\*(C`signed char\*(C'\fR or
1605\&\f(CW\*(C`unsigned char\*(C'\fR when it depends on the signedness of an object.
1606But many programs have been written to use plain \f(CW\*(C`char\*(C'\fR and
1607expect it to be signed, or expect it to be unsigned, depending on the
1608machines they were written for. This option, and its inverse, let you
1609make such a program work with the opposite default.
1610.Sp
1611The type \f(CW\*(C`char\*(C'\fR is always a distinct type from each of
1612\&\f(CW\*(C`signed char\*(C'\fR or \f(CW\*(C`unsigned char\*(C'\fR, even though its behavior
1613is always just like one of those two.
1614.IP "\fB\-fsigned\-char\fR" 4
1615.IX Item "-fsigned-char"
1616Let the type \f(CW\*(C`char\*(C'\fR be signed, like \f(CW\*(C`signed char\*(C'\fR.
1617.Sp
1618Note that this is equivalent to \fB\-fno\-unsigned\-char\fR, which is
1619the negative form of \fB\-funsigned\-char\fR. Likewise, the option
1620\&\fB\-fno\-signed\-char\fR is equivalent to \fB\-funsigned\-char\fR.
1621.IP "\fB\-fsigned\-bitfields\fR" 4
1622.IX Item "-fsigned-bitfields"
1623.PD 0
1624.IP "\fB\-funsigned\-bitfields\fR" 4
1625.IX Item "-funsigned-bitfields"
1626.IP "\fB\-fno\-signed\-bitfields\fR" 4
1627.IX Item "-fno-signed-bitfields"
1628.IP "\fB\-fno\-unsigned\-bitfields\fR" 4
1629.IX Item "-fno-unsigned-bitfields"
1630.PD
1631These options control whether a bit-field is signed or unsigned, when the
1632declaration does not use either \f(CW\*(C`signed\*(C'\fR or \f(CW\*(C`unsigned\*(C'\fR. By
1633default, such a bit-field is signed, because this is consistent: the
1634basic integer types such as \f(CW\*(C`int\*(C'\fR are signed types.
4b1e227d 1635.SS "Options Controlling \*(C+ Dialect"
c251ad9e
SS
1636.IX Subsection "Options Controlling Dialect"
1637This section describes the command-line options that are only meaningful
1638for \*(C+ programs; but you can also use most of the \s-1GNU\s0 compiler options
1639regardless of what language your program is in. For example, you
1640might compile a file \f(CW\*(C`firstClass.C\*(C'\fR like this:
1641.PP
1642.Vb 1
1643\& g++ \-g \-frepo \-O \-c firstClass.C
1644.Ve
1645.PP
1646In this example, only \fB\-frepo\fR is an option meant
1647only for \*(C+ programs; you can use the other options with any
1648language supported by \s-1GCC\s0.
1649.PP
1650Here is a list of options that are \fIonly\fR for compiling \*(C+ programs:
1651.IP "\fB\-fabi\-version=\fR\fIn\fR" 4
1652.IX Item "-fabi-version=n"
1653Use version \fIn\fR of the \*(C+ \s-1ABI\s0. Version 2 is the version of the
1654\&\*(C+ \s-1ABI\s0 that first appeared in G++ 3.4. Version 1 is the version of
1655the \*(C+ \s-1ABI\s0 that first appeared in G++ 3.2. Version 0 will always be
1656the version that conforms most closely to the \*(C+ \s-1ABI\s0 specification.
1657Therefore, the \s-1ABI\s0 obtained using version 0 will change as \s-1ABI\s0 bugs
1658are fixed.
1659.Sp
1660The default is version 2.
1661.IP "\fB\-fno\-access\-control\fR" 4
1662.IX Item "-fno-access-control"
1663Turn off all access checking. This switch is mainly useful for working
1664around bugs in the access control code.
1665.IP "\fB\-fcheck\-new\fR" 4
1666.IX Item "-fcheck-new"
1667Check that the pointer returned by \f(CW\*(C`operator new\*(C'\fR is non-null
1668before attempting to modify the storage allocated. This check is
1669normally unnecessary because the \*(C+ standard specifies that
1670\&\f(CW\*(C`operator new\*(C'\fR will only return \f(CW0\fR if it is declared
1671\&\fB\f(BIthrow()\fB\fR, in which case the compiler will always check the
1672return value even without this option. In all other cases, when
1673\&\f(CW\*(C`operator new\*(C'\fR has a non-empty exception specification, memory
1674exhaustion is signalled by throwing \f(CW\*(C`std::bad_alloc\*(C'\fR. See also
1675\&\fBnew (nothrow)\fR.
1676.IP "\fB\-fconserve\-space\fR" 4
1677.IX Item "-fconserve-space"
1678Put uninitialized or runtime-initialized global variables into the
1679common segment, as C does. This saves space in the executable at the
1680cost of not diagnosing duplicate definitions. If you compile with this
1681flag and your program mysteriously crashes after \f(CW\*(C`main()\*(C'\fR has
1682completed, you may have an object that is being destroyed twice because
1683two definitions were merged.
1684.Sp
1685This option is no longer useful on most targets, now that support has
1686been added for putting variables into \s-1BSS\s0 without making them common.
dff90b41
SS
1687.IP "\fB\-fno\-deduce\-init\-list\fR" 4
1688.IX Item "-fno-deduce-init-list"
1689Disable deduction of a template type parameter as
1690std::initializer_list from a brace-enclosed initializer list, i.e.
1691.Sp
1692.Vb 4
1693\& template <class T> auto forward(T t) \-> decltype (realfn (t))
1694\& {
1695\& return realfn (t);
1696\& }
1697\&
1698\& void f()
1699\& {
1700\& forward({1,2}); // call forward<std::initializer_list<int>>
1701\& }
1702.Ve
1703.Sp
1704This option is present because this deduction is an extension to the
1705current specification in the \*(C+0x working draft, and there was
1706some concern about potential overload resolution problems.
c251ad9e
SS
1707.IP "\fB\-ffriend\-injection\fR" 4
1708.IX Item "-ffriend-injection"
1709Inject friend functions into the enclosing namespace, so that they are
1710visible outside the scope of the class in which they are declared.
1711Friend functions were documented to work this way in the old Annotated
1712\&\*(C+ Reference Manual, and versions of G++ before 4.1 always worked
1713that way. However, in \s-1ISO\s0 \*(C+ a friend function which is not declared
1714in an enclosing scope can only be found using argument dependent
1715lookup. This option causes friends to be injected as they were in
1716earlier releases.
1717.Sp
1718This option is for compatibility, and may be removed in a future
1719release of G++.
1720.IP "\fB\-fno\-elide\-constructors\fR" 4
1721.IX Item "-fno-elide-constructors"
1722The \*(C+ standard allows an implementation to omit creating a temporary
1723which is only used to initialize another object of the same type.
1724Specifying this option disables that optimization, and forces G++ to
1725call the copy constructor in all cases.
1726.IP "\fB\-fno\-enforce\-eh\-specs\fR" 4
1727.IX Item "-fno-enforce-eh-specs"
1728Don't generate code to check for violation of exception specifications
1729at runtime. This option violates the \*(C+ standard, but may be useful
1730for reducing code size in production builds, much like defining
1731\&\fB\s-1NDEBUG\s0\fR. This does not give user code permission to throw
1732exceptions in violation of the exception specifications; the compiler
1733will still optimize based on the specifications, so throwing an
1734unexpected exception will result in undefined behavior.
1735.IP "\fB\-ffor\-scope\fR" 4
1736.IX Item "-ffor-scope"
1737.PD 0
1738.IP "\fB\-fno\-for\-scope\fR" 4
1739.IX Item "-fno-for-scope"
1740.PD
1741If \fB\-ffor\-scope\fR is specified, the scope of variables declared in
1742a \fIfor-init-statement\fR is limited to the \fBfor\fR loop itself,
1743as specified by the \*(C+ standard.
1744If \fB\-fno\-for\-scope\fR is specified, the scope of variables declared in
1745a \fIfor-init-statement\fR extends to the end of the enclosing scope,
1746as was the case in old versions of G++, and other (traditional)
1747implementations of \*(C+.
1748.Sp
1749The default if neither flag is given to follow the standard,
1750but to allow and give a warning for old-style code that would
1751otherwise be invalid, or have different behavior.
1752.IP "\fB\-fno\-gnu\-keywords\fR" 4
1753.IX Item "-fno-gnu-keywords"
1754Do not recognize \f(CW\*(C`typeof\*(C'\fR as a keyword, so that code can use this
1755word as an identifier. You can use the keyword \f(CW\*(C`_\|_typeof_\|_\*(C'\fR instead.
1756\&\fB\-ansi\fR implies \fB\-fno\-gnu\-keywords\fR.
1757.IP "\fB\-fno\-implicit\-templates\fR" 4
1758.IX Item "-fno-implicit-templates"
1759Never emit code for non-inline templates which are instantiated
1760implicitly (i.e. by use); only emit code for explicit instantiations.
1761.IP "\fB\-fno\-implicit\-inline\-templates\fR" 4
1762.IX Item "-fno-implicit-inline-templates"
1763Don't emit code for implicit instantiations of inline templates, either.
1764The default is to handle inlines differently so that compiles with and
1765without optimization will need the same set of explicit instantiations.
1766.IP "\fB\-fno\-implement\-inlines\fR" 4
1767.IX Item "-fno-implement-inlines"
1768To save space, do not emit out-of-line copies of inline functions
1769controlled by \fB#pragma implementation\fR. This will cause linker
1770errors if these functions are not inlined everywhere they are called.
1771.IP "\fB\-fms\-extensions\fR" 4
1772.IX Item "-fms-extensions"
1773Disable pedantic warnings about constructs used in \s-1MFC\s0, such as implicit
1774int and getting a pointer to member function via non-standard syntax.
1775.IP "\fB\-fno\-nonansi\-builtins\fR" 4
1776.IX Item "-fno-nonansi-builtins"
1777Disable built-in declarations of functions that are not mandated by
1778\&\s-1ANSI/ISO\s0 C. These include \f(CW\*(C`ffs\*(C'\fR, \f(CW\*(C`alloca\*(C'\fR, \f(CW\*(C`_exit\*(C'\fR,
1779\&\f(CW\*(C`index\*(C'\fR, \f(CW\*(C`bzero\*(C'\fR, \f(CW\*(C`conjf\*(C'\fR, and other related functions.
1780.IP "\fB\-fno\-operator\-names\fR" 4
1781.IX Item "-fno-operator-names"
1782Do not treat the operator name keywords \f(CW\*(C`and\*(C'\fR, \f(CW\*(C`bitand\*(C'\fR,
1783\&\f(CW\*(C`bitor\*(C'\fR, \f(CW\*(C`compl\*(C'\fR, \f(CW\*(C`not\*(C'\fR, \f(CW\*(C`or\*(C'\fR and \f(CW\*(C`xor\*(C'\fR as
1784synonyms as keywords.
1785.IP "\fB\-fno\-optional\-diags\fR" 4
1786.IX Item "-fno-optional-diags"
1787Disable diagnostics that the standard says a compiler does not need to
1788issue. Currently, the only such diagnostic issued by G++ is the one for
1789a name having multiple meanings within a class.
1790.IP "\fB\-fpermissive\fR" 4
1791.IX Item "-fpermissive"
1792Downgrade some diagnostics about nonconformant code from errors to
1793warnings. Thus, using \fB\-fpermissive\fR will allow some
1794nonconforming code to compile.
1795.IP "\fB\-frepo\fR" 4
1796.IX Item "-frepo"
1797Enable automatic template instantiation at link time. This option also
1798implies \fB\-fno\-implicit\-templates\fR.
1799.IP "\fB\-fno\-rtti\fR" 4
1800.IX Item "-fno-rtti"
1801Disable generation of information about every class with virtual
1802functions for use by the \*(C+ runtime type identification features
1803(\fBdynamic_cast\fR and \fBtypeid\fR). If you don't use those parts
1804of the language, you can save some space by using this flag. Note that
1805exception handling uses the same information, but it will generate it as
1806needed. The \fBdynamic_cast\fR operator can still be used for casts that
1807do not require runtime type information, i.e. casts to \f(CW\*(C`void *\*(C'\fR or to
1808unambiguous base classes.
1809.IP "\fB\-fstats\fR" 4
1810.IX Item "-fstats"
1811Emit statistics about front-end processing at the end of the compilation.
1812This information is generally only useful to the G++ development team.
1813.IP "\fB\-ftemplate\-depth\-\fR\fIn\fR" 4
1814.IX Item "-ftemplate-depth-n"
1815Set the maximum instantiation depth for template classes to \fIn\fR.
1816A limit on the template instantiation depth is needed to detect
1817endless recursions during template class instantiation. \s-1ANSI/ISO\s0 \*(C+
1818conforming programs must not rely on a maximum depth greater than 17.
1819.IP "\fB\-fno\-threadsafe\-statics\fR" 4
1820.IX Item "-fno-threadsafe-statics"
1821Do not emit the extra code to use the routines specified in the \*(C+
1822\&\s-1ABI\s0 for thread-safe initialization of local statics. You can use this
1823option to reduce code size slightly in code that doesn't need to be
1824thread-safe.
1825.IP "\fB\-fuse\-cxa\-atexit\fR" 4
1826.IX Item "-fuse-cxa-atexit"
1827Register destructors for objects with static storage duration with the
1828\&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR function rather than the \f(CW\*(C`atexit\*(C'\fR function.
1829This option is required for fully standards-compliant handling of static
1830destructors, but will only work if your C library supports
1831\&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR.
1832.IP "\fB\-fno\-use\-cxa\-get\-exception\-ptr\fR" 4
1833.IX Item "-fno-use-cxa-get-exception-ptr"
1834Don't use the \f(CW\*(C`_\|_cxa_get_exception_ptr\*(C'\fR runtime routine. This
1835will cause \f(CW\*(C`std::uncaught_exception\*(C'\fR to be incorrect, but is necessary
1836if the runtime routine is not available.
1837.IP "\fB\-fvisibility\-inlines\-hidden\fR" 4
1838.IX Item "-fvisibility-inlines-hidden"
1839This switch declares that the user does not attempt to compare
1840pointers to inline methods where the addresses of the two functions
1841were taken in different shared objects.
1842.Sp
1843The effect of this is that \s-1GCC\s0 may, effectively, mark inline methods with
1844\&\f(CW\*(C`_\|_attribute_\|_ ((visibility ("hidden")))\*(C'\fR so that they do not
1845appear in the export table of a \s-1DSO\s0 and do not require a \s-1PLT\s0 indirection
1846when used within the \s-1DSO\s0. Enabling this option can have a dramatic effect
1847on load and link times of a \s-1DSO\s0 as it massively reduces the size of the
1848dynamic export table when the library makes heavy use of templates.
1849.Sp
1850The behavior of this switch is not quite the same as marking the
1851methods as hidden directly, because it does not affect static variables
1852local to the function or cause the compiler to deduce that
1853the function is defined in only one shared object.
1854.Sp
1855You may mark a method as having a visibility explicitly to negate the
1856effect of the switch for that method. For example, if you do want to
1857compare pointers to a particular inline method, you might mark it as
1858having default visibility. Marking the enclosing class with explicit
1859visibility will have no effect.
1860.Sp
1861Explicitly instantiated inline methods are unaffected by this option
1862as their linkage might otherwise cross a shared library boundary.
1863.IP "\fB\-fvisibility\-ms\-compat\fR" 4
1864.IX Item "-fvisibility-ms-compat"
1865This flag attempts to use visibility settings to make \s-1GCC\s0's \*(C+
1866linkage model compatible with that of Microsoft Visual Studio.
1867.Sp
1868The flag makes these changes to \s-1GCC\s0's linkage model:
1869.RS 4
1870.IP "1." 4
1871It sets the default visibility to \f(CW\*(C`hidden\*(C'\fR, like
1872\&\fB\-fvisibility=hidden\fR.
1873.IP "2." 4
1874Types, but not their members, are not hidden by default.
1875.IP "3." 4
1876The One Definition Rule is relaxed for types without explicit
1877visibility specifications which are defined in more than one different
1878shared object: those declarations are permitted if they would have
1879been permitted when this option was not used.
1880.RE
1881.RS 4
1882.Sp
1883In new code it is better to use \fB\-fvisibility=hidden\fR and
1884export those classes which are intended to be externally visible.
1885Unfortunately it is possible for code to rely, perhaps accidentally,
1886on the Visual Studio behavior.
1887.Sp
1888Among the consequences of these changes are that static data members
1889of the same type with the same name but defined in different shared
1890objects will be different, so changing one will not change the other;
1891and that pointers to function members defined in different shared
1892objects may not compare equal. When this flag is given, it is a
1893violation of the \s-1ODR\s0 to define types with the same name differently.
1894.RE
1895.IP "\fB\-fno\-weak\fR" 4
1896.IX Item "-fno-weak"
1897Do not use weak symbol support, even if it is provided by the linker.
1898By default, G++ will use weak symbols if they are available. This
1899option exists only for testing, and should not be used by end-users;
1900it will result in inferior code and has no benefits. This option may
1901be removed in a future release of G++.
1902.IP "\fB\-nostdinc++\fR" 4
1903.IX Item "-nostdinc++"
1904Do not search for header files in the standard directories specific to
1905\&\*(C+, but do still search the other standard directories. (This option
1906is used when building the \*(C+ library.)
1907.PP
1908In addition, these optimization, warning, and code generation options
1909have meanings only for \*(C+ programs:
1910.IP "\fB\-fno\-default\-inline\fR" 4
1911.IX Item "-fno-default-inline"
1912Do not assume \fBinline\fR for functions defined inside a class scope.
1913 Note that these
1914functions will have linkage like inline functions; they just won't be
1915inlined by default.
1916.IP "\fB\-Wabi\fR (C, Objective-C, \*(C+ and Objective\-\*(C+ only)" 4
1917.IX Item "-Wabi (C, Objective-C, and Objective- only)"
1918Warn when G++ generates code that is probably not compatible with the
1919vendor-neutral \*(C+ \s-1ABI\s0. Although an effort has been made to warn about
1920all such cases, there are probably some cases that are not warned about,
1921even though G++ is generating incompatible code. There may also be
1922cases where warnings are emitted even though the code that is generated
1923will be compatible.
1924.Sp
1925You should rewrite your code to avoid these warnings if you are
1926concerned about the fact that code generated by G++ may not be binary
1927compatible with code generated by other compilers.
1928.Sp
1929The known incompatibilities at this point include:
1930.RS 4
1931.IP "\(bu" 4
1932Incorrect handling of tail-padding for bit-fields. G++ may attempt to
1933pack data into the same byte as a base class. For example:
1934.Sp
1935.Vb 2
1936\& struct A { virtual void f(); int f1 : 1; };
1937\& struct B : public A { int f2 : 1; };
1938.Ve
1939.Sp
1940In this case, G++ will place \f(CW\*(C`B::f2\*(C'\fR into the same byte
1941as\f(CW\*(C`A::f1\*(C'\fR; other compilers will not. You can avoid this problem
1942by explicitly padding \f(CW\*(C`A\*(C'\fR so that its size is a multiple of the
1943byte size on your platform; that will cause G++ and other compilers to
1944layout \f(CW\*(C`B\*(C'\fR identically.
1945.IP "\(bu" 4
1946Incorrect handling of tail-padding for virtual bases. G++ does not use
1947tail padding when laying out virtual bases. For example:
1948.Sp
1949.Vb 3
1950\& struct A { virtual void f(); char c1; };
1951\& struct B { B(); char c2; };
1952\& struct C : public A, public virtual B {};
1953.Ve
1954.Sp
1955In this case, G++ will not place \f(CW\*(C`B\*(C'\fR into the tail-padding for
1956\&\f(CW\*(C`A\*(C'\fR; other compilers will. You can avoid this problem by
1957explicitly padding \f(CW\*(C`A\*(C'\fR so that its size is a multiple of its
1958alignment (ignoring virtual base classes); that will cause G++ and other
1959compilers to layout \f(CW\*(C`C\*(C'\fR identically.
1960.IP "\(bu" 4
1961Incorrect handling of bit-fields with declared widths greater than that
1962of their underlying types, when the bit-fields appear in a union. For
1963example:
1964.Sp
1965.Vb 1
1966\& union U { int i : 4096; };
1967.Ve
1968.Sp
1969Assuming that an \f(CW\*(C`int\*(C'\fR does not have 4096 bits, G++ will make the
1970union too small by the number of bits in an \f(CW\*(C`int\*(C'\fR.
1971.IP "\(bu" 4
1972Empty classes can be placed at incorrect offsets. For example:
1973.Sp
1974.Vb 1
1975\& struct A {};
1976\&
1977\& struct B {
1978\& A a;
1979\& virtual void f ();
1980\& };
1981\&
1982\& struct C : public B, public A {};
1983.Ve
1984.Sp
1985G++ will place the \f(CW\*(C`A\*(C'\fR base class of \f(CW\*(C`C\*(C'\fR at a nonzero offset;
1986it should be placed at offset zero. G++ mistakenly believes that the
1987\&\f(CW\*(C`A\*(C'\fR data member of \f(CW\*(C`B\*(C'\fR is already at offset zero.
1988.IP "\(bu" 4
1989Names of template functions whose types involve \f(CW\*(C`typename\*(C'\fR or
1990template template parameters can be mangled incorrectly.
1991.Sp
1992.Vb 2
1993\& template <typename Q>
1994\& void f(typename Q::X) {}
1995\&
1996\& template <template <typename> class Q>
1997\& void f(typename Q<int>::X) {}
1998.Ve
1999.Sp
2000Instantiations of these templates may be mangled incorrectly.
2001.RE
2002.RS 4
2003.Sp
2004It also warns psABI related changes. The known psABI changes at this
2005point include:
2006.IP "\(bu" 4
2007For SYSV/x86\-64, when passing union with long double, it is changed to
2008pass in memory as specified in psABI. For example:
2009.Sp
2010.Vb 4
2011\& union U {
2012\& long double ld;
2013\& int i;
2014\& };
2015.Ve
2016.Sp
2017\&\f(CW\*(C`union U\*(C'\fR will always be passed in memory.
2018.RE
2019.RS 4
2020.RE
2021.IP "\fB\-Wctor\-dtor\-privacy\fR (\*(C+ and Objective\-\*(C+ only)" 4
2022.IX Item "-Wctor-dtor-privacy ( and Objective- only)"
2023Warn when a class seems unusable because all the constructors or
2024destructors in that class are private, and it has neither friends nor
2025public static member functions.
2026.IP "\fB\-Wnon\-virtual\-dtor\fR (\*(C+ and Objective\-\*(C+ only)" 4
2027.IX Item "-Wnon-virtual-dtor ( and Objective- only)"
2028Warn when a class has virtual functions and accessible non-virtual
2029destructor, in which case it would be possible but unsafe to delete
2030an instance of a derived class through a pointer to the base class.
2031This warning is also enabled if \-Weffc++ is specified.
2032.IP "\fB\-Wreorder\fR (\*(C+ and Objective\-\*(C+ only)" 4
2033.IX Item "-Wreorder ( and Objective- only)"
2034Warn when the order of member initializers given in the code does not
2035match the order in which they must be executed. For instance:
2036.Sp
2037.Vb 5
2038\& struct A {
2039\& int i;
2040\& int j;
2041\& A(): j (0), i (1) { }
2042\& };
2043.Ve
2044.Sp
2045The compiler will rearrange the member initializers for \fBi\fR
2046and \fBj\fR to match the declaration order of the members, emitting
2047a warning to that effect. This warning is enabled by \fB\-Wall\fR.
2048.PP
2049The following \fB\-W...\fR options are not affected by \fB\-Wall\fR.
2050.IP "\fB\-Weffc++\fR (\*(C+ and Objective\-\*(C+ only)" 4
2051.IX Item "-Weffc++ ( and Objective- only)"
2052Warn about violations of the following style guidelines from Scott Meyers'
2053\&\fIEffective \*(C+\fR book:
2054.RS 4
2055.IP "\(bu" 4
2056Item 11: Define a copy constructor and an assignment operator for classes
2057with dynamically allocated memory.
2058.IP "\(bu" 4
2059Item 12: Prefer initialization to assignment in constructors.
2060.IP "\(bu" 4
2061Item 14: Make destructors virtual in base classes.
2062.IP "\(bu" 4
2063Item 15: Have \f(CW\*(C`operator=\*(C'\fR return a reference to \f(CW*this\fR.
2064.IP "\(bu" 4
2065Item 23: Don't try to return a reference when you must return an object.
2066.RE
2067.RS 4
2068.Sp
2069Also warn about violations of the following style guidelines from
2070Scott Meyers' \fIMore Effective \*(C+\fR book:
2071.IP "\(bu" 4
2072Item 6: Distinguish between prefix and postfix forms of increment and
2073decrement operators.
2074.IP "\(bu" 4
2075Item 7: Never overload \f(CW\*(C`&&\*(C'\fR, \f(CW\*(C`||\*(C'\fR, or \f(CW\*(C`,\*(C'\fR.
2076.RE
2077.RS 4
2078.Sp
2079When selecting this option, be aware that the standard library
2080headers do not obey all of these guidelines; use \fBgrep \-v\fR
2081to filter out those warnings.
2082.RE
2083.IP "\fB\-Wstrict\-null\-sentinel\fR (\*(C+ and Objective\-\*(C+ only)" 4
2084.IX Item "-Wstrict-null-sentinel ( and Objective- only)"
2085Warn also about the use of an uncasted \f(CW\*(C`NULL\*(C'\fR as sentinel. When
2086compiling only with \s-1GCC\s0 this is a valid sentinel, as \f(CW\*(C`NULL\*(C'\fR is defined
2087to \f(CW\*(C`_\|_null\*(C'\fR. Although it is a null pointer constant not a null pointer,
2088it is guaranteed to be of the same size as a pointer. But this use is
2089not portable across different compilers.
2090.IP "\fB\-Wno\-non\-template\-friend\fR (\*(C+ and Objective\-\*(C+ only)" 4
2091.IX Item "-Wno-non-template-friend ( and Objective- only)"
2092Disable warnings when non-templatized friend functions are declared
2093within a template. Since the advent of explicit template specification
2094support in G++, if the name of the friend is an unqualified-id (i.e.,
2095\&\fBfriend foo(int)\fR), the \*(C+ language specification demands that the
2096friend declare or define an ordinary, nontemplate function. (Section
209714.5.3). Before G++ implemented explicit specification, unqualified-ids
2098could be interpreted as a particular specialization of a templatized
2099function. Because this non-conforming behavior is no longer the default
2100behavior for G++, \fB\-Wnon\-template\-friend\fR allows the compiler to
2101check existing code for potential trouble spots and is on by default.
2102This new compiler behavior can be turned off with
2103\&\fB\-Wno\-non\-template\-friend\fR which keeps the conformant compiler code
2104but disables the helpful warning.
2105.IP "\fB\-Wold\-style\-cast\fR (\*(C+ and Objective\-\*(C+ only)" 4
2106.IX Item "-Wold-style-cast ( and Objective- only)"
2107Warn if an old-style (C\-style) cast to a non-void type is used within
2108a \*(C+ program. The new-style casts (\fBdynamic_cast\fR,
2109\&\fBstatic_cast\fR, \fBreinterpret_cast\fR, and \fBconst_cast\fR) are
2110less vulnerable to unintended effects and much easier to search for.
2111.IP "\fB\-Woverloaded\-virtual\fR (\*(C+ and Objective\-\*(C+ only)" 4
2112.IX Item "-Woverloaded-virtual ( and Objective- only)"
2113Warn when a function declaration hides virtual functions from a
2114base class. For example, in:
2115.Sp
2116.Vb 3
2117\& struct A {
2118\& virtual void f();
2119\& };
2120\&
2121\& struct B: public A {
2122\& void f(int);
2123\& };
2124.Ve
2125.Sp
2126the \f(CW\*(C`A\*(C'\fR class version of \f(CW\*(C`f\*(C'\fR is hidden in \f(CW\*(C`B\*(C'\fR, and code
2127like:
2128.Sp
2129.Vb 2
2130\& B* b;
2131\& b\->f();
2132.Ve
2133.Sp
2134will fail to compile.
2135.IP "\fB\-Wno\-pmf\-conversions\fR (\*(C+ and Objective\-\*(C+ only)" 4
2136.IX Item "-Wno-pmf-conversions ( and Objective- only)"
2137Disable the diagnostic for converting a bound pointer to member function
2138to a plain pointer.
2139.IP "\fB\-Wsign\-promo\fR (\*(C+ and Objective\-\*(C+ only)" 4
2140.IX Item "-Wsign-promo ( and Objective- only)"
2141Warn when overload resolution chooses a promotion from unsigned or
2142enumerated type to a signed type, over a conversion to an unsigned type of
2143the same size. Previous versions of G++ would try to preserve
2144unsignedness, but the standard mandates the current behavior.
2145.Sp
2146.Vb 4
2147\& struct A {
2148\& operator int ();
2149\& A& operator = (int);
2150\& };
2151\&
2152\& main ()
2153\& {
2154\& A a,b;
2155\& a = b;
2156\& }
2157.Ve
2158.Sp
2159In this example, G++ will synthesize a default \fBA& operator =
2160(const A&);\fR, while cfront will use the user-defined \fBoperator =\fR.
4b1e227d 2161.SS "Options Controlling Objective-C and Objective\-\*(C+ Dialects"
c251ad9e
SS
2162.IX Subsection "Options Controlling Objective-C and Objective- Dialects"
2163(\s-1NOTE:\s0 This manual does not describe the Objective-C and Objective\-\*(C+
2164languages themselves. See
2165.PP
2166This section describes the command-line options that are only meaningful
2167for Objective-C and Objective\-\*(C+ programs, but you can also use most of
2168the language-independent \s-1GNU\s0 compiler options.
2169For example, you might compile a file \f(CW\*(C`some_class.m\*(C'\fR like this:
2170.PP
2171.Vb 1
2172\& gcc \-g \-fgnu\-runtime \-O \-c some_class.m
2173.Ve
2174.PP
2175In this example, \fB\-fgnu\-runtime\fR is an option meant only for
2176Objective-C and Objective\-\*(C+ programs; you can use the other options with
2177any language supported by \s-1GCC\s0.
2178.PP
2179Note that since Objective-C is an extension of the C language, Objective-C
2180compilations may also use options specific to the C front-end (e.g.,
2181\&\fB\-Wtraditional\fR). Similarly, Objective\-\*(C+ compilations may use
2182\&\*(C+\-specific options (e.g., \fB\-Wabi\fR).
2183.PP
2184Here is a list of options that are \fIonly\fR for compiling Objective-C
2185and Objective\-\*(C+ programs:
2186.IP "\fB\-fconstant\-string\-class=\fR\fIclass-name\fR" 4
2187.IX Item "-fconstant-string-class=class-name"
2188Use \fIclass-name\fR as the name of the class to instantiate for each
2189literal string specified with the syntax \f(CW\*(C`@"..."\*(C'\fR. The default
2190class name is \f(CW\*(C`NXConstantString\*(C'\fR if the \s-1GNU\s0 runtime is being used, and
2191\&\f(CW\*(C`NSConstantString\*(C'\fR if the NeXT runtime is being used (see below). The
2192\&\fB\-fconstant\-cfstrings\fR option, if also present, will override the
2193\&\fB\-fconstant\-string\-class\fR setting and cause \f(CW\*(C`@"..."\*(C'\fR literals
2194to be laid out as constant CoreFoundation strings.
2195.IP "\fB\-fgnu\-runtime\fR" 4
2196.IX Item "-fgnu-runtime"
2197Generate object code compatible with the standard \s-1GNU\s0 Objective-C
2198runtime. This is the default for most types of systems.
2199.IP "\fB\-fnext\-runtime\fR" 4
2200.IX Item "-fnext-runtime"
2201Generate output compatible with the NeXT runtime. This is the default
2202for NeXT-based systems, including Darwin and Mac \s-1OS\s0 X. The macro
2203\&\f(CW\*(C`_\|_NEXT_RUNTIME_\|_\*(C'\fR is predefined if (and only if) this option is
2204used.
2205.IP "\fB\-fno\-nil\-receivers\fR" 4
2206.IX Item "-fno-nil-receivers"
2207Assume that all Objective-C message dispatches (e.g.,
2208\&\f(CW\*(C`[receiver message:arg]\*(C'\fR) in this translation unit ensure that the receiver
2209is not \f(CW\*(C`nil\*(C'\fR. This allows for more efficient entry points in the runtime
2210to be used. Currently, this option is only available in conjunction with
2211the NeXT runtime on Mac \s-1OS\s0 X 10.3 and later.
2212.IP "\fB\-fobjc\-call\-cxx\-cdtors\fR" 4
2213.IX Item "-fobjc-call-cxx-cdtors"
2214For each Objective-C class, check if any of its instance variables is a
2215\&\*(C+ object with a non-trivial default constructor. If so, synthesize a
2216special \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR instance method that will run
2217non-trivial default constructors on any such instance variables, in order,
2218and then return \f(CW\*(C`self\*(C'\fR. Similarly, check if any instance variable
2219is a \*(C+ object with a non-trivial destructor, and if so, synthesize a
2220special \f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR method that will run
2221all such default destructors, in reverse order.
2222.Sp
2223The \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR and/or \f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR methods
2224thusly generated will only operate on instance variables declared in the
2225current Objective-C class, and not those inherited from superclasses. It
2226is the responsibility of the Objective-C runtime to invoke all such methods
2227in an object's inheritance hierarchy. The \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR methods
2228will be invoked by the runtime immediately after a new object
2229instance is allocated; the \f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR methods will
2230be invoked immediately before the runtime deallocates an object instance.
2231.Sp
2232As of this writing, only the NeXT runtime on Mac \s-1OS\s0 X 10.4 and later has
2233support for invoking the \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR and
2234\&\f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR methods.
2235.IP "\fB\-fobjc\-direct\-dispatch\fR" 4
2236.IX Item "-fobjc-direct-dispatch"
2237Allow fast jumps to the message dispatcher. On Darwin this is
2238accomplished via the comm page.
2239.IP "\fB\-fobjc\-exceptions\fR" 4
2240.IX Item "-fobjc-exceptions"
2241Enable syntactic support for structured exception handling in Objective-C,
2242similar to what is offered by \*(C+ and Java. This option is
2243unavailable in conjunction with the NeXT runtime on Mac \s-1OS\s0 X 10.2 and
2244earlier.
2245.Sp
2246.Vb 10
2247\& @try {
2248\& ...
2249\& @throw expr;
2250\& ...
2251\& }
2252\& @catch (AnObjCClass *exc) {
2253\& ...
2254\& @throw expr;
2255\& ...
2256\& @throw;
2257\& ...
2258\& }
2259\& @catch (AnotherClass *exc) {
2260\& ...
2261\& }
2262\& @catch (id allOthers) {
2263\& ...
2264\& }
2265\& @finally {
2266\& ...
2267\& @throw expr;
2268\& ...
2269\& }
2270.Ve
2271.Sp
2272The \f(CW@throw\fR statement may appear anywhere in an Objective-C or
2273Objective\-\*(C+ program; when used inside of a \f(CW@catch\fR block, the
2274\&\f(CW@throw\fR may appear without an argument (as shown above), in which case
2275the object caught by the \f(CW@catch\fR will be rethrown.
2276.Sp
2277Note that only (pointers to) Objective-C objects may be thrown and
2278caught using this scheme. When an object is thrown, it will be caught
2279by the nearest \f(CW@catch\fR clause capable of handling objects of that type,
2280analogously to how \f(CW\*(C`catch\*(C'\fR blocks work in \*(C+ and Java. A
2281\&\f(CW\*(C`@catch(id ...)\*(C'\fR clause (as shown above) may also be provided to catch
2282any and all Objective-C exceptions not caught by previous \f(CW@catch\fR
2283clauses (if any).
2284.Sp
2285The \f(CW@finally\fR clause, if present, will be executed upon exit from the
2286immediately preceding \f(CW\*(C`@try ... @catch\*(C'\fR section. This will happen
2287regardless of whether any exceptions are thrown, caught or rethrown
2288inside the \f(CW\*(C`@try ... @catch\*(C'\fR section, analogously to the behavior
2289of the \f(CW\*(C`finally\*(C'\fR clause in Java.
2290.Sp
2291There are several caveats to using the new exception mechanism:
2292.RS 4
2293.IP "\(bu" 4
2294Although currently designed to be binary compatible with \f(CW\*(C`NS_HANDLER\*(C'\fR\-style
2295idioms provided by the \f(CW\*(C`NSException\*(C'\fR class, the new
2296exceptions can only be used on Mac \s-1OS\s0 X 10.3 (Panther) and later
2297systems, due to additional functionality needed in the (NeXT) Objective-C
2298runtime.
2299.IP "\(bu" 4
2300As mentioned above, the new exceptions do not support handling
2301types other than Objective-C objects. Furthermore, when used from
2302Objective\-\*(C+, the Objective-C exception model does not interoperate with \*(C+
2303exceptions at this time. This means you cannot \f(CW@throw\fR an exception
2304from Objective-C and \f(CW\*(C`catch\*(C'\fR it in \*(C+, or vice versa
2305(i.e., \f(CW\*(C`throw ... @catch\*(C'\fR).
2306.RE
2307.RS 4
2308.Sp
2309The \fB\-fobjc\-exceptions\fR switch also enables the use of synchronization
2310blocks for thread-safe execution:
2311.Sp
2312.Vb 3
2313\& @synchronized (ObjCClass *guard) {
2314\& ...
2315\& }
2316.Ve
2317.Sp
2318Upon entering the \f(CW@synchronized\fR block, a thread of execution shall
2319first check whether a lock has been placed on the corresponding \f(CW\*(C`guard\*(C'\fR
2320object by another thread. If it has, the current thread shall wait until
2321the other thread relinquishes its lock. Once \f(CW\*(C`guard\*(C'\fR becomes available,
2322the current thread will place its own lock on it, execute the code contained in
2323the \f(CW@synchronized\fR block, and finally relinquish the lock (thereby
2324making \f(CW\*(C`guard\*(C'\fR available to other threads).
2325.Sp
2326Unlike Java, Objective-C does not allow for entire methods to be marked
2327\&\f(CW@synchronized\fR. Note that throwing exceptions out of
2328\&\f(CW@synchronized\fR blocks is allowed, and will cause the guarding object
2329to be unlocked properly.
2330.RE
2331.IP "\fB\-fobjc\-gc\fR" 4
2332.IX Item "-fobjc-gc"
2333Enable garbage collection (\s-1GC\s0) in Objective-C and Objective\-\*(C+ programs.
2334.IP "\fB\-freplace\-objc\-classes\fR" 4
2335.IX Item "-freplace-objc-classes"
2336Emit a special marker instructing \fB\f(BIld\fB\|(1)\fR not to statically link in
2337the resulting object file, and allow \fB\f(BIdyld\fB\|(1)\fR to load it in at
2338run time instead. This is used in conjunction with the Fix-and-Continue
2339debugging mode, where the object file in question may be recompiled and
2340dynamically reloaded in the course of program execution, without the need
2341to restart the program itself. Currently, Fix-and-Continue functionality
2342is only available in conjunction with the NeXT runtime on Mac \s-1OS\s0 X 10.3
2343and later.
2344.IP "\fB\-fzero\-link\fR" 4
2345.IX Item "-fzero-link"
2346When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2347to \f(CW\*(C`objc_getClass("...")\*(C'\fR (when the name of the class is known at
2348compile time) with static class references that get initialized at load time,
2349which improves run-time performance. Specifying the \fB\-fzero\-link\fR flag
2350suppresses this behavior and causes calls to \f(CW\*(C`objc_getClass("...")\*(C'\fR
2351to be retained. This is useful in Zero-Link debugging mode, since it allows
2352for individual class implementations to be modified during program execution.
2353.IP "\fB\-gen\-decls\fR" 4
2354.IX Item "-gen-decls"
2355Dump interface declarations for all classes seen in the source file to a
2356file named \fI\fIsourcename\fI.decl\fR.
2357.IP "\fB\-Wassign\-intercept\fR (Objective-C and Objective\-\*(C+ only)" 4
2358.IX Item "-Wassign-intercept (Objective-C and Objective- only)"
2359Warn whenever an Objective-C assignment is being intercepted by the
2360garbage collector.
2361.IP "\fB\-Wno\-protocol\fR (Objective-C and Objective\-\*(C+ only)" 4
2362.IX Item "-Wno-protocol (Objective-C and Objective- only)"
2363If a class is declared to implement a protocol, a warning is issued for
2364every method in the protocol that is not implemented by the class. The
2365default behavior is to issue a warning for every method not explicitly
2366implemented in the class, even if a method implementation is inherited
2367from the superclass. If you use the \fB\-Wno\-protocol\fR option, then
2368methods inherited from the superclass are considered to be implemented,
2369and no warning is issued for them.
2370.IP "\fB\-Wselector\fR (Objective-C and Objective\-\*(C+ only)" 4
2371.IX Item "-Wselector (Objective-C and Objective- only)"
2372Warn if multiple methods of different types for the same selector are
2373found during compilation. The check is performed on the list of methods
2374in the final stage of compilation. Additionally, a check is performed
2375for each selector appearing in a \f(CW\*(C`@selector(...)\*(C'\fR
2376expression, and a corresponding method for that selector has been found
2377during compilation. Because these checks scan the method table only at
2378the end of compilation, these warnings are not produced if the final
2379stage of compilation is not reached, for example because an error is
2380found during compilation, or because the \fB\-fsyntax\-only\fR option is
2381being used.
2382.IP "\fB\-Wstrict\-selector\-match\fR (Objective-C and Objective\-\*(C+ only)" 4
2383.IX Item "-Wstrict-selector-match (Objective-C and Objective- only)"
2384Warn if multiple methods with differing argument and/or return types are
2385found for a given selector when attempting to send a message using this
2386selector to a receiver of type \f(CW\*(C`id\*(C'\fR or \f(CW\*(C`Class\*(C'\fR. When this flag
2387is off (which is the default behavior), the compiler will omit such warnings
2388if any differences found are confined to types which share the same size
2389and alignment.
2390.IP "\fB\-Wundeclared\-selector\fR (Objective-C and Objective\-\*(C+ only)" 4
2391.IX Item "-Wundeclared-selector (Objective-C and Objective- only)"
2392Warn if a \f(CW\*(C`@selector(...)\*(C'\fR expression referring to an
2393undeclared selector is found. A selector is considered undeclared if no
2394method with that name has been declared before the
2395\&\f(CW\*(C`@selector(...)\*(C'\fR expression, either explicitly in an
2396\&\f(CW@interface\fR or \f(CW@protocol\fR declaration, or implicitly in
2397an \f(CW@implementation\fR section. This option always performs its
2398checks as soon as a \f(CW\*(C`@selector(...)\*(C'\fR expression is found,
2399while \fB\-Wselector\fR only performs its checks in the final stage of
2400compilation. This also enforces the coding style convention
2401that methods and selectors must be declared before being used.
2402.IP "\fB\-print\-objc\-runtime\-info\fR" 4
2403.IX Item "-print-objc-runtime-info"
2404Generate C header describing the largest structure that is passed by
2405value, if any.
4b1e227d 2406.SS "Options to Control Diagnostic Messages Formatting"
c251ad9e
SS
2407.IX Subsection "Options to Control Diagnostic Messages Formatting"
2408Traditionally, diagnostic messages have been formatted irrespective of
2409the output device's aspect (e.g. its width, ...). The options described
2410below can be used to control the diagnostic messages formatting
2411algorithm, e.g. how many characters per line, how often source location
2412information should be reported. Right now, only the \*(C+ front end can
2413honor these options. However it is expected, in the near future, that
2414the remaining front ends would be able to digest them correctly.
2415.IP "\fB\-fmessage\-length=\fR\fIn\fR" 4
2416.IX Item "-fmessage-length=n"
2417Try to format error messages so that they fit on lines of about \fIn\fR
2418characters. The default is 72 characters for \fBg++\fR and 0 for the rest of
2419the front ends supported by \s-1GCC\s0. If \fIn\fR is zero, then no
2420line-wrapping will be done; each error message will appear on a single
2421line.
2422.IP "\fB\-fdiagnostics\-show\-location=once\fR" 4
2423.IX Item "-fdiagnostics-show-location=once"
2424Only meaningful in line-wrapping mode. Instructs the diagnostic messages
2425reporter to emit \fIonce\fR source location information; that is, in
2426case the message is too long to fit on a single physical line and has to
2427be wrapped, the source location won't be emitted (as prefix) again,
2428over and over, in subsequent continuation lines. This is the default
2429behavior.
2430.IP "\fB\-fdiagnostics\-show\-location=every\-line\fR" 4
2431.IX Item "-fdiagnostics-show-location=every-line"
2432Only meaningful in line-wrapping mode. Instructs the diagnostic
2433messages reporter to emit the same source location information (as
2434prefix) for physical lines that result from the process of breaking
2435a message which is too long to fit on a single line.
2436.IP "\fB\-fdiagnostics\-show\-option\fR" 4
2437.IX Item "-fdiagnostics-show-option"
2438This option instructs the diagnostic machinery to add text to each
2439diagnostic emitted, which indicates which command line option directly
2440controls that diagnostic, when such an option is known to the
2441diagnostic machinery.
2442.IP "\fB\-Wcoverage\-mismatch\fR" 4
2443.IX Item "-Wcoverage-mismatch"
2444Warn if feedback profiles do not match when using the
2445\&\fB\-fprofile\-use\fR option.
2446If a source file was changed between \fB\-fprofile\-gen\fR and
2447\&\fB\-fprofile\-use\fR, the files with the profile feedback can fail
2448to match the source file and \s-1GCC\s0 can not use the profile feedback
2449information. By default, \s-1GCC\s0 emits an error message in this case.
2450The option \fB\-Wcoverage\-mismatch\fR emits a warning instead of an
2451error. \s-1GCC\s0 does not use appropriate feedback profiles, so using this
2452option can result in poorly optimized code. This option is useful
2453only in the case of very minor changes such as bug fixes to an
2454existing code-base.
4b1e227d 2455.SS "Options to Request or Suppress Warnings"
c251ad9e
SS
2456.IX Subsection "Options to Request or Suppress Warnings"
2457Warnings are diagnostic messages that report constructions which
2458are not inherently erroneous but which are risky or suggest there
2459may have been an error.
2460.PP
2461The following language-independent options do not enable specific
2462warnings but control the kinds of diagnostics produced by \s-1GCC\s0.
2463.IP "\fB\-fsyntax\-only\fR" 4
2464.IX Item "-fsyntax-only"
2465Check the code for syntax errors, but don't do anything beyond that.
2466.IP "\fB\-w\fR" 4
2467.IX Item "-w"
2468Inhibit all warning messages.
2469.IP "\fB\-Werror\fR" 4
2470.IX Item "-Werror"
2471Make all warnings into errors.
2472.IP "\fB\-Werror=\fR" 4
2473.IX Item "-Werror="
2474Make the specified warning into an error. The specifier for a warning
2475is appended, for example \fB\-Werror=switch\fR turns the warnings
2476controlled by \fB\-Wswitch\fR into errors. This switch takes a
2477negative form, to be used to negate \fB\-Werror\fR for specific
2478warnings, for example \fB\-Wno\-error=switch\fR makes
2479\&\fB\-Wswitch\fR warnings not be errors, even when \fB\-Werror\fR
2480is in effect. You can use the \fB\-fdiagnostics\-show\-option\fR
2481option to have each controllable warning amended with the option which
2482controls it, to determine what to use with this option.
2483.Sp
2484Note that specifying \fB\-Werror=\fR\fIfoo\fR automatically implies
2485\&\fB\-W\fR\fIfoo\fR. However, \fB\-Wno\-error=\fR\fIfoo\fR does not
2486imply anything.
2487.IP "\fB\-Wfatal\-errors\fR" 4
2488.IX Item "-Wfatal-errors"
2489This option causes the compiler to abort compilation on the first error
2490occurred rather than trying to keep going and printing further error
2491messages.
2492.PP
2493You can request many specific warnings with options beginning
2494\&\fB\-W\fR, for example \fB\-Wimplicit\fR to request warnings on
2495implicit declarations. Each of these specific warning options also
2496has a negative form beginning \fB\-Wno\-\fR to turn off warnings; for
2497example, \fB\-Wno\-implicit\fR. This manual lists only one of the
2498two forms, whichever is not the default. For further,
2499language-specific options also refer to \fB\*(C+ Dialect Options\fR and
2500\&\fBObjective-C and Objective\-\*(C+ Dialect Options\fR.
2501.IP "\fB\-pedantic\fR" 4
2502.IX Item "-pedantic"
2503Issue all the warnings demanded by strict \s-1ISO\s0 C and \s-1ISO\s0 \*(C+;
2504reject all programs that use forbidden extensions, and some other
2505programs that do not follow \s-1ISO\s0 C and \s-1ISO\s0 \*(C+. For \s-1ISO\s0 C, follows the
2506version of the \s-1ISO\s0 C standard specified by any \fB\-std\fR option used.
2507.Sp
2508Valid \s-1ISO\s0 C and \s-1ISO\s0 \*(C+ programs should compile properly with or without
2509this option (though a rare few will require \fB\-ansi\fR or a
2510\&\fB\-std\fR option specifying the required version of \s-1ISO\s0 C). However,
2511without this option, certain \s-1GNU\s0 extensions and traditional C and \*(C+
2512features are supported as well. With this option, they are rejected.
2513.Sp
2514\&\fB\-pedantic\fR does not cause warning messages for use of the
2515alternate keywords whose names begin and end with \fB_\|_\fR. Pedantic
2516warnings are also disabled in the expression that follows
2517\&\f(CW\*(C`_\|_extension_\|_\*(C'\fR. However, only system header files should use
2518these escape routes; application programs should avoid them.
2519.Sp
2520Some users try to use \fB\-pedantic\fR to check programs for strict \s-1ISO\s0
2521C conformance. They soon find that it does not do quite what they want:
2522it finds some non-ISO practices, but not all\-\-\-only those for which
2523\&\s-1ISO\s0 C \fIrequires\fR a diagnostic, and some others for which
2524diagnostics have been added.
2525.Sp
2526A feature to report any failure to conform to \s-1ISO\s0 C might be useful in
2527some instances, but would require considerable additional work and would
2528be quite different from \fB\-pedantic\fR. We don't have plans to
2529support such a feature in the near future.
2530.Sp
2531Where the standard specified with \fB\-std\fR represents a \s-1GNU\s0
2532extended dialect of C, such as \fBgnu89\fR or \fBgnu99\fR, there is a
2533corresponding \fIbase standard\fR, the version of \s-1ISO\s0 C on which the \s-1GNU\s0
2534extended dialect is based. Warnings from \fB\-pedantic\fR are given
2535where they are required by the base standard. (It would not make sense
2536for such warnings to be given only for features not in the specified \s-1GNU\s0
2537C dialect, since by definition the \s-1GNU\s0 dialects of C include all
2538features the compiler supports with the given option, and there would be
2539nothing to warn about.)
2540.IP "\fB\-pedantic\-errors\fR" 4
2541.IX Item "-pedantic-errors"
2542Like \fB\-pedantic\fR, except that errors are produced rather than
2543warnings.
2544.IP "\fB\-Wall\fR" 4
2545.IX Item "-Wall"
2546This enables all the warnings about constructions that some users
2547consider questionable, and that are easy to avoid (or modify to
2548prevent the warning), even in conjunction with macros. This also
2549enables some language-specific warnings described in \fB\*(C+ Dialect
2550Options\fR and \fBObjective-C and Objective\-\*(C+ Dialect Options\fR.
2551.Sp
2552\&\fB\-Wall\fR turns on the following warning flags:
2553.Sp
2554\&\fB\-Waddress
2555\&\-Warray\-bounds\fR (only with\fB \fR\fB\-O2\fR)
2556\&\fB\-Wc++0x\-compat
2557\&\-Wchar\-subscripts
2558\&\-Wimplicit\-int
2559\&\-Wimplicit\-function\-declaration
2560\&\-Wcomment
2561\&\-Wformat
2562\&\-Wmain\fR (only for C/ObjC and unless\fB \fR\fB\-ffreestanding\fR)
2563\&\fB\-Wmissing\-braces
2564\&\-Wnonnull
2565\&\-Wparentheses
2566\&\-Wpointer\-sign
2567\&\-Wreorder
2568\&\-Wreturn\-type
2569\&\-Wsequence\-point
2570\&\-Wsign\-compare\fR (only in \*(C+)
2571\&\fB\-Wstrict\-aliasing
2572\&\-Wstrict\-overflow=1
2573\&\-Wswitch
2574\&\-Wtrigraphs
2575\&\-Wuninitialized
2576\&\-Wunknown\-pragmas
2577\&\-Wunused\-function
2578\&\-Wunused\-label
2579\&\-Wunused\-value
2580\&\-Wunused\-variable
2581\&\-Wvolatile\-register\-var\fR
2582.Sp
2583Note that some warning flags are not implied by \fB\-Wall\fR. Some of
2584them warn about constructions that users generally do not consider
2585questionable, but which occasionally you might wish to check for;
2586others warn about constructions that are necessary or hard to avoid in
2587some cases, and there is no simple way to modify the code to suppress
2588the warning. Some of them are enabled by \fB\-Wextra\fR but many of
2589them must be enabled individually.
2590.IP "\fB\-Wextra\fR" 4
2591.IX Item "-Wextra"
2592This enables some extra warning flags that are not enabled by
2593\&\fB\-Wall\fR. (This option used to be called \fB\-W\fR. The older
2594name is still supported, but the newer name is more descriptive.)
2595.Sp
2596\&\fB\-Wclobbered
2597\&\-Wempty\-body
2598\&\-Wignored\-qualifiers
2599\&\-Wmissing\-field\-initializers
2600\&\-Wmissing\-parameter\-type\fR (C only)
2601\&\fB\-Wold\-style\-declaration\fR (C only)
2602\&\fB\-Woverride\-init
2603\&\-Wsign\-compare
2604\&\-Wtype\-limits
2605\&\-Wuninitialized
2606\&\-Wunused\-parameter\fR (only with\fB \fR\fB\-Wunused\fR\fB \fRor\fB \fR\fB\-Wall\fR) \fB \fR
2607.Sp
2608The option \fB\-Wextra\fR also prints warning messages for the
2609following cases:
2610.RS 4
2611.IP "\(bu" 4
2612A pointer is compared against integer zero with \fB<\fR, \fB<=\fR,
2613\&\fB>\fR, or \fB>=\fR.
2614.IP "\(bu" 4
2615(\*(C+ only) An enumerator and a non-enumerator both appear in a
2616conditional expression.
2617.IP "\(bu" 4
2618(\*(C+ only) Ambiguous virtual bases.
2619.IP "\(bu" 4
2620(\*(C+ only) Subscripting an array which has been declared \fBregister\fR.
2621.IP "\(bu" 4
2622(\*(C+ only) Taking the address of a variable which has been declared
2623\&\fBregister\fR.
2624.IP "\(bu" 4
2625(\*(C+ only) A base class is not initialized in a derived class' copy
2626constructor.
2627.RE
2628.RS 4
2629.RE
2630.IP "\fB\-Wchar\-subscripts\fR" 4
2631.IX Item "-Wchar-subscripts"
2632Warn if an array subscript has type \f(CW\*(C`char\*(C'\fR. This is a common cause
2633of error, as programmers often forget that this type is signed on some
2634machines.
2635This warning is enabled by \fB\-Wall\fR.
2636.IP "\fB\-Wcomment\fR" 4
2637.IX Item "-Wcomment"
2638Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR
2639comment, or whenever a Backslash-Newline appears in a \fB//\fR comment.
2640This warning is enabled by \fB\-Wall\fR.
2641.IP "\fB\-Wformat\fR" 4
2642.IX Item "-Wformat"
2643Check calls to \f(CW\*(C`printf\*(C'\fR and \f(CW\*(C`scanf\*(C'\fR, etc., to make sure that
2644the arguments supplied have types appropriate to the format string
2645specified, and that the conversions specified in the format string make
2646sense. This includes standard functions, and others specified by format
2647attributes, in the \f(CW\*(C`printf\*(C'\fR,
2648\&\f(CW\*(C`scanf\*(C'\fR, \f(CW\*(C`strftime\*(C'\fR and \f(CW\*(C`strfmon\*(C'\fR (an X/Open extension,
2649not in the C standard) families (or other target-specific families).
2650Which functions are checked without format attributes having been
2651specified depends on the standard version selected, and such checks of
2652functions without the attribute specified are disabled by
2653\&\fB\-ffreestanding\fR or \fB\-fno\-builtin\fR.
2654.Sp
2655The formats are checked against the format features supported by \s-1GNU\s0
2656libc version 2.2. These include all \s-1ISO\s0 C90 and C99 features, as well
2657as features from the Single Unix Specification and some \s-1BSD\s0 and \s-1GNU\s0
2658extensions. Other library implementations may not support all these
2659features; \s-1GCC\s0 does not support warning about features that go beyond a
2660particular library's limitations. However, if \fB\-pedantic\fR is used
2661with \fB\-Wformat\fR, warnings will be given about format features not
2662in the selected standard version (but not for \f(CW\*(C`strfmon\*(C'\fR formats,
2663since those are not in any version of the C standard).
2664.Sp
2665Since \fB\-Wformat\fR also checks for null format arguments for
2666several functions, \fB\-Wformat\fR also implies \fB\-Wnonnull\fR.
2667.Sp
2668\&\fB\-Wformat\fR is included in \fB\-Wall\fR. For more control over some
2669aspects of format checking, the options \fB\-Wformat\-y2k\fR,
2670\&\fB\-Wno\-format\-extra\-args\fR, \fB\-Wno\-format\-zero\-length\fR,
2671\&\fB\-Wformat\-nonliteral\fR, \fB\-Wformat\-security\fR, and
2672\&\fB\-Wformat=2\fR are available, but are not included in \fB\-Wall\fR.
2673.IP "\fB\-Wformat\-y2k\fR" 4
2674.IX Item "-Wformat-y2k"
2675If \fB\-Wformat\fR is specified, also warn about \f(CW\*(C`strftime\*(C'\fR
2676formats which may yield only a two-digit year.
2677.IP "\fB\-Wno\-format\-contains\-nul\fR" 4
2678.IX Item "-Wno-format-contains-nul"
2679If \fB\-Wformat\fR is specified, do not warn about format strings that
2680contain \s-1NUL\s0 bytes.
2681.IP "\fB\-Wno\-format\-extra\-args\fR" 4
2682.IX Item "-Wno-format-extra-args"
2683If \fB\-Wformat\fR is specified, do not warn about excess arguments to a
2684\&\f(CW\*(C`printf\*(C'\fR or \f(CW\*(C`scanf\*(C'\fR format function. The C standard specifies
2685that such arguments are ignored.