OSDN Git Service

ce94a32ae996ef809391f26c13fcbe3d0093cfe8
[pf3gnuchains/gcc-fork.git] / gcc / doc / invoke.texi
1 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2 @c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
3 @c Free Software Foundation, Inc.
4 @c This is part of the GCC manual.
5 @c For copying conditions, see the file gcc.texi.
6
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
11
12 @c man begin COPYRIGHT
13 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
15 Free Software Foundation, Inc.
16
17 Permission is granted to copy, distribute and/or modify this document
18 under the terms of the GNU Free Documentation License, Version 1.2 or
19 any later version published by the Free Software Foundation; with the
20 Invariant Sections being ``GNU General Public License'' and ``Funding
21 Free Software'', the Front-Cover texts being (a) (see below), and with
22 the Back-Cover Texts being (b) (see below).  A copy of the license is
23 included in the gfdl(7) man page.
24
25 (a) The FSF's Front-Cover Text is:
26
27      A GNU Manual
28
29 (b) The FSF's Back-Cover Text is:
30
31      You have freedom to copy and modify this GNU Manual, like GNU
32      software.  Copies published by the Free Software Foundation raise
33      funds for GNU development.
34 @c man end
35 @c Set file name and title for the man page.
36 @setfilename gcc
37 @settitle GNU project C and C++ compiler
38 @c man begin SYNOPSIS
39 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
40     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
41     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
42     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
43     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
44     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
45     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
46
47 Only the most useful options are listed here; see below for the
48 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
49 @c man end
50 @c man begin SEEALSO
51 gpl(7), gfdl(7), fsf-funding(7),
52 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
53 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
54 @file{ld}, @file{binutils} and @file{gdb}.
55 @c man end
56 @c man begin BUGS
57 For instructions on reporting bugs, see
58 @w{@value{BUGURL}}.
59 @c man end
60 @c man begin AUTHOR
61 See the Info entry for @command{gcc}, or
62 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
63 for contributors to GCC@.
64 @c man end
65 @end ignore
66
67 @node Invoking GCC
68 @chapter GCC Command Options
69 @cindex GCC command options
70 @cindex command options
71 @cindex options, GCC command
72
73 @c man begin DESCRIPTION
74 When you invoke GCC, it normally does preprocessing, compilation,
75 assembly and linking.  The ``overall options'' allow you to stop this
76 process at an intermediate stage.  For example, the @option{-c} option
77 says not to run the linker.  Then the output consists of object files
78 output by the assembler.
79
80 Other options are passed on to one stage of processing.  Some options
81 control the preprocessor and others the compiler itself.  Yet other
82 options control the assembler and linker; most of these are not
83 documented here, since you rarely need to use any of them.
84
85 @cindex C compilation options
86 Most of the command line options that you can use with GCC are useful
87 for C programs; when an option is only useful with another language
88 (usually C++), the explanation says so explicitly.  If the description
89 for a particular option does not mention a source language, you can use
90 that option with all supported languages.
91
92 @cindex C++ compilation options
93 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
94 options for compiling C++ programs.
95
96 @cindex grouping options
97 @cindex options, grouping
98 The @command{gcc} program accepts options and file names as operands.  Many
99 options have multi-letter names; therefore multiple single-letter options
100 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
101 -v}}.
102
103 @cindex order of options
104 @cindex options, order
105 You can mix options and other arguments.  For the most part, the order
106 you use doesn't matter.  Order does matter when you use several
107 options of the same kind; for example, if you specify @option{-L} more
108 than once, the directories are searched in the order specified.  Also,
109 the placement of the @option{-l} option is significant.
110
111 Many options have long names starting with @samp{-f} or with
112 @samp{-W}---for example,
113 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
114 these have both positive and negative forms; the negative form of
115 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
116 only one of these two forms, whichever one is not the default.
117
118 @c man end
119
120 @xref{Option Index}, for an index to GCC's options.
121
122 @menu
123 * Option Summary::      Brief list of all options, without explanations.
124 * Overall Options::     Controlling the kind of output:
125                         an executable, object files, assembler files,
126                         or preprocessed source.
127 * Invoking G++::        Compiling C++ programs.
128 * C Dialect Options::   Controlling the variant of C language compiled.
129 * C++ Dialect Options:: Variations on C++.
130 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
131                         and Objective-C++.
132 * Language Independent Options:: Controlling how diagnostics should be
133                         formatted.
134 * Warning Options::     How picky should the compiler be?
135 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
136 * Optimize Options::    How much optimization?
137 * Preprocessor Options:: Controlling header files and macro definitions.
138                          Also, getting dependency information for Make.
139 * Assembler Options::   Passing options to the assembler.
140 * Link Options::        Specifying libraries and so on.
141 * Directory Options::   Where to find header files and libraries.
142                         Where to find the compiler executable files.
143 * Spec Files::          How to pass switches to sub-processes.
144 * Target Options::      Running a cross-compiler, or an old version of GCC.
145 * Submodel Options::    Specifying minor hardware or convention variations,
146                         such as 68010 vs 68020.
147 * Code Gen Options::    Specifying conventions for function calls, data layout
148                         and register usage.
149 * Environment Variables:: Env vars that affect GCC.
150 * Precompiled Headers:: Compiling a header once, and using it many times.
151 @end menu
152
153 @c man begin OPTIONS
154
155 @node Option Summary
156 @section Option Summary
157
158 Here is a summary of all the options, grouped by type.  Explanations are
159 in the following sections.
160
161 @table @emph
162 @item Overall Options
163 @xref{Overall Options,,Options Controlling the Kind of Output}.
164 @gccoptlist{-c  -S  -E  -o @var{file}  -combine  -no-canonical-prefixes  @gol
165 -pipe  -pass-exit-codes  @gol
166 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
167 --version -wrapper@@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}}
168
169 @item C Language Options
170 @xref{C Dialect Options,,Options Controlling C Dialect}.
171 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
172 -aux-info @var{filename} @gol
173 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
174 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
175 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
176 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
177 -fsigned-bitfields  -fsigned-char @gol
178 -funsigned-bitfields  -funsigned-char}
179
180 @item C++ Language Options
181 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
182 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
183 -fconserve-space  -ffriend-injection @gol
184 -fno-elide-constructors @gol
185 -fno-enforce-eh-specs @gol
186 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
187 -fno-implicit-templates @gol
188 -fno-implicit-inline-templates @gol
189 -fno-implement-inlines  -fms-extensions @gol
190 -fno-nonansi-builtins  -fno-operator-names @gol
191 -fno-optional-diags  -fpermissive @gol
192 -fno-pretty-templates @gol
193 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
194 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
195 -fno-default-inline  -fvisibility-inlines-hidden @gol
196 -fvisibility-ms-compat @gol
197 -Wabi  -Wctor-dtor-privacy @gol
198 -Wnon-virtual-dtor  -Wreorder @gol
199 -Weffc++  -Wstrict-null-sentinel @gol
200 -Wno-non-template-friend  -Wold-style-cast @gol
201 -Woverloaded-virtual  -Wno-pmf-conversions @gol
202 -Wsign-promo}
203
204 @item Objective-C and Objective-C++ Language Options
205 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
206 Objective-C and Objective-C++ Dialects}.
207 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
208 -fgnu-runtime  -fnext-runtime @gol
209 -fno-nil-receivers @gol
210 -fobjc-call-cxx-cdtors @gol
211 -fobjc-direct-dispatch @gol
212 -fobjc-exceptions @gol
213 -fobjc-gc @gol
214 -freplace-objc-classes @gol
215 -fzero-link @gol
216 -gen-decls @gol
217 -Wassign-intercept @gol
218 -Wno-protocol  -Wselector @gol
219 -Wstrict-selector-match @gol
220 -Wundeclared-selector}
221
222 @item Language Independent Options
223 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
224 @gccoptlist{-fmessage-length=@var{n}  @gol
225 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
226 -fdiagnostics-show-option}
227
228 @item Warning Options
229 @xref{Warning Options,,Options to Request or Suppress Warnings}.
230 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
231 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
232 -Wno-attributes -Wno-builtin-macro-redefined @gol
233 -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
234 -Wchar-subscripts -Wclobbered  -Wcomment @gol
235 -Wconversion  -Wcoverage-mismatch  -Wno-deprecated  @gol
236 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
237 -Wno-div-by-zero -Wempty-body  -Wenum-compare -Wno-endif-labels @gol
238 -Werror  -Werror=* @gol
239 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
240 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
241 -Wformat-security  -Wformat-y2k @gol
242 -Wframe-larger-than=@var{len} -Wjump-misses-init -Wignored-qualifiers @gol
243 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
244 -Winit-self  -Winline @gol
245 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
246 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
247 -Wlogical-op -Wlong-long @gol
248 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
249 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
250 -Wmissing-noreturn  -Wno-mudflap @gol
251 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
252 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
253 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
254 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
255 -Wredundant-decls @gol
256 -Wreturn-type  -Wsequence-point  -Wshadow @gol
257 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
258 -Wstrict-aliasing -Wstrict-aliasing=n @gol
259 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
260 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
261 -Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol
262 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
263 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
264 -Wunused-label  -Wunused-parameter -Wno-unused-result -Wunused-value  -Wunused-variable @gol
265 -Wvariadic-macros -Wvla @gol
266 -Wvolatile-register-var  -Wwrite-strings}
267
268 @item C and Objective-C-only Warning Options
269 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
270 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
271 -Wold-style-declaration  -Wold-style-definition @gol
272 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
273 -Wdeclaration-after-statement -Wpointer-sign}
274
275 @item Debugging Options
276 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
277 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
278 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
279 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
280 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
281 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
282 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
283 -fdump-statistics @gol
284 -fdump-tree-all @gol
285 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
286 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
287 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
288 -fdump-tree-ch @gol
289 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
290 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
291 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
293 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
294 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
295 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
296 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
297 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
298 -fdump-tree-nrv -fdump-tree-vect @gol
299 -fdump-tree-sink @gol
300 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
301 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
302 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
303 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
304 -ftree-vectorizer-verbose=@var{n} @gol
305 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
306 -fdump-final-insns=@var{file} @gol
307 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
308 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
309 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
310 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
311 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
312 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
313 -ftest-coverage  -ftime-report -fvar-tracking @gol
314 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
315 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
316 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
317 -fdebug-prefix-map=@var{old}=@var{new} @gol
318 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
319 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
320 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
321 -print-multi-directory  -print-multi-lib @gol
322 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
323 -print-sysroot -print-sysroot-headers-suffix @gol
324 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
325
326 @item Optimization Options
327 @xref{Optimize Options,,Options that Control Optimization}.
328 @gccoptlist{
329 -falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
330 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
331 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
332 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
333 -fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping @gol
334 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol
335 -fdata-sections -fdce -fdce @gol
336 -fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
337 -fearly-inlining -fexpensive-optimizations -ffast-math @gol
338 -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
339 -fforward-propagate -ffunction-sections @gol
340 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
341 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
342 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
343 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol
344 -fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
345 -fipa-type-escape -fira-algorithm=@var{algorithm} @gol
346 -fira-region=@var{region} -fira-coalesce -fno-ira-share-save-slots @gol
347 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
348 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
349 -floop-block -floop-interchange -floop-strip-mine @gol
350 -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
351 -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
352 -fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
353 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
354 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
355 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
356 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
357 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
358 -fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
359 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
360 -fprofile-generate=@var{path} @gol
361 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
362 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
363 -freorder-blocks-and-partition -freorder-functions @gol
364 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
365 -frounding-math -fsched2-use-superblocks @gol
366 -fsched2-use-traces -fsched-spec-load -fsched-spec-load-dangerous @gol
367 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
368 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
369 -fsched-spec-insn-heuristic -fsched-reg-pressure-heuristic @gol
370 -fsched-rank-heuristic -fsched-last-insn-heuristic @gol
371 -fsched-dep-count-heuristic @gol
372 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
373 -fselective-scheduling -fselective-scheduling2 @gol
374 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
375 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
376 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
377 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
378 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
379 -ftree-copyrename -ftree-dce @gol
380 -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-im @gol
381 -ftree-phiprop -ftree-loop-distribution @gol
382 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
383 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
384 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
385 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
386 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
387 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
388 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
389 -fwhole-program @gol
390 --param @var{name}=@var{value}
391 -O  -O0  -O1  -O2  -O3  -Os}
392
393 @item Preprocessor Options
394 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
395 @gccoptlist{-A@var{question}=@var{answer} @gol
396 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
397 -C  -dD  -dI  -dM  -dN @gol
398 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
399 -idirafter @var{dir} @gol
400 -include @var{file}  -imacros @var{file} @gol
401 -iprefix @var{file}  -iwithprefix @var{dir} @gol
402 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
403 -imultilib @var{dir} -isysroot @var{dir} @gol
404 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
405 -P  -fworking-directory  -remap @gol
406 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
407 -Xpreprocessor @var{option}}
408
409 @item Assembler Option
410 @xref{Assembler Options,,Passing Options to the Assembler}.
411 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
412
413 @item Linker Options
414 @xref{Link Options,,Options for Linking}.
415 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
416 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
417 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
418 -shared-libgcc  -symbolic @gol
419 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
420 -u @var{symbol}}
421
422 @item Directory Options
423 @xref{Directory Options,,Options for Directory Search}.
424 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
425 -specs=@var{file}  -I- --sysroot=@var{dir}}
426
427 @item Target Options
428 @c I wrote this xref this way to avoid overfull hbox. -- rms
429 @xref{Target Options}.
430 @gccoptlist{-V @var{version}  -b @var{machine}}
431
432 @item Machine Dependent Options
433 @xref{Submodel Options,,Hardware Models and Configurations}.
434 @c This list is ordered alphanumerically by subsection name.
435 @c Try and put the significant identifier (CPU or system) first,
436 @c so users have a clue at guessing where the ones they want will be.
437
438 @emph{ARC Options}
439 @gccoptlist{-EB  -EL @gol
440 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
441 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
442
443 @emph{ARM Options}
444 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
445 -mabi=@var{name} @gol
446 -mapcs-stack-check  -mno-apcs-stack-check @gol
447 -mapcs-float  -mno-apcs-float @gol
448 -mapcs-reentrant  -mno-apcs-reentrant @gol
449 -msched-prolog  -mno-sched-prolog @gol
450 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
451 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
452 -mfp16-format=@var{name}
453 -mthumb-interwork  -mno-thumb-interwork @gol
454 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
455 -mstructure-size-boundary=@var{n} @gol
456 -mabort-on-noreturn @gol
457 -mlong-calls  -mno-long-calls @gol
458 -msingle-pic-base  -mno-single-pic-base @gol
459 -mpic-register=@var{reg} @gol
460 -mnop-fun-dllimport @gol
461 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
462 -mpoke-function-name @gol
463 -mthumb  -marm @gol
464 -mtpcs-frame  -mtpcs-leaf-frame @gol
465 -mcaller-super-interworking  -mcallee-super-interworking @gol
466 -mtp=@var{name} @gol
467 -mword-relocations @gol
468 -mfix-cortex-m3-ldrd}
469
470 @emph{AVR Options}
471 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
472 -mcall-prologues  -mtiny-stack  -mint8}
473
474 @emph{Blackfin Options}
475 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
476 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
477 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
478 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
479 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
480 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
481 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
482 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
483 -micplb}
484
485 @emph{CRIS Options}
486 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
487 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
488 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
489 -mstack-align  -mdata-align  -mconst-align @gol
490 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
491 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
492 -mmul-bug-workaround  -mno-mul-bug-workaround}
493
494 @emph{CRX Options}
495 @gccoptlist{-mmac -mpush-args}
496
497 @emph{Darwin Options}
498 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
499 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
500 -client_name  -compatibility_version  -current_version @gol
501 -dead_strip @gol
502 -dependency-file  -dylib_file  -dylinker_install_name @gol
503 -dynamic  -dynamiclib  -exported_symbols_list @gol
504 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
505 -force_flat_namespace  -headerpad_max_install_names @gol
506 -iframework @gol
507 -image_base  -init  -install_name  -keep_private_externs @gol
508 -multi_module  -multiply_defined  -multiply_defined_unused @gol
509 -noall_load   -no_dead_strip_inits_and_terms @gol
510 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
511 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
512 -private_bundle  -read_only_relocs  -sectalign @gol
513 -sectobjectsymbols  -whyload  -seg1addr @gol
514 -sectcreate  -sectobjectsymbols  -sectorder @gol
515 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
516 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
517 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
518 -single_module  -static  -sub_library  -sub_umbrella @gol
519 -twolevel_namespace  -umbrella  -undefined @gol
520 -unexported_symbols_list  -weak_reference_mismatches @gol
521 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
522 -mkernel -mone-byte-bool}
523
524 @emph{DEC Alpha Options}
525 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
526 -mieee  -mieee-with-inexact  -mieee-conformant @gol
527 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
528 -mtrap-precision=@var{mode}  -mbuild-constants @gol
529 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
530 -mbwx  -mmax  -mfix  -mcix @gol
531 -mfloat-vax  -mfloat-ieee @gol
532 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
533 -msmall-text  -mlarge-text @gol
534 -mmemory-latency=@var{time}}
535
536 @emph{DEC Alpha/VMS Options}
537 @gccoptlist{-mvms-return-codes}
538
539 @emph{FR30 Options}
540 @gccoptlist{-msmall-model -mno-lsim}
541
542 @emph{FRV Options}
543 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
544 -mhard-float  -msoft-float @gol
545 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
546 -mdouble  -mno-double @gol
547 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
548 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
549 -mlinked-fp  -mlong-calls  -malign-labels @gol
550 -mlibrary-pic  -macc-4  -macc-8 @gol
551 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
552 -moptimize-membar -mno-optimize-membar @gol
553 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
554 -mvliw-branch  -mno-vliw-branch @gol
555 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
556 -mno-nested-cond-exec  -mtomcat-stats @gol
557 -mTLS -mtls @gol
558 -mcpu=@var{cpu}}
559
560 @emph{GNU/Linux Options}
561 @gccoptlist{-muclibc}
562
563 @emph{H8/300 Options}
564 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
565
566 @emph{HPPA Options}
567 @gccoptlist{-march=@var{architecture-type} @gol
568 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
569 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
570 -mfixed-range=@var{register-range} @gol
571 -mjump-in-delay -mlinker-opt -mlong-calls @gol
572 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
573 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
574 -mno-jump-in-delay  -mno-long-load-store @gol
575 -mno-portable-runtime  -mno-soft-float @gol
576 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
577 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
578 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
579 -munix=@var{unix-std}  -nolibdld  -static  -threads}
580
581 @emph{i386 and x86-64 Options}
582 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
583 -mfpmath=@var{unit} @gol
584 -masm=@var{dialect}  -mno-fancy-math-387 @gol
585 -mno-fp-ret-in-387  -msoft-float @gol
586 -mno-wide-multiply  -mrtd  -malign-double @gol
587 -mpreferred-stack-boundary=@var{num}
588 -mincoming-stack-boundary=@var{num}
589 -mcld -mcx16 -msahf -mmovbe -mcrc32 -mrecip @gol
590 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
591 -maes -mpclmul @gol
592 -msse4a -m3dnow -mpopcnt -mabm -msse5 @gol
593 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
594 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
595 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
596 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
597 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
598 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
599 -mcmodel=@var{code-model} -mabi=@var{name} @gol
600 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
601 -mfused-madd -mno-fused-madd -msse2avx}
602
603 @emph{IA-64 Options}
604 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
605 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
606 -mconstant-gp  -mauto-pic  -mfused-madd @gol
607 -minline-float-divide-min-latency @gol
608 -minline-float-divide-max-throughput @gol
609 -mno-inline-float-divide @gol
610 -minline-int-divide-min-latency @gol
611 -minline-int-divide-max-throughput  @gol
612 -mno-inline-int-divide @gol
613 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
614 -mno-inline-sqrt @gol
615 -mdwarf2-asm -mearly-stop-bits @gol
616 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
617 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
618 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
619 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
620 -msched-spec-ldc -msched-spec-control-ldc @gol
621 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
622 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
623 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
624 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
625
626 @emph{M32R/D Options}
627 @gccoptlist{-m32r2 -m32rx -m32r @gol
628 -mdebug @gol
629 -malign-loops -mno-align-loops @gol
630 -missue-rate=@var{number} @gol
631 -mbranch-cost=@var{number} @gol
632 -mmodel=@var{code-size-model-type} @gol
633 -msdata=@var{sdata-type} @gol
634 -mno-flush-func -mflush-func=@var{name} @gol
635 -mno-flush-trap -mflush-trap=@var{number} @gol
636 -G @var{num}}
637
638 @emph{M32C Options}
639 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
640
641 @emph{M680x0 Options}
642 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
643 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
644 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
645 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
646 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
647 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
648 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
649 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
650 -mxgot -mno-xgot}
651
652 @emph{M68hc1x Options}
653 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
654 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
655 -msoft-reg-count=@var{count}}
656
657 @emph{MCore Options}
658 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
659 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
660 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
661 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
662 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
663
664 @emph{MeP Options}
665 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
666 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
667 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
668 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
669 -mtiny=@var{n}}
670
671 @emph{MIPS Options}
672 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
673 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
674 -mips64  -mips64r2 @gol
675 -mips16  -mno-mips16  -mflip-mips16 @gol
676 -minterlink-mips16  -mno-interlink-mips16 @gol
677 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
678 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
679 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
680 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
681 -mfpu=@var{fpu-type} @gol
682 -msmartmips  -mno-smartmips @gol
683 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
684 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
685 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
686 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
687 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
688 -membedded-data  -mno-embedded-data @gol
689 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
690 -mcode-readable=@var{setting} @gol
691 -msplit-addresses  -mno-split-addresses @gol
692 -mexplicit-relocs  -mno-explicit-relocs @gol
693 -mcheck-zero-division  -mno-check-zero-division @gol
694 -mdivide-traps  -mdivide-breaks @gol
695 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
696 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
697 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
698 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
699 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
700 -mflush-func=@var{func}  -mno-flush-func @gol
701 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
702 -mfp-exceptions -mno-fp-exceptions @gol
703 -mvr4130-align -mno-vr4130-align -msynci -mno-synci}
704
705 @emph{MMIX Options}
706 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
707 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
708 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
709 -mno-base-addresses  -msingle-exit  -mno-single-exit}
710
711 @emph{MN10300 Options}
712 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
713 -mam33  -mno-am33 @gol
714 -mam33-2  -mno-am33-2 @gol
715 -mreturn-pointer-on-d0 @gol
716 -mno-crt0  -mrelax}
717
718 @emph{PDP-11 Options}
719 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
720 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
721 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
722 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
723 -mbranch-expensive  -mbranch-cheap @gol
724 -msplit  -mno-split  -munix-asm  -mdec-asm}
725
726 @emph{picoChip Options}
727 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N}
728 -msymbol-as-address -mno-inefficient-warnings}
729
730 @emph{PowerPC Options}
731 See RS/6000 and PowerPC Options.
732
733 @emph{RS/6000 and PowerPC Options}
734 @gccoptlist{-mcpu=@var{cpu-type} @gol
735 -mtune=@var{cpu-type} @gol
736 -mpower  -mno-power  -mpower2  -mno-power2 @gol
737 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
738 -maltivec  -mno-altivec @gol
739 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
740 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
741 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
742 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
743 -mnew-mnemonics  -mold-mnemonics @gol
744 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
745 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
746 -malign-power  -malign-natural @gol
747 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
748 -msingle-float -mdouble-float -msimple-fpu @gol
749 -mstring  -mno-string  -mupdate  -mno-update @gol
750 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
751 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
752 -mstrict-align  -mno-strict-align  -mrelocatable @gol
753 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
754 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
755 -mdynamic-no-pic  -maltivec  -mswdiv @gol
756 -mprioritize-restricted-insns=@var{priority} @gol
757 -msched-costly-dep=@var{dependence_type} @gol
758 -minsert-sched-nops=@var{scheme} @gol
759 -mcall-sysv  -mcall-netbsd @gol
760 -maix-struct-return  -msvr4-struct-return @gol
761 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
762 -misel -mno-isel @gol
763 -misel=yes  -misel=no @gol
764 -mspe -mno-spe @gol
765 -mspe=yes  -mspe=no @gol
766 -mpaired @gol
767 -mgen-cell-microcode -mwarn-cell-microcode @gol
768 -mvrsave -mno-vrsave @gol
769 -mmulhw -mno-mulhw @gol
770 -mdlmzb -mno-dlmzb @gol
771 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
772 -mprototype  -mno-prototype @gol
773 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
774 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread}
775
776 @emph{S/390 and zSeries Options}
777 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
778 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
779 -mlong-double-64 -mlong-double-128 @gol
780 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
781 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
782 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
783 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
784 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
785
786 @emph{Score Options}
787 @gccoptlist{-meb -mel @gol
788 -mnhwloop @gol
789 -muls @gol
790 -mmac @gol
791 -mscore5 -mscore5u -mscore7 -mscore7d}
792
793 @emph{SH Options}
794 @gccoptlist{-m1  -m2  -m2e @gol
795 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
796 -m3  -m3e @gol
797 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
798 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
799 -m5-64media  -m5-64media-nofpu @gol
800 -m5-32media  -m5-32media-nofpu @gol
801 -m5-compact  -m5-compact-nofpu @gol
802 -mb  -ml  -mdalign  -mrelax @gol
803 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
804 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
805 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
806 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
807 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
808 -minvalid-symbols}
809
810 @emph{SPARC Options}
811 @gccoptlist{-mcpu=@var{cpu-type} @gol
812 -mtune=@var{cpu-type} @gol
813 -mcmodel=@var{code-model} @gol
814 -m32  -m64  -mapp-regs  -mno-app-regs @gol
815 -mfaster-structs  -mno-faster-structs @gol
816 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
817 -mhard-quad-float  -msoft-quad-float @gol
818 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
819 -mstack-bias  -mno-stack-bias @gol
820 -munaligned-doubles  -mno-unaligned-doubles @gol
821 -mv8plus  -mno-v8plus  -mvis  -mno-vis
822 -threads -pthreads -pthread}
823
824 @emph{SPU Options}
825 @gccoptlist{-mwarn-reloc -merror-reloc @gol
826 -msafe-dma -munsafe-dma @gol
827 -mbranch-hints @gol
828 -msmall-mem -mlarge-mem -mstdmain @gol
829 -mfixed-range=@var{register-range}}
830
831 @emph{System V Options}
832 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
833
834 @emph{V850 Options}
835 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
836 -mprolog-function  -mno-prolog-function  -mspace @gol
837 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
838 -mapp-regs  -mno-app-regs @gol
839 -mdisable-callt  -mno-disable-callt @gol
840 -mv850e1 @gol
841 -mv850e @gol
842 -mv850  -mbig-switch}
843
844 @emph{VAX Options}
845 @gccoptlist{-mg  -mgnu  -munix}
846
847 @emph{VxWorks Options}
848 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
849 -Xbind-lazy  -Xbind-now}
850
851 @emph{x86-64 Options}
852 See i386 and x86-64 Options.
853
854 @emph{i386 and x86-64 Windows Options}
855 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
856 -mnop-fun-dllimport -mthread -municode -mwin32 -mwindows}
857
858 @emph{Xstormy16 Options}
859 @gccoptlist{-msim}
860
861 @emph{Xtensa Options}
862 @gccoptlist{-mconst16 -mno-const16 @gol
863 -mfused-madd  -mno-fused-madd @gol
864 -mserialize-volatile  -mno-serialize-volatile @gol
865 -mtext-section-literals  -mno-text-section-literals @gol
866 -mtarget-align  -mno-target-align @gol
867 -mlongcalls  -mno-longcalls}
868
869 @emph{zSeries Options}
870 See S/390 and zSeries Options.
871
872 @item Code Generation Options
873 @xref{Code Gen Options,,Options for Code Generation Conventions}.
874 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
875 -ffixed-@var{reg}  -fexceptions @gol
876 -fnon-call-exceptions  -funwind-tables @gol
877 -fasynchronous-unwind-tables @gol
878 -finhibit-size-directive  -finstrument-functions @gol
879 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
880 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
881 -fno-common  -fno-ident @gol
882 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
883 -fno-jump-tables @gol
884 -frecord-gcc-switches @gol
885 -freg-struct-return  -fshort-enums @gol
886 -fshort-double  -fshort-wchar @gol
887 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
888 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
889 -fno-stack-limit  -fargument-alias  -fargument-noalias @gol
890 -fargument-noalias-global  -fargument-noalias-anything @gol
891 -fleading-underscore  -ftls-model=@var{model} @gol
892 -ftrapv  -fwrapv  -fbounds-check @gol
893 -fvisibility}
894 @end table
895
896 @menu
897 * Overall Options::     Controlling the kind of output:
898                         an executable, object files, assembler files,
899                         or preprocessed source.
900 * C Dialect Options::   Controlling the variant of C language compiled.
901 * C++ Dialect Options:: Variations on C++.
902 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
903                         and Objective-C++.
904 * Language Independent Options:: Controlling how diagnostics should be
905                         formatted.
906 * Warning Options::     How picky should the compiler be?
907 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
908 * Optimize Options::    How much optimization?
909 * Preprocessor Options:: Controlling header files and macro definitions.
910                          Also, getting dependency information for Make.
911 * Assembler Options::   Passing options to the assembler.
912 * Link Options::        Specifying libraries and so on.
913 * Directory Options::   Where to find header files and libraries.
914                         Where to find the compiler executable files.
915 * Spec Files::          How to pass switches to sub-processes.
916 * Target Options::      Running a cross-compiler, or an old version of GCC.
917 @end menu
918
919 @node Overall Options
920 @section Options Controlling the Kind of Output
921
922 Compilation can involve up to four stages: preprocessing, compilation
923 proper, assembly and linking, always in that order.  GCC is capable of
924 preprocessing and compiling several files either into several
925 assembler input files, or into one assembler input file; then each
926 assembler input file produces an object file, and linking combines all
927 the object files (those newly compiled, and those specified as input)
928 into an executable file.
929
930 @cindex file name suffix
931 For any given input file, the file name suffix determines what kind of
932 compilation is done:
933
934 @table @gcctabopt
935 @item @var{file}.c
936 C source code which must be preprocessed.
937
938 @item @var{file}.i
939 C source code which should not be preprocessed.
940
941 @item @var{file}.ii
942 C++ source code which should not be preprocessed.
943
944 @item @var{file}.m
945 Objective-C source code.  Note that you must link with the @file{libobjc}
946 library to make an Objective-C program work.
947
948 @item @var{file}.mi
949 Objective-C source code which should not be preprocessed.
950
951 @item @var{file}.mm
952 @itemx @var{file}.M
953 Objective-C++ source code.  Note that you must link with the @file{libobjc}
954 library to make an Objective-C++ program work.  Note that @samp{.M} refers
955 to a literal capital M@.
956
957 @item @var{file}.mii
958 Objective-C++ source code which should not be preprocessed.
959
960 @item @var{file}.h
961 C, C++, Objective-C or Objective-C++ header file to be turned into a
962 precompiled header.
963
964 @item @var{file}.cc
965 @itemx @var{file}.cp
966 @itemx @var{file}.cxx
967 @itemx @var{file}.cpp
968 @itemx @var{file}.CPP
969 @itemx @var{file}.c++
970 @itemx @var{file}.C
971 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
972 the last two letters must both be literally @samp{x}.  Likewise,
973 @samp{.C} refers to a literal capital C@.
974
975 @item @var{file}.mm
976 @itemx @var{file}.M
977 Objective-C++ source code which must be preprocessed.
978
979 @item @var{file}.mii
980 Objective-C++ source code which should not be preprocessed.
981
982 @item @var{file}.hh
983 @itemx @var{file}.H
984 @itemx @var{file}.hp
985 @itemx @var{file}.hxx
986 @itemx @var{file}.hpp
987 @itemx @var{file}.HPP
988 @itemx @var{file}.h++
989 @itemx @var{file}.tcc
990 C++ header file to be turned into a precompiled header.
991
992 @item @var{file}.f
993 @itemx @var{file}.for
994 @itemx @var{file}.ftn
995 Fixed form Fortran source code which should not be preprocessed.
996
997 @item @var{file}.F
998 @itemx @var{file}.FOR
999 @itemx @var{file}.fpp
1000 @itemx @var{file}.FPP
1001 @itemx @var{file}.FTN
1002 Fixed form Fortran source code which must be preprocessed (with the traditional
1003 preprocessor).
1004
1005 @item @var{file}.f90
1006 @itemx @var{file}.f95
1007 @itemx @var{file}.f03
1008 @itemx @var{file}.f08
1009 Free form Fortran source code which should not be preprocessed.
1010
1011 @item @var{file}.F90
1012 @itemx @var{file}.F95
1013 @itemx @var{file}.F03
1014 @itemx @var{file}.F08
1015 Free form Fortran source code which must be preprocessed (with the
1016 traditional preprocessor).
1017
1018 @c FIXME: Descriptions of Java file types.
1019 @c @var{file}.java
1020 @c @var{file}.class
1021 @c @var{file}.zip
1022 @c @var{file}.jar
1023
1024 @item @var{file}.ads
1025 Ada source code file which contains a library unit declaration (a
1026 declaration of a package, subprogram, or generic, or a generic
1027 instantiation), or a library unit renaming declaration (a package,
1028 generic, or subprogram renaming declaration).  Such files are also
1029 called @dfn{specs}.
1030
1031 @item @var{file}.adb
1032 Ada source code file containing a library unit body (a subprogram or
1033 package body).  Such files are also called @dfn{bodies}.
1034
1035 @c GCC also knows about some suffixes for languages not yet included:
1036 @c Pascal:
1037 @c @var{file}.p
1038 @c @var{file}.pas
1039 @c Ratfor:
1040 @c @var{file}.r
1041
1042 @item @var{file}.s
1043 Assembler code.
1044
1045 @item @var{file}.S
1046 @itemx @var{file}.sx
1047 Assembler code which must be preprocessed.
1048
1049 @item @var{other}
1050 An object file to be fed straight into linking.
1051 Any file name with no recognized suffix is treated this way.
1052 @end table
1053
1054 @opindex x
1055 You can specify the input language explicitly with the @option{-x} option:
1056
1057 @table @gcctabopt
1058 @item -x @var{language}
1059 Specify explicitly the @var{language} for the following input files
1060 (rather than letting the compiler choose a default based on the file
1061 name suffix).  This option applies to all following input files until
1062 the next @option{-x} option.  Possible values for @var{language} are:
1063 @smallexample
1064 c  c-header  c-cpp-output
1065 c++  c++-header  c++-cpp-output
1066 objective-c  objective-c-header  objective-c-cpp-output
1067 objective-c++ objective-c++-header objective-c++-cpp-output
1068 assembler  assembler-with-cpp
1069 ada
1070 f77  f77-cpp-input f95  f95-cpp-input
1071 java
1072 @end smallexample
1073
1074 @item -x none
1075 Turn off any specification of a language, so that subsequent files are
1076 handled according to their file name suffixes (as they are if @option{-x}
1077 has not been used at all).
1078
1079 @item -pass-exit-codes
1080 @opindex pass-exit-codes
1081 Normally the @command{gcc} program will exit with the code of 1 if any
1082 phase of the compiler returns a non-success return code.  If you specify
1083 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1084 numerically highest error produced by any phase that returned an error
1085 indication.  The C, C++, and Fortran frontends return 4, if an internal
1086 compiler error is encountered.
1087 @end table
1088
1089 If you only want some of the stages of compilation, you can use
1090 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1091 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1092 @command{gcc} is to stop.  Note that some combinations (for example,
1093 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1094
1095 @table @gcctabopt
1096 @item -c
1097 @opindex c
1098 Compile or assemble the source files, but do not link.  The linking
1099 stage simply is not done.  The ultimate output is in the form of an
1100 object file for each source file.
1101
1102 By default, the object file name for a source file is made by replacing
1103 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1104
1105 Unrecognized input files, not requiring compilation or assembly, are
1106 ignored.
1107
1108 @item -S
1109 @opindex S
1110 Stop after the stage of compilation proper; do not assemble.  The output
1111 is in the form of an assembler code file for each non-assembler input
1112 file specified.
1113
1114 By default, the assembler file name for a source file is made by
1115 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1116
1117 Input files that don't require compilation are ignored.
1118
1119 @item -E
1120 @opindex E
1121 Stop after the preprocessing stage; do not run the compiler proper.  The
1122 output is in the form of preprocessed source code, which is sent to the
1123 standard output.
1124
1125 Input files which don't require preprocessing are ignored.
1126
1127 @cindex output file option
1128 @item -o @var{file}
1129 @opindex o
1130 Place output in file @var{file}.  This applies regardless to whatever
1131 sort of output is being produced, whether it be an executable file,
1132 an object file, an assembler file or preprocessed C code.
1133
1134 If @option{-o} is not specified, the default is to put an executable
1135 file in @file{a.out}, the object file for
1136 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1137 assembler file in @file{@var{source}.s}, a precompiled header file in
1138 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1139 standard output.
1140
1141 @item -v
1142 @opindex v
1143 Print (on standard error output) the commands executed to run the stages
1144 of compilation.  Also print the version number of the compiler driver
1145 program and of the preprocessor and the compiler proper.
1146
1147 @item -###
1148 @opindex ###
1149 Like @option{-v} except the commands are not executed and all command
1150 arguments are quoted.  This is useful for shell scripts to capture the
1151 driver-generated command lines.
1152
1153 @item -pipe
1154 @opindex pipe
1155 Use pipes rather than temporary files for communication between the
1156 various stages of compilation.  This fails to work on some systems where
1157 the assembler is unable to read from a pipe; but the GNU assembler has
1158 no trouble.
1159
1160 @item -combine
1161 @opindex combine
1162 If you are compiling multiple source files, this option tells the driver
1163 to pass all the source files to the compiler at once (for those
1164 languages for which the compiler can handle this).  This will allow
1165 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1166 language for which this is supported is C@.  If you pass source files for
1167 multiple languages to the driver, using this option, the driver will invoke
1168 the compiler(s) that support IMA once each, passing each compiler all the
1169 source files appropriate for it.  For those languages that do not support
1170 IMA this option will be ignored, and the compiler will be invoked once for
1171 each source file in that language.  If you use this option in conjunction
1172 with @option{-save-temps}, the compiler will generate multiple
1173 pre-processed files
1174 (one for each source file), but only one (combined) @file{.o} or
1175 @file{.s} file.
1176
1177 @item --help
1178 @opindex help
1179 Print (on the standard output) a description of the command line options
1180 understood by @command{gcc}.  If the @option{-v} option is also specified
1181 then @option{--help} will also be passed on to the various processes
1182 invoked by @command{gcc}, so that they can display the command line options
1183 they accept.  If the @option{-Wextra} option has also been specified
1184 (prior to the @option{--help} option), then command line options which
1185 have no documentation associated with them will also be displayed.
1186
1187 @item --target-help
1188 @opindex target-help
1189 Print (on the standard output) a description of target-specific command
1190 line options for each tool.  For some targets extra target-specific
1191 information may also be printed.
1192
1193 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1194 Print (on the standard output) a description of the command line
1195 options understood by the compiler that fit into all specified classes
1196 and qualifiers.  These are the supported classes:
1197
1198 @table @asis
1199 @item @samp{optimizers}
1200 This will display all of the optimization options supported by the
1201 compiler.
1202
1203 @item @samp{warnings}
1204 This will display all of the options controlling warning messages
1205 produced by the compiler.
1206
1207 @item @samp{target}
1208 This will display target-specific options.  Unlike the
1209 @option{--target-help} option however, target-specific options of the
1210 linker and assembler will not be displayed.  This is because those
1211 tools do not currently support the extended @option{--help=} syntax.
1212
1213 @item @samp{params}
1214 This will display the values recognized by the @option{--param}
1215 option.
1216
1217 @item @var{language}
1218 This will display the options supported for @var{language}, where
1219 @var{language} is the name of one of the languages supported in this
1220 version of GCC.
1221
1222 @item @samp{common}
1223 This will display the options that are common to all languages.
1224 @end table
1225
1226 These are the supported qualifiers:
1227
1228 @table @asis
1229 @item @samp{undocumented}
1230 Display only those options which are undocumented.
1231
1232 @item @samp{joined}
1233 Display options which take an argument that appears after an equal
1234 sign in the same continuous piece of text, such as:
1235 @samp{--help=target}.
1236
1237 @item @samp{separate}
1238 Display options which take an argument that appears as a separate word
1239 following the original option, such as: @samp{-o output-file}.
1240 @end table
1241
1242 Thus for example to display all the undocumented target-specific
1243 switches supported by the compiler the following can be used:
1244
1245 @smallexample
1246 --help=target,undocumented
1247 @end smallexample
1248
1249 The sense of a qualifier can be inverted by prefixing it with the
1250 @samp{^} character, so for example to display all binary warning
1251 options (i.e., ones that are either on or off and that do not take an
1252 argument), which have a description the following can be used:
1253
1254 @smallexample
1255 --help=warnings,^joined,^undocumented
1256 @end smallexample
1257
1258 The argument to @option{--help=} should not consist solely of inverted
1259 qualifiers.
1260
1261 Combining several classes is possible, although this usually
1262 restricts the output by so much that there is nothing to display.  One
1263 case where it does work however is when one of the classes is
1264 @var{target}.  So for example to display all the target-specific
1265 optimization options the following can be used:
1266
1267 @smallexample
1268 --help=target,optimizers
1269 @end smallexample
1270
1271 The @option{--help=} option can be repeated on the command line.  Each
1272 successive use will display its requested class of options, skipping
1273 those that have already been displayed.
1274
1275 If the @option{-Q} option appears on the command line before the
1276 @option{--help=} option, then the descriptive text displayed by
1277 @option{--help=} is changed.  Instead of describing the displayed
1278 options, an indication is given as to whether the option is enabled,
1279 disabled or set to a specific value (assuming that the compiler
1280 knows this at the point where the @option{--help=} option is used).
1281
1282 Here is a truncated example from the ARM port of @command{gcc}:
1283
1284 @smallexample
1285   % gcc -Q -mabi=2 --help=target -c
1286   The following options are target specific:
1287   -mabi=                                2
1288   -mabort-on-noreturn                   [disabled]
1289   -mapcs                                [disabled]
1290 @end smallexample
1291
1292 The output is sensitive to the effects of previous command line
1293 options, so for example it is possible to find out which optimizations
1294 are enabled at @option{-O2} by using:
1295
1296 @smallexample
1297 -Q -O2 --help=optimizers
1298 @end smallexample
1299
1300 Alternatively you can discover which binary optimizations are enabled
1301 by @option{-O3} by using:
1302
1303 @smallexample
1304 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1305 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1306 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1307 @end smallexample
1308
1309 @item -no-canonical-prefixes
1310 @opindex no-canonical-prefixes
1311 Do not expand any symbolic links, resolve references to @samp{/../}
1312 or @samp{/./}, or make the path absolute when generating a relative
1313 prefix.
1314
1315 @item --version
1316 @opindex version
1317 Display the version number and copyrights of the invoked GCC@.
1318
1319 @item -wrapper
1320 @opindex wrapper
1321 Invoke all subcommands under a wrapper program. It takes a single
1322 comma separated list as an argument, which will be used to invoke
1323 the wrapper:
1324
1325 @smallexample
1326 gcc -c t.c -wrapper gdb,--args
1327 @end smallexample
1328
1329 This will invoke all subprograms of gcc under "gdb --args",
1330 thus cc1 invocation will be "gdb --args cc1 ...".
1331
1332 @item -fplugin=@var{name}.so
1333 Load the plugin code in file @var{name}.so, assumed to be a
1334 shared object to be dlopen'd by the compiler.  The base name of
1335 the shared object file is used to identify the plugin for the
1336 purposes of argument parsing (See
1337 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1338 Each plugin should define the callback functions specified in the
1339 Plugins API.
1340
1341 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1342 Define an argument called @var{key} with a value of @var{value}
1343 for the plugin called @var{name}.
1344
1345 @include @value{srcdir}/../libiberty/at-file.texi
1346 @end table
1347
1348 @node Invoking G++
1349 @section Compiling C++ Programs
1350
1351 @cindex suffixes for C++ source
1352 @cindex C++ source file suffixes
1353 C++ source files conventionally use one of the suffixes @samp{.C},
1354 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1355 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1356 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1357 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1358 files with these names and compiles them as C++ programs even if you
1359 call the compiler the same way as for compiling C programs (usually
1360 with the name @command{gcc}).
1361
1362 @findex g++
1363 @findex c++
1364 However, the use of @command{gcc} does not add the C++ library.
1365 @command{g++} is a program that calls GCC and treats @samp{.c},
1366 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1367 files unless @option{-x} is used, and automatically specifies linking
1368 against the C++ library.  This program is also useful when
1369 precompiling a C header file with a @samp{.h} extension for use in C++
1370 compilations.  On many systems, @command{g++} is also installed with
1371 the name @command{c++}.
1372
1373 @cindex invoking @command{g++}
1374 When you compile C++ programs, you may specify many of the same
1375 command-line options that you use for compiling programs in any
1376 language; or command-line options meaningful for C and related
1377 languages; or options that are meaningful only for C++ programs.
1378 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1379 explanations of options for languages related to C@.
1380 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1381 explanations of options that are meaningful only for C++ programs.
1382
1383 @node C Dialect Options
1384 @section Options Controlling C Dialect
1385 @cindex dialect options
1386 @cindex language dialect options
1387 @cindex options, dialect
1388
1389 The following options control the dialect of C (or languages derived
1390 from C, such as C++, Objective-C and Objective-C++) that the compiler
1391 accepts:
1392
1393 @table @gcctabopt
1394 @cindex ANSI support
1395 @cindex ISO support
1396 @item -ansi
1397 @opindex ansi
1398 In C mode, this is equivalent to @samp{-std=c89}. In C++ mode, it is
1399 equivalent to @samp{-std=c++98}.
1400
1401 This turns off certain features of GCC that are incompatible with ISO
1402 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1403 such as the @code{asm} and @code{typeof} keywords, and
1404 predefined macros such as @code{unix} and @code{vax} that identify the
1405 type of system you are using.  It also enables the undesirable and
1406 rarely used ISO trigraph feature.  For the C compiler,
1407 it disables recognition of C++ style @samp{//} comments as well as
1408 the @code{inline} keyword.
1409
1410 The alternate keywords @code{__asm__}, @code{__extension__},
1411 @code{__inline__} and @code{__typeof__} continue to work despite
1412 @option{-ansi}.  You would not want to use them in an ISO C program, of
1413 course, but it is useful to put them in header files that might be included
1414 in compilations done with @option{-ansi}.  Alternate predefined macros
1415 such as @code{__unix__} and @code{__vax__} are also available, with or
1416 without @option{-ansi}.
1417
1418 The @option{-ansi} option does not cause non-ISO programs to be
1419 rejected gratuitously.  For that, @option{-pedantic} is required in
1420 addition to @option{-ansi}.  @xref{Warning Options}.
1421
1422 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1423 option is used.  Some header files may notice this macro and refrain
1424 from declaring certain functions or defining certain macros that the
1425 ISO standard doesn't call for; this is to avoid interfering with any
1426 programs that might use these names for other things.
1427
1428 Functions that would normally be built in but do not have semantics
1429 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1430 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1431 built-in functions provided by GCC}, for details of the functions
1432 affected.
1433
1434 @item -std=
1435 @opindex std
1436 Determine the language standard. @xref{Standards,,Language Standards
1437 Supported by GCC}, for details of these standard versions.  This option
1438 is currently only supported when compiling C or C++.
1439
1440 The compiler can accept several base standards, such as @samp{c89} or
1441 @samp{c++98}, and GNU dialects of those standards, such as
1442 @samp{gnu89} or @samp{gnu++98}.  By specifying a base standard, the
1443 compiler will accept all programs following that standard and those
1444 using GNU extensions that do not contradict it.  For example,
1445 @samp{-std=c89} turns off certain features of GCC that are
1446 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1447 keywords, but not other GNU extensions that do not have a meaning in
1448 ISO C90, such as omitting the middle term of a @code{?:}
1449 expression. On the other hand, by specifying a GNU dialect of a
1450 standard, all features the compiler support are enabled, even when
1451 those features change the meaning of the base standard and some
1452 strict-conforming programs may be rejected.  The particular standard
1453 is used by @option{-pedantic} to identify which features are GNU
1454 extensions given that version of the standard. For example
1455 @samp{-std=gnu89 -pedantic} would warn about C++ style @samp{//}
1456 comments, while @samp{-std=gnu99 -pedantic} would not.
1457
1458 A value for this option must be provided; possible values are
1459
1460 @table @samp
1461 @item c89
1462 @itemx iso9899:1990
1463 Support all ISO C90 programs (certain GNU extensions that conflict
1464 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1465
1466 @item iso9899:199409
1467 ISO C90 as modified in amendment 1.
1468
1469 @item c99
1470 @itemx c9x
1471 @itemx iso9899:1999
1472 @itemx iso9899:199x
1473 ISO C99.  Note that this standard is not yet fully supported; see
1474 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1475 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1476
1477 @item gnu89
1478 GNU dialect of ISO C90 (including some C99 features). This
1479 is the default for C code.
1480
1481 @item gnu99
1482 @itemx gnu9x
1483 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1484 this will become the default.  The name @samp{gnu9x} is deprecated.
1485
1486 @item c++98
1487 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1488 C++ code.
1489
1490 @item gnu++98
1491 GNU dialect of @option{-std=c++98}.  This is the default for
1492 C++ code.
1493
1494 @item c++0x
1495 The working draft of the upcoming ISO C++0x standard. This option
1496 enables experimental features that are likely to be included in
1497 C++0x. The working draft is constantly changing, and any feature that is
1498 enabled by this flag may be removed from future versions of GCC if it is
1499 not part of the C++0x standard.
1500
1501 @item gnu++0x
1502 GNU dialect of @option{-std=c++0x}. This option enables
1503 experimental features that may be removed in future versions of GCC.
1504 @end table
1505
1506 @item -fgnu89-inline
1507 @opindex fgnu89-inline
1508 The option @option{-fgnu89-inline} tells GCC to use the traditional
1509 GNU semantics for @code{inline} functions when in C99 mode.
1510 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1511 is accepted and ignored by GCC versions 4.1.3 up to but not including
1512 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1513 C99 mode.  Using this option is roughly equivalent to adding the
1514 @code{gnu_inline} function attribute to all inline functions
1515 (@pxref{Function Attributes}).
1516
1517 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1518 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1519 specifies the default behavior).  This option was first supported in
1520 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1521
1522 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1523 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1524 in effect for @code{inline} functions.  @xref{Common Predefined
1525 Macros,,,cpp,The C Preprocessor}.
1526
1527 @item -aux-info @var{filename}
1528 @opindex aux-info
1529 Output to the given filename prototyped declarations for all functions
1530 declared and/or defined in a translation unit, including those in header
1531 files.  This option is silently ignored in any language other than C@.
1532
1533 Besides declarations, the file indicates, in comments, the origin of
1534 each declaration (source file and line), whether the declaration was
1535 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1536 @samp{O} for old, respectively, in the first character after the line
1537 number and the colon), and whether it came from a declaration or a
1538 definition (@samp{C} or @samp{F}, respectively, in the following
1539 character).  In the case of function definitions, a K&R-style list of
1540 arguments followed by their declarations is also provided, inside
1541 comments, after the declaration.
1542
1543 @item -fno-asm
1544 @opindex fno-asm
1545 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1546 keyword, so that code can use these words as identifiers.  You can use
1547 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1548 instead.  @option{-ansi} implies @option{-fno-asm}.
1549
1550 In C++, this switch only affects the @code{typeof} keyword, since
1551 @code{asm} and @code{inline} are standard keywords.  You may want to
1552 use the @option{-fno-gnu-keywords} flag instead, which has the same
1553 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1554 switch only affects the @code{asm} and @code{typeof} keywords, since
1555 @code{inline} is a standard keyword in ISO C99.
1556
1557 @item -fno-builtin
1558 @itemx -fno-builtin-@var{function}
1559 @opindex fno-builtin
1560 @cindex built-in functions
1561 Don't recognize built-in functions that do not begin with
1562 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1563 functions provided by GCC}, for details of the functions affected,
1564 including those which are not built-in functions when @option{-ansi} or
1565 @option{-std} options for strict ISO C conformance are used because they
1566 do not have an ISO standard meaning.
1567
1568 GCC normally generates special code to handle certain built-in functions
1569 more efficiently; for instance, calls to @code{alloca} may become single
1570 instructions that adjust the stack directly, and calls to @code{memcpy}
1571 may become inline copy loops.  The resulting code is often both smaller
1572 and faster, but since the function calls no longer appear as such, you
1573 cannot set a breakpoint on those calls, nor can you change the behavior
1574 of the functions by linking with a different library.  In addition,
1575 when a function is recognized as a built-in function, GCC may use
1576 information about that function to warn about problems with calls to
1577 that function, or to generate more efficient code, even if the
1578 resulting code still contains calls to that function.  For example,
1579 warnings are given with @option{-Wformat} for bad calls to
1580 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1581 known not to modify global memory.
1582
1583 With the @option{-fno-builtin-@var{function}} option
1584 only the built-in function @var{function} is
1585 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1586 function is named that is not built-in in this version of GCC, this
1587 option is ignored.  There is no corresponding
1588 @option{-fbuiltin-@var{function}} option; if you wish to enable
1589 built-in functions selectively when using @option{-fno-builtin} or
1590 @option{-ffreestanding}, you may define macros such as:
1591
1592 @smallexample
1593 #define abs(n)          __builtin_abs ((n))
1594 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1595 @end smallexample
1596
1597 @item -fhosted
1598 @opindex fhosted
1599 @cindex hosted environment
1600
1601 Assert that compilation takes place in a hosted environment.  This implies
1602 @option{-fbuiltin}.  A hosted environment is one in which the
1603 entire standard library is available, and in which @code{main} has a return
1604 type of @code{int}.  Examples are nearly everything except a kernel.
1605 This is equivalent to @option{-fno-freestanding}.
1606
1607 @item -ffreestanding
1608 @opindex ffreestanding
1609 @cindex hosted environment
1610
1611 Assert that compilation takes place in a freestanding environment.  This
1612 implies @option{-fno-builtin}.  A freestanding environment
1613 is one in which the standard library may not exist, and program startup may
1614 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1615 This is equivalent to @option{-fno-hosted}.
1616
1617 @xref{Standards,,Language Standards Supported by GCC}, for details of
1618 freestanding and hosted environments.
1619
1620 @item -fopenmp
1621 @opindex fopenmp
1622 @cindex openmp parallel
1623 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1624 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1625 compiler generates parallel code according to the OpenMP Application
1626 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1627 implies @option{-pthread}, and thus is only supported on targets that
1628 have support for @option{-pthread}.
1629
1630 @item -fms-extensions
1631 @opindex fms-extensions
1632 Accept some non-standard constructs used in Microsoft header files.
1633
1634 Some cases of unnamed fields in structures and unions are only
1635 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1636 fields within structs/unions}, for details.
1637
1638 @item -trigraphs
1639 @opindex trigraphs
1640 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1641 options for strict ISO C conformance) implies @option{-trigraphs}.
1642
1643 @item -no-integrated-cpp
1644 @opindex no-integrated-cpp
1645 Performs a compilation in two passes: preprocessing and compiling.  This
1646 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1647 @option{-B} option.  The user supplied compilation step can then add in
1648 an additional preprocessing step after normal preprocessing but before
1649 compiling.  The default is to use the integrated cpp (internal cpp)
1650
1651 The semantics of this option will change if "cc1", "cc1plus", and
1652 "cc1obj" are merged.
1653
1654 @cindex traditional C language
1655 @cindex C language, traditional
1656 @item -traditional
1657 @itemx -traditional-cpp
1658 @opindex traditional-cpp
1659 @opindex traditional
1660 Formerly, these options caused GCC to attempt to emulate a pre-standard
1661 C compiler.  They are now only supported with the @option{-E} switch.
1662 The preprocessor continues to support a pre-standard mode.  See the GNU
1663 CPP manual for details.
1664
1665 @item -fcond-mismatch
1666 @opindex fcond-mismatch
1667 Allow conditional expressions with mismatched types in the second and
1668 third arguments.  The value of such an expression is void.  This option
1669 is not supported for C++.
1670
1671 @item -flax-vector-conversions
1672 @opindex flax-vector-conversions
1673 Allow implicit conversions between vectors with differing numbers of
1674 elements and/or incompatible element types.  This option should not be
1675 used for new code.
1676
1677 @item -funsigned-char
1678 @opindex funsigned-char
1679 Let the type @code{char} be unsigned, like @code{unsigned char}.
1680
1681 Each kind of machine has a default for what @code{char} should
1682 be.  It is either like @code{unsigned char} by default or like
1683 @code{signed char} by default.
1684
1685 Ideally, a portable program should always use @code{signed char} or
1686 @code{unsigned char} when it depends on the signedness of an object.
1687 But many programs have been written to use plain @code{char} and
1688 expect it to be signed, or expect it to be unsigned, depending on the
1689 machines they were written for.  This option, and its inverse, let you
1690 make such a program work with the opposite default.
1691
1692 The type @code{char} is always a distinct type from each of
1693 @code{signed char} or @code{unsigned char}, even though its behavior
1694 is always just like one of those two.
1695
1696 @item -fsigned-char
1697 @opindex fsigned-char
1698 Let the type @code{char} be signed, like @code{signed char}.
1699
1700 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1701 the negative form of @option{-funsigned-char}.  Likewise, the option
1702 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1703
1704 @item -fsigned-bitfields
1705 @itemx -funsigned-bitfields
1706 @itemx -fno-signed-bitfields
1707 @itemx -fno-unsigned-bitfields
1708 @opindex fsigned-bitfields
1709 @opindex funsigned-bitfields
1710 @opindex fno-signed-bitfields
1711 @opindex fno-unsigned-bitfields
1712 These options control whether a bit-field is signed or unsigned, when the
1713 declaration does not use either @code{signed} or @code{unsigned}.  By
1714 default, such a bit-field is signed, because this is consistent: the
1715 basic integer types such as @code{int} are signed types.
1716 @end table
1717
1718 @node C++ Dialect Options
1719 @section Options Controlling C++ Dialect
1720
1721 @cindex compiler options, C++
1722 @cindex C++ options, command line
1723 @cindex options, C++
1724 This section describes the command-line options that are only meaningful
1725 for C++ programs; but you can also use most of the GNU compiler options
1726 regardless of what language your program is in.  For example, you
1727 might compile a file @code{firstClass.C} like this:
1728
1729 @smallexample
1730 g++ -g -frepo -O -c firstClass.C
1731 @end smallexample
1732
1733 @noindent
1734 In this example, only @option{-frepo} is an option meant
1735 only for C++ programs; you can use the other options with any
1736 language supported by GCC@.
1737
1738 Here is a list of options that are @emph{only} for compiling C++ programs:
1739
1740 @table @gcctabopt
1741
1742 @item -fabi-version=@var{n}
1743 @opindex fabi-version
1744 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1745 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1746 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1747 the version that conforms most closely to the C++ ABI specification.
1748 Therefore, the ABI obtained using version 0 will change as ABI bugs
1749 are fixed.
1750
1751 The default is version 2.
1752
1753 @item -fno-access-control
1754 @opindex fno-access-control
1755 Turn off all access checking.  This switch is mainly useful for working
1756 around bugs in the access control code.
1757
1758 @item -fcheck-new
1759 @opindex fcheck-new
1760 Check that the pointer returned by @code{operator new} is non-null
1761 before attempting to modify the storage allocated.  This check is
1762 normally unnecessary because the C++ standard specifies that
1763 @code{operator new} will only return @code{0} if it is declared
1764 @samp{throw()}, in which case the compiler will always check the
1765 return value even without this option.  In all other cases, when
1766 @code{operator new} has a non-empty exception specification, memory
1767 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1768 @samp{new (nothrow)}.
1769
1770 @item -fconserve-space
1771 @opindex fconserve-space
1772 Put uninitialized or runtime-initialized global variables into the
1773 common segment, as C does.  This saves space in the executable at the
1774 cost of not diagnosing duplicate definitions.  If you compile with this
1775 flag and your program mysteriously crashes after @code{main()} has
1776 completed, you may have an object that is being destroyed twice because
1777 two definitions were merged.
1778
1779 This option is no longer useful on most targets, now that support has
1780 been added for putting variables into BSS without making them common.
1781
1782 @item -ffriend-injection
1783 @opindex ffriend-injection
1784 Inject friend functions into the enclosing namespace, so that they are
1785 visible outside the scope of the class in which they are declared.
1786 Friend functions were documented to work this way in the old Annotated
1787 C++ Reference Manual, and versions of G++ before 4.1 always worked
1788 that way.  However, in ISO C++ a friend function which is not declared
1789 in an enclosing scope can only be found using argument dependent
1790 lookup.  This option causes friends to be injected as they were in
1791 earlier releases.
1792
1793 This option is for compatibility, and may be removed in a future
1794 release of G++.
1795
1796 @item -fno-elide-constructors
1797 @opindex fno-elide-constructors
1798 The C++ standard allows an implementation to omit creating a temporary
1799 which is only used to initialize another object of the same type.
1800 Specifying this option disables that optimization, and forces G++ to
1801 call the copy constructor in all cases.
1802
1803 @item -fno-enforce-eh-specs
1804 @opindex fno-enforce-eh-specs
1805 Don't generate code to check for violation of exception specifications
1806 at runtime.  This option violates the C++ standard, but may be useful
1807 for reducing code size in production builds, much like defining
1808 @samp{NDEBUG}.  This does not give user code permission to throw
1809 exceptions in violation of the exception specifications; the compiler
1810 will still optimize based on the specifications, so throwing an
1811 unexpected exception will result in undefined behavior.
1812
1813 @item -ffor-scope
1814 @itemx -fno-for-scope
1815 @opindex ffor-scope
1816 @opindex fno-for-scope
1817 If @option{-ffor-scope} is specified, the scope of variables declared in
1818 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1819 as specified by the C++ standard.
1820 If @option{-fno-for-scope} is specified, the scope of variables declared in
1821 a @i{for-init-statement} extends to the end of the enclosing scope,
1822 as was the case in old versions of G++, and other (traditional)
1823 implementations of C++.
1824
1825 The default if neither flag is given to follow the standard,
1826 but to allow and give a warning for old-style code that would
1827 otherwise be invalid, or have different behavior.
1828
1829 @item -fno-gnu-keywords
1830 @opindex fno-gnu-keywords
1831 Do not recognize @code{typeof} as a keyword, so that code can use this
1832 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1833 @option{-ansi} implies @option{-fno-gnu-keywords}.
1834
1835 @item -fno-implicit-templates
1836 @opindex fno-implicit-templates
1837 Never emit code for non-inline templates which are instantiated
1838 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1839 @xref{Template Instantiation}, for more information.
1840
1841 @item -fno-implicit-inline-templates
1842 @opindex fno-implicit-inline-templates
1843 Don't emit code for implicit instantiations of inline templates, either.
1844 The default is to handle inlines differently so that compiles with and
1845 without optimization will need the same set of explicit instantiations.
1846
1847 @item -fno-implement-inlines
1848 @opindex fno-implement-inlines
1849 To save space, do not emit out-of-line copies of inline functions
1850 controlled by @samp{#pragma implementation}.  This will cause linker
1851 errors if these functions are not inlined everywhere they are called.
1852
1853 @item -fms-extensions
1854 @opindex fms-extensions
1855 Disable pedantic warnings about constructs used in MFC, such as implicit
1856 int and getting a pointer to member function via non-standard syntax.
1857
1858 @item -fno-nonansi-builtins
1859 @opindex fno-nonansi-builtins
1860 Disable built-in declarations of functions that are not mandated by
1861 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1862 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1863
1864 @item -fno-operator-names
1865 @opindex fno-operator-names
1866 Do not treat the operator name keywords @code{and}, @code{bitand},
1867 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1868 synonyms as keywords.
1869
1870 @item -fno-optional-diags
1871 @opindex fno-optional-diags
1872 Disable diagnostics that the standard says a compiler does not need to
1873 issue.  Currently, the only such diagnostic issued by G++ is the one for
1874 a name having multiple meanings within a class.
1875
1876 @item -fpermissive
1877 @opindex fpermissive
1878 Downgrade some diagnostics about nonconformant code from errors to
1879 warnings.  Thus, using @option{-fpermissive} will allow some
1880 nonconforming code to compile.
1881
1882 @item -fno-pretty-templates
1883 @opindex fno-pretty-templates
1884 When an error message refers to a specialization of a function
1885 template, the compiler will normally print the signature of the
1886 template followed by the template arguments and any typedefs or
1887 typenames in the signature (e.g. @code{void f(T) [with T = int]}
1888 rather than @code{void f(int)}) so that it's clear which template is
1889 involved.  When an error message refers to a specialization of a class
1890 template, the compiler will omit any template arguments which match
1891 the default template arguments for that template.  If either of these
1892 behaviors make it harder to understand the error message rather than
1893 easier, using @option{-fno-pretty-templates} will disable them.
1894
1895 @item -frepo
1896 @opindex frepo
1897 Enable automatic template instantiation at link time.  This option also
1898 implies @option{-fno-implicit-templates}.  @xref{Template
1899 Instantiation}, for more information.
1900
1901 @item -fno-rtti
1902 @opindex fno-rtti
1903 Disable generation of information about every class with virtual
1904 functions for use by the C++ runtime type identification features
1905 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1906 of the language, you can save some space by using this flag.  Note that
1907 exception handling uses the same information, but it will generate it as
1908 needed. The @samp{dynamic_cast} operator can still be used for casts that
1909 do not require runtime type information, i.e.@: casts to @code{void *} or to
1910 unambiguous base classes.
1911
1912 @item -fstats
1913 @opindex fstats
1914 Emit statistics about front-end processing at the end of the compilation.
1915 This information is generally only useful to the G++ development team.
1916
1917 @item -ftemplate-depth-@var{n}
1918 @opindex ftemplate-depth
1919 Set the maximum instantiation depth for template classes to @var{n}.
1920 A limit on the template instantiation depth is needed to detect
1921 endless recursions during template class instantiation.  ANSI/ISO C++
1922 conforming programs must not rely on a maximum depth greater than 17.
1923
1924 @item -fno-threadsafe-statics
1925 @opindex fno-threadsafe-statics
1926 Do not emit the extra code to use the routines specified in the C++
1927 ABI for thread-safe initialization of local statics.  You can use this
1928 option to reduce code size slightly in code that doesn't need to be
1929 thread-safe.
1930
1931 @item -fuse-cxa-atexit
1932 @opindex fuse-cxa-atexit
1933 Register destructors for objects with static storage duration with the
1934 @code{__cxa_atexit} function rather than the @code{atexit} function.
1935 This option is required for fully standards-compliant handling of static
1936 destructors, but will only work if your C library supports
1937 @code{__cxa_atexit}.
1938
1939 @item -fno-use-cxa-get-exception-ptr
1940 @opindex fno-use-cxa-get-exception-ptr
1941 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1942 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1943 if the runtime routine is not available.
1944
1945 @item -fvisibility-inlines-hidden
1946 @opindex fvisibility-inlines-hidden
1947 This switch declares that the user does not attempt to compare
1948 pointers to inline methods where the addresses of the two functions
1949 were taken in different shared objects.
1950
1951 The effect of this is that GCC may, effectively, mark inline methods with
1952 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1953 appear in the export table of a DSO and do not require a PLT indirection
1954 when used within the DSO@.  Enabling this option can have a dramatic effect
1955 on load and link times of a DSO as it massively reduces the size of the
1956 dynamic export table when the library makes heavy use of templates.
1957
1958 The behavior of this switch is not quite the same as marking the
1959 methods as hidden directly, because it does not affect static variables
1960 local to the function or cause the compiler to deduce that
1961 the function is defined in only one shared object.
1962
1963 You may mark a method as having a visibility explicitly to negate the
1964 effect of the switch for that method.  For example, if you do want to
1965 compare pointers to a particular inline method, you might mark it as
1966 having default visibility.  Marking the enclosing class with explicit
1967 visibility will have no effect.
1968
1969 Explicitly instantiated inline methods are unaffected by this option
1970 as their linkage might otherwise cross a shared library boundary.
1971 @xref{Template Instantiation}.
1972
1973 @item -fvisibility-ms-compat
1974 @opindex fvisibility-ms-compat
1975 This flag attempts to use visibility settings to make GCC's C++
1976 linkage model compatible with that of Microsoft Visual Studio.
1977
1978 The flag makes these changes to GCC's linkage model:
1979
1980 @enumerate
1981 @item
1982 It sets the default visibility to @code{hidden}, like
1983 @option{-fvisibility=hidden}.
1984
1985 @item
1986 Types, but not their members, are not hidden by default.
1987
1988 @item
1989 The One Definition Rule is relaxed for types without explicit
1990 visibility specifications which are defined in more than one different
1991 shared object: those declarations are permitted if they would have
1992 been permitted when this option was not used.
1993 @end enumerate
1994
1995 In new code it is better to use @option{-fvisibility=hidden} and
1996 export those classes which are intended to be externally visible.
1997 Unfortunately it is possible for code to rely, perhaps accidentally,
1998 on the Visual Studio behavior.
1999
2000 Among the consequences of these changes are that static data members
2001 of the same type with the same name but defined in different shared
2002 objects will be different, so changing one will not change the other;
2003 and that pointers to function members defined in different shared
2004 objects may not compare equal.  When this flag is given, it is a
2005 violation of the ODR to define types with the same name differently.
2006
2007 @item -fno-weak
2008 @opindex fno-weak
2009 Do not use weak symbol support, even if it is provided by the linker.
2010 By default, G++ will use weak symbols if they are available.  This
2011 option exists only for testing, and should not be used by end-users;
2012 it will result in inferior code and has no benefits.  This option may
2013 be removed in a future release of G++.
2014
2015 @item -nostdinc++
2016 @opindex nostdinc++
2017 Do not search for header files in the standard directories specific to
2018 C++, but do still search the other standard directories.  (This option
2019 is used when building the C++ library.)
2020 @end table
2021
2022 In addition, these optimization, warning, and code generation options
2023 have meanings only for C++ programs:
2024
2025 @table @gcctabopt
2026 @item -fno-default-inline
2027 @opindex fno-default-inline
2028 Do not assume @samp{inline} for functions defined inside a class scope.
2029 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2030 functions will have linkage like inline functions; they just won't be
2031 inlined by default.
2032
2033 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2034 @opindex Wabi
2035 @opindex Wno-abi
2036 Warn when G++ generates code that is probably not compatible with the
2037 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2038 all such cases, there are probably some cases that are not warned about,
2039 even though G++ is generating incompatible code.  There may also be
2040 cases where warnings are emitted even though the code that is generated
2041 will be compatible.
2042
2043 You should rewrite your code to avoid these warnings if you are
2044 concerned about the fact that code generated by G++ may not be binary
2045 compatible with code generated by other compilers.
2046
2047 The known incompatibilities at this point include:
2048
2049 @itemize @bullet
2050
2051 @item
2052 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2053 pack data into the same byte as a base class.  For example:
2054
2055 @smallexample
2056 struct A @{ virtual void f(); int f1 : 1; @};
2057 struct B : public A @{ int f2 : 1; @};
2058 @end smallexample
2059
2060 @noindent
2061 In this case, G++ will place @code{B::f2} into the same byte
2062 as@code{A::f1}; other compilers will not.  You can avoid this problem
2063 by explicitly padding @code{A} so that its size is a multiple of the
2064 byte size on your platform; that will cause G++ and other compilers to
2065 layout @code{B} identically.
2066
2067 @item
2068 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2069 tail padding when laying out virtual bases.  For example:
2070
2071 @smallexample
2072 struct A @{ virtual void f(); char c1; @};
2073 struct B @{ B(); char c2; @};
2074 struct C : public A, public virtual B @{@};
2075 @end smallexample
2076
2077 @noindent
2078 In this case, G++ will not place @code{B} into the tail-padding for
2079 @code{A}; other compilers will.  You can avoid this problem by
2080 explicitly padding @code{A} so that its size is a multiple of its
2081 alignment (ignoring virtual base classes); that will cause G++ and other
2082 compilers to layout @code{C} identically.
2083
2084 @item
2085 Incorrect handling of bit-fields with declared widths greater than that
2086 of their underlying types, when the bit-fields appear in a union.  For
2087 example:
2088
2089 @smallexample
2090 union U @{ int i : 4096; @};
2091 @end smallexample
2092
2093 @noindent
2094 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2095 union too small by the number of bits in an @code{int}.
2096
2097 @item
2098 Empty classes can be placed at incorrect offsets.  For example:
2099
2100 @smallexample
2101 struct A @{@};
2102
2103 struct B @{
2104   A a;
2105   virtual void f ();
2106 @};
2107
2108 struct C : public B, public A @{@};
2109 @end smallexample
2110
2111 @noindent
2112 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2113 it should be placed at offset zero.  G++ mistakenly believes that the
2114 @code{A} data member of @code{B} is already at offset zero.
2115
2116 @item
2117 Names of template functions whose types involve @code{typename} or
2118 template template parameters can be mangled incorrectly.
2119
2120 @smallexample
2121 template <typename Q>
2122 void f(typename Q::X) @{@}
2123
2124 template <template <typename> class Q>
2125 void f(typename Q<int>::X) @{@}
2126 @end smallexample
2127
2128 @noindent
2129 Instantiations of these templates may be mangled incorrectly.
2130
2131 @end itemize
2132
2133 It also warns psABI related changes.  The known psABI changes at this
2134 point include:
2135
2136 @itemize @bullet
2137
2138 @item
2139 For SYSV/x86-64, when passing union with long double, it is changed to
2140 pass in memory as specified in psABI.  For example:
2141
2142 @smallexample
2143 union U @{
2144   long double ld;
2145   int i;
2146 @};
2147 @end smallexample
2148
2149 @noindent
2150 @code{union U} will always be passed in memory.
2151
2152 @end itemize
2153
2154 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2155 @opindex Wctor-dtor-privacy
2156 @opindex Wno-ctor-dtor-privacy
2157 Warn when a class seems unusable because all the constructors or
2158 destructors in that class are private, and it has neither friends nor
2159 public static member functions.
2160
2161 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2162 @opindex Wnon-virtual-dtor
2163 @opindex Wno-non-virtual-dtor
2164 Warn when a class has virtual functions and accessible non-virtual
2165 destructor, in which case it would be possible but unsafe to delete
2166 an instance of a derived class through a pointer to the base class.
2167 This warning is also enabled if -Weffc++ is specified.
2168
2169 @item -Wreorder @r{(C++ and Objective-C++ only)}
2170 @opindex Wreorder
2171 @opindex Wno-reorder
2172 @cindex reordering, warning
2173 @cindex warning for reordering of member initializers
2174 Warn when the order of member initializers given in the code does not
2175 match the order in which they must be executed.  For instance:
2176
2177 @smallexample
2178 struct A @{
2179   int i;
2180   int j;
2181   A(): j (0), i (1) @{ @}
2182 @};
2183 @end smallexample
2184
2185 The compiler will rearrange the member initializers for @samp{i}
2186 and @samp{j} to match the declaration order of the members, emitting
2187 a warning to that effect.  This warning is enabled by @option{-Wall}.
2188 @end table
2189
2190 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2191
2192 @table @gcctabopt
2193 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2194 @opindex Weffc++
2195 @opindex Wno-effc++
2196 Warn about violations of the following style guidelines from Scott Meyers'
2197 @cite{Effective C++} book:
2198
2199 @itemize @bullet
2200 @item
2201 Item 11:  Define a copy constructor and an assignment operator for classes
2202 with dynamically allocated memory.
2203
2204 @item
2205 Item 12:  Prefer initialization to assignment in constructors.
2206
2207 @item
2208 Item 14:  Make destructors virtual in base classes.
2209
2210 @item
2211 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2212
2213 @item
2214 Item 23:  Don't try to return a reference when you must return an object.
2215
2216 @end itemize
2217
2218 Also warn about violations of the following style guidelines from
2219 Scott Meyers' @cite{More Effective C++} book:
2220
2221 @itemize @bullet
2222 @item
2223 Item 6:  Distinguish between prefix and postfix forms of increment and
2224 decrement operators.
2225
2226 @item
2227 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2228
2229 @end itemize
2230
2231 When selecting this option, be aware that the standard library
2232 headers do not obey all of these guidelines; use @samp{grep -v}
2233 to filter out those warnings.
2234
2235 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2236 @opindex Wstrict-null-sentinel
2237 @opindex Wno-strict-null-sentinel
2238 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2239 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2240 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2241 it is guaranteed to be of the same size as a pointer.  But this use is
2242 not portable across different compilers.
2243
2244 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2245 @opindex Wno-non-template-friend
2246 @opindex Wnon-template-friend
2247 Disable warnings when non-templatized friend functions are declared
2248 within a template.  Since the advent of explicit template specification
2249 support in G++, if the name of the friend is an unqualified-id (i.e.,
2250 @samp{friend foo(int)}), the C++ language specification demands that the
2251 friend declare or define an ordinary, nontemplate function.  (Section
2252 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2253 could be interpreted as a particular specialization of a templatized
2254 function.  Because this non-conforming behavior is no longer the default
2255 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2256 check existing code for potential trouble spots and is on by default.
2257 This new compiler behavior can be turned off with
2258 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2259 but disables the helpful warning.
2260
2261 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2262 @opindex Wold-style-cast
2263 @opindex Wno-old-style-cast
2264 Warn if an old-style (C-style) cast to a non-void type is used within
2265 a C++ program.  The new-style casts (@samp{dynamic_cast},
2266 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2267 less vulnerable to unintended effects and much easier to search for.
2268
2269 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2270 @opindex Woverloaded-virtual
2271 @opindex Wno-overloaded-virtual
2272 @cindex overloaded virtual fn, warning
2273 @cindex warning for overloaded virtual fn
2274 Warn when a function declaration hides virtual functions from a
2275 base class.  For example, in:
2276
2277 @smallexample
2278 struct A @{
2279   virtual void f();
2280 @};
2281
2282 struct B: public A @{
2283   void f(int);
2284 @};
2285 @end smallexample
2286
2287 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2288 like:
2289
2290 @smallexample
2291 B* b;
2292 b->f();
2293 @end smallexample
2294
2295 will fail to compile.
2296
2297 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2298 @opindex Wno-pmf-conversions
2299 @opindex Wpmf-conversions
2300 Disable the diagnostic for converting a bound pointer to member function
2301 to a plain pointer.
2302
2303 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2304 @opindex Wsign-promo
2305 @opindex Wno-sign-promo
2306 Warn when overload resolution chooses a promotion from unsigned or
2307 enumerated type to a signed type, over a conversion to an unsigned type of
2308 the same size.  Previous versions of G++ would try to preserve
2309 unsignedness, but the standard mandates the current behavior.
2310
2311 @smallexample
2312 struct A @{
2313   operator int ();
2314   A& operator = (int);
2315 @};
2316
2317 main ()
2318 @{
2319   A a,b;
2320   a = b;
2321 @}
2322 @end smallexample
2323
2324 In this example, G++ will synthesize a default @samp{A& operator =
2325 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2326 @end table
2327
2328 @node Objective-C and Objective-C++ Dialect Options
2329 @section Options Controlling Objective-C and Objective-C++ Dialects
2330
2331 @cindex compiler options, Objective-C and Objective-C++
2332 @cindex Objective-C and Objective-C++ options, command line
2333 @cindex options, Objective-C and Objective-C++
2334 (NOTE: This manual does not describe the Objective-C and Objective-C++
2335 languages themselves.  See @xref{Standards,,Language Standards
2336 Supported by GCC}, for references.)
2337
2338 This section describes the command-line options that are only meaningful
2339 for Objective-C and Objective-C++ programs, but you can also use most of
2340 the language-independent GNU compiler options.
2341 For example, you might compile a file @code{some_class.m} like this:
2342
2343 @smallexample
2344 gcc -g -fgnu-runtime -O -c some_class.m
2345 @end smallexample
2346
2347 @noindent
2348 In this example, @option{-fgnu-runtime} is an option meant only for
2349 Objective-C and Objective-C++ programs; you can use the other options with
2350 any language supported by GCC@.
2351
2352 Note that since Objective-C is an extension of the C language, Objective-C
2353 compilations may also use options specific to the C front-end (e.g.,
2354 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2355 C++-specific options (e.g., @option{-Wabi}).
2356
2357 Here is a list of options that are @emph{only} for compiling Objective-C
2358 and Objective-C++ programs:
2359
2360 @table @gcctabopt
2361 @item -fconstant-string-class=@var{class-name}
2362 @opindex fconstant-string-class
2363 Use @var{class-name} as the name of the class to instantiate for each
2364 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2365 class name is @code{NXConstantString} if the GNU runtime is being used, and
2366 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2367 @option{-fconstant-cfstrings} option, if also present, will override the
2368 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2369 to be laid out as constant CoreFoundation strings.
2370
2371 @item -fgnu-runtime
2372 @opindex fgnu-runtime
2373 Generate object code compatible with the standard GNU Objective-C
2374 runtime.  This is the default for most types of systems.
2375
2376 @item -fnext-runtime
2377 @opindex fnext-runtime
2378 Generate output compatible with the NeXT runtime.  This is the default
2379 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2380 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2381 used.
2382
2383 @item -fno-nil-receivers
2384 @opindex fno-nil-receivers
2385 Assume that all Objective-C message dispatches (e.g.,
2386 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2387 is not @code{nil}.  This allows for more efficient entry points in the runtime
2388 to be used.  Currently, this option is only available in conjunction with
2389 the NeXT runtime on Mac OS X 10.3 and later.
2390
2391 @item -fobjc-call-cxx-cdtors
2392 @opindex fobjc-call-cxx-cdtors
2393 For each Objective-C class, check if any of its instance variables is a
2394 C++ object with a non-trivial default constructor.  If so, synthesize a
2395 special @code{- (id) .cxx_construct} instance method that will run
2396 non-trivial default constructors on any such instance variables, in order,
2397 and then return @code{self}.  Similarly, check if any instance variable
2398 is a C++ object with a non-trivial destructor, and if so, synthesize a
2399 special @code{- (void) .cxx_destruct} method that will run
2400 all such default destructors, in reverse order.
2401
2402 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2403 thusly generated will only operate on instance variables declared in the
2404 current Objective-C class, and not those inherited from superclasses.  It
2405 is the responsibility of the Objective-C runtime to invoke all such methods
2406 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2407 will be invoked by the runtime immediately after a new object
2408 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2409 be invoked immediately before the runtime deallocates an object instance.
2410
2411 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2412 support for invoking the @code{- (id) .cxx_construct} and
2413 @code{- (void) .cxx_destruct} methods.
2414
2415 @item -fobjc-direct-dispatch
2416 @opindex fobjc-direct-dispatch
2417 Allow fast jumps to the message dispatcher.  On Darwin this is
2418 accomplished via the comm page.
2419
2420 @item -fobjc-exceptions
2421 @opindex fobjc-exceptions
2422 Enable syntactic support for structured exception handling in Objective-C,
2423 similar to what is offered by C++ and Java.  This option is
2424 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2425 earlier.
2426
2427 @smallexample
2428   @@try @{
2429     @dots{}
2430        @@throw expr;
2431     @dots{}
2432   @}
2433   @@catch (AnObjCClass *exc) @{
2434     @dots{}
2435       @@throw expr;
2436     @dots{}
2437       @@throw;
2438     @dots{}
2439   @}
2440   @@catch (AnotherClass *exc) @{
2441     @dots{}
2442   @}
2443   @@catch (id allOthers) @{
2444     @dots{}
2445   @}
2446   @@finally @{
2447     @dots{}
2448       @@throw expr;
2449     @dots{}
2450   @}
2451 @end smallexample
2452
2453 The @code{@@throw} statement may appear anywhere in an Objective-C or
2454 Objective-C++ program; when used inside of a @code{@@catch} block, the
2455 @code{@@throw} may appear without an argument (as shown above), in which case
2456 the object caught by the @code{@@catch} will be rethrown.
2457
2458 Note that only (pointers to) Objective-C objects may be thrown and
2459 caught using this scheme.  When an object is thrown, it will be caught
2460 by the nearest @code{@@catch} clause capable of handling objects of that type,
2461 analogously to how @code{catch} blocks work in C++ and Java.  A
2462 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2463 any and all Objective-C exceptions not caught by previous @code{@@catch}
2464 clauses (if any).
2465
2466 The @code{@@finally} clause, if present, will be executed upon exit from the
2467 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2468 regardless of whether any exceptions are thrown, caught or rethrown
2469 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2470 of the @code{finally} clause in Java.
2471
2472 There are several caveats to using the new exception mechanism:
2473
2474 @itemize @bullet
2475 @item
2476 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2477 idioms provided by the @code{NSException} class, the new
2478 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2479 systems, due to additional functionality needed in the (NeXT) Objective-C
2480 runtime.
2481
2482 @item
2483 As mentioned above, the new exceptions do not support handling
2484 types other than Objective-C objects.   Furthermore, when used from
2485 Objective-C++, the Objective-C exception model does not interoperate with C++
2486 exceptions at this time.  This means you cannot @code{@@throw} an exception
2487 from Objective-C and @code{catch} it in C++, or vice versa
2488 (i.e., @code{throw @dots{} @@catch}).
2489 @end itemize
2490
2491 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2492 blocks for thread-safe execution:
2493
2494 @smallexample
2495   @@synchronized (ObjCClass *guard) @{
2496     @dots{}
2497   @}
2498 @end smallexample
2499
2500 Upon entering the @code{@@synchronized} block, a thread of execution shall
2501 first check whether a lock has been placed on the corresponding @code{guard}
2502 object by another thread.  If it has, the current thread shall wait until
2503 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2504 the current thread will place its own lock on it, execute the code contained in
2505 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2506 making @code{guard} available to other threads).
2507
2508 Unlike Java, Objective-C does not allow for entire methods to be marked
2509 @code{@@synchronized}.  Note that throwing exceptions out of
2510 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2511 to be unlocked properly.
2512
2513 @item -fobjc-gc
2514 @opindex fobjc-gc
2515 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2516
2517 @item -freplace-objc-classes
2518 @opindex freplace-objc-classes
2519 Emit a special marker instructing @command{ld(1)} not to statically link in
2520 the resulting object file, and allow @command{dyld(1)} to load it in at
2521 run time instead.  This is used in conjunction with the Fix-and-Continue
2522 debugging mode, where the object file in question may be recompiled and
2523 dynamically reloaded in the course of program execution, without the need
2524 to restart the program itself.  Currently, Fix-and-Continue functionality
2525 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2526 and later.
2527
2528 @item -fzero-link
2529 @opindex fzero-link
2530 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2531 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2532 compile time) with static class references that get initialized at load time,
2533 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2534 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2535 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2536 for individual class implementations to be modified during program execution.
2537
2538 @item -gen-decls
2539 @opindex gen-decls
2540 Dump interface declarations for all classes seen in the source file to a
2541 file named @file{@var{sourcename}.decl}.
2542
2543 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2544 @opindex Wassign-intercept
2545 @opindex Wno-assign-intercept
2546 Warn whenever an Objective-C assignment is being intercepted by the
2547 garbage collector.
2548
2549 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2550 @opindex Wno-protocol
2551 @opindex Wprotocol
2552 If a class is declared to implement a protocol, a warning is issued for
2553 every method in the protocol that is not implemented by the class.  The
2554 default behavior is to issue a warning for every method not explicitly
2555 implemented in the class, even if a method implementation is inherited
2556 from the superclass.  If you use the @option{-Wno-protocol} option, then
2557 methods inherited from the superclass are considered to be implemented,
2558 and no warning is issued for them.
2559
2560 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2561 @opindex Wselector
2562 @opindex Wno-selector
2563 Warn if multiple methods of different types for the same selector are
2564 found during compilation.  The check is performed on the list of methods
2565 in the final stage of compilation.  Additionally, a check is performed
2566 for each selector appearing in a @code{@@selector(@dots{})}
2567 expression, and a corresponding method for that selector has been found
2568 during compilation.  Because these checks scan the method table only at
2569 the end of compilation, these warnings are not produced if the final
2570 stage of compilation is not reached, for example because an error is
2571 found during compilation, or because the @option{-fsyntax-only} option is
2572 being used.
2573
2574 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2575 @opindex Wstrict-selector-match
2576 @opindex Wno-strict-selector-match
2577 Warn if multiple methods with differing argument and/or return types are
2578 found for a given selector when attempting to send a message using this
2579 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2580 is off (which is the default behavior), the compiler will omit such warnings
2581 if any differences found are confined to types which share the same size
2582 and alignment.
2583
2584 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2585 @opindex Wundeclared-selector
2586 @opindex Wno-undeclared-selector
2587 Warn if a @code{@@selector(@dots{})} expression referring to an
2588 undeclared selector is found.  A selector is considered undeclared if no
2589 method with that name has been declared before the
2590 @code{@@selector(@dots{})} expression, either explicitly in an
2591 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2592 an @code{@@implementation} section.  This option always performs its
2593 checks as soon as a @code{@@selector(@dots{})} expression is found,
2594 while @option{-Wselector} only performs its checks in the final stage of
2595 compilation.  This also enforces the coding style convention
2596 that methods and selectors must be declared before being used.
2597
2598 @item -print-objc-runtime-info
2599 @opindex print-objc-runtime-info
2600 Generate C header describing the largest structure that is passed by
2601 value, if any.
2602
2603 @end table
2604
2605 @node Language Independent Options
2606 @section Options to Control Diagnostic Messages Formatting
2607 @cindex options to control diagnostics formatting
2608 @cindex diagnostic messages
2609 @cindex message formatting
2610
2611 Traditionally, diagnostic messages have been formatted irrespective of
2612 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2613 below can be used to control the diagnostic messages formatting
2614 algorithm, e.g.@: how many characters per line, how often source location
2615 information should be reported.  Right now, only the C++ front end can
2616 honor these options.  However it is expected, in the near future, that
2617 the remaining front ends would be able to digest them correctly.
2618
2619 @table @gcctabopt
2620 @item -fmessage-length=@var{n}
2621 @opindex fmessage-length
2622 Try to format error messages so that they fit on lines of about @var{n}
2623 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2624 the front ends supported by GCC@.  If @var{n} is zero, then no
2625 line-wrapping will be done; each error message will appear on a single
2626 line.
2627
2628 @opindex fdiagnostics-show-location
2629 @item -fdiagnostics-show-location=once
2630 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2631 reporter to emit @emph{once} source location information; that is, in
2632 case the message is too long to fit on a single physical line and has to
2633 be wrapped, the source location won't be emitted (as prefix) again,
2634 over and over, in subsequent continuation lines.  This is the default
2635 behavior.
2636
2637 @item -fdiagnostics-show-location=every-line
2638 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2639 messages reporter to emit the same source location information (as
2640 prefix) for physical lines that result from the process of breaking
2641 a message which is too long to fit on a single line.
2642
2643 @item -fdiagnostics-show-option
2644 @opindex fdiagnostics-show-option
2645 This option instructs the diagnostic machinery to add text to each
2646 diagnostic emitted, which indicates which command line option directly
2647 controls that diagnostic, when such an option is known to the
2648 diagnostic machinery.
2649
2650 @item -Wcoverage-mismatch
2651 @opindex Wcoverage-mismatch
2652 Warn if feedback profiles do not match when using the
2653 @option{-fprofile-use} option.
2654 If a source file was changed between @option{-fprofile-gen} and
2655 @option{-fprofile-use}, the files with the profile feedback can fail
2656 to match the source file and GCC can not use the profile feedback
2657 information.  By default, GCC emits an error message in this case.
2658 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2659 error.  GCC does not use appropriate feedback profiles, so using this
2660 option can result in poorly optimized code.  This option is useful
2661 only in the case of very minor changes such as bug fixes to an
2662 existing code-base.
2663
2664 @end table
2665
2666 @node Warning Options
2667 @section Options to Request or Suppress Warnings
2668 @cindex options to control warnings
2669 @cindex warning messages
2670 @cindex messages, warning
2671 @cindex suppressing warnings
2672
2673 Warnings are diagnostic messages that report constructions which
2674 are not inherently erroneous but which are risky or suggest there
2675 may have been an error.
2676
2677 The following language-independent options do not enable specific
2678 warnings but control the kinds of diagnostics produced by GCC.
2679
2680 @table @gcctabopt
2681 @cindex syntax checking
2682 @item -fsyntax-only
2683 @opindex fsyntax-only
2684 Check the code for syntax errors, but don't do anything beyond that.
2685
2686 @item -w
2687 @opindex w
2688 Inhibit all warning messages.
2689
2690 @item -Werror
2691 @opindex Werror
2692 @opindex Wno-error
2693 Make all warnings into errors.
2694
2695 @item -Werror=
2696 @opindex Werror=
2697 @opindex Wno-error=
2698 Make the specified warning into an error.  The specifier for a warning
2699 is appended, for example @option{-Werror=switch} turns the warnings
2700 controlled by @option{-Wswitch} into errors.  This switch takes a
2701 negative form, to be used to negate @option{-Werror} for specific
2702 warnings, for example @option{-Wno-error=switch} makes
2703 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2704 is in effect.  You can use the @option{-fdiagnostics-show-option}
2705 option to have each controllable warning amended with the option which
2706 controls it, to determine what to use with this option.
2707
2708 Note that specifying @option{-Werror=}@var{foo} automatically implies
2709 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2710 imply anything.
2711
2712 @item -Wfatal-errors
2713 @opindex Wfatal-errors
2714 @opindex Wno-fatal-errors
2715 This option causes the compiler to abort compilation on the first error
2716 occurred rather than trying to keep going and printing further error
2717 messages.
2718
2719 @end table
2720
2721 You can request many specific warnings with options beginning
2722 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2723 implicit declarations.  Each of these specific warning options also
2724 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2725 example, @option{-Wno-implicit}.  This manual lists only one of the
2726 two forms, whichever is not the default.  For further,
2727 language-specific options also refer to @ref{C++ Dialect Options} and
2728 @ref{Objective-C and Objective-C++ Dialect Options}.
2729
2730 @table @gcctabopt
2731 @item -pedantic
2732 @opindex pedantic
2733 Issue all the warnings demanded by strict ISO C and ISO C++;
2734 reject all programs that use forbidden extensions, and some other
2735 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2736 version of the ISO C standard specified by any @option{-std} option used.
2737
2738 Valid ISO C and ISO C++ programs should compile properly with or without
2739 this option (though a rare few will require @option{-ansi} or a
2740 @option{-std} option specifying the required version of ISO C)@.  However,
2741 without this option, certain GNU extensions and traditional C and C++
2742 features are supported as well.  With this option, they are rejected.
2743
2744 @option{-pedantic} does not cause warning messages for use of the
2745 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2746 warnings are also disabled in the expression that follows
2747 @code{__extension__}.  However, only system header files should use
2748 these escape routes; application programs should avoid them.
2749 @xref{Alternate Keywords}.
2750
2751 Some users try to use @option{-pedantic} to check programs for strict ISO
2752 C conformance.  They soon find that it does not do quite what they want:
2753 it finds some non-ISO practices, but not all---only those for which
2754 ISO C @emph{requires} a diagnostic, and some others for which
2755 diagnostics have been added.
2756
2757 A feature to report any failure to conform to ISO C might be useful in
2758 some instances, but would require considerable additional work and would
2759 be quite different from @option{-pedantic}.  We don't have plans to
2760 support such a feature in the near future.
2761
2762 Where the standard specified with @option{-std} represents a GNU
2763 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2764 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2765 extended dialect is based.  Warnings from @option{-pedantic} are given
2766 where they are required by the base standard.  (It would not make sense
2767 for such warnings to be given only for features not in the specified GNU
2768 C dialect, since by definition the GNU dialects of C include all
2769 features the compiler supports with the given option, and there would be
2770 nothing to warn about.)
2771
2772 @item -pedantic-errors
2773 @opindex pedantic-errors
2774 Like @option{-pedantic}, except that errors are produced rather than
2775 warnings.
2776
2777 @item -Wall
2778 @opindex Wall
2779 @opindex Wno-all
2780 This enables all the warnings about constructions that some users
2781 consider questionable, and that are easy to avoid (or modify to
2782 prevent the warning), even in conjunction with macros.  This also
2783 enables some language-specific warnings described in @ref{C++ Dialect
2784 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2785
2786 @option{-Wall} turns on the following warning flags:
2787
2788 @gccoptlist{-Waddress   @gol
2789 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2790 -Wc++0x-compat  @gol
2791 -Wchar-subscripts  @gol
2792 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
2793 -Wimplicit-int  @gol
2794 -Wimplicit-function-declaration  @gol
2795 -Wcomment  @gol
2796 -Wformat   @gol
2797 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2798 -Wmissing-braces  @gol
2799 -Wnonnull  @gol
2800 -Wparentheses  @gol
2801 -Wpointer-sign  @gol
2802 -Wreorder   @gol
2803 -Wreturn-type  @gol
2804 -Wsequence-point  @gol
2805 -Wsign-compare @r{(only in C++)}  @gol
2806 -Wstrict-aliasing  @gol
2807 -Wstrict-overflow=1  @gol
2808 -Wswitch  @gol
2809 -Wtrigraphs  @gol
2810 -Wuninitialized  @gol
2811 -Wunknown-pragmas  @gol
2812 -Wunused-function  @gol
2813 -Wunused-label     @gol
2814 -Wunused-value     @gol
2815 -Wunused-variable  @gol
2816 -Wvolatile-register-var @gol
2817 }
2818
2819 Note that some warning flags are not implied by @option{-Wall}.  Some of
2820 them warn about constructions that users generally do not consider
2821 questionable, but which occasionally you might wish to check for;
2822 others warn about constructions that are necessary or hard to avoid in
2823 some cases, and there is no simple way to modify the code to suppress
2824 the warning. Some of them are enabled by @option{-Wextra} but many of
2825 them must be enabled individually.
2826
2827 @item -Wextra
2828 @opindex W
2829 @opindex Wextra
2830 @opindex Wno-extra
2831 This enables some extra warning flags that are not enabled by
2832 @option{-Wall}. (This option used to be called @option{-W}.  The older
2833 name is still supported, but the newer name is more descriptive.)
2834
2835 @gccoptlist{-Wclobbered  @gol
2836 -Wempty-body  @gol
2837 -Wignored-qualifiers @gol
2838 -Wmissing-field-initializers  @gol
2839 -Wmissing-parameter-type @r{(C only)}  @gol
2840 -Wold-style-declaration @r{(C only)}  @gol
2841 -Woverride-init  @gol
2842 -Wsign-compare  @gol
2843 -Wtype-limits  @gol
2844 -Wuninitialized  @gol
2845 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
2846 }
2847
2848 The option @option{-Wextra} also prints warning messages for the
2849 following cases:
2850
2851 @itemize @bullet
2852
2853 @item
2854 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2855 @samp{>}, or @samp{>=}.
2856
2857 @item
2858 (C++ only) An enumerator and a non-enumerator both appear in a
2859 conditional expression.
2860
2861 @item
2862 (C++ only) Ambiguous virtual bases.
2863
2864 @item
2865 (C++ only) Subscripting an array which has been declared @samp{register}.
2866
2867 @item
2868 (C++ only) Taking the address of a variable which has been declared
2869 @samp{register}.
2870
2871 @item
2872 (C++ only) A base class is not initialized in a derived class' copy
2873 constructor.
2874
2875 @end itemize
2876
2877 @item -Wchar-subscripts
2878 @opindex Wchar-subscripts
2879 @opindex Wno-char-subscripts
2880 Warn if an array subscript has type @code{char}.  This is a common cause
2881 of error, as programmers often forget that this type is signed on some
2882 machines.
2883 This warning is enabled by @option{-Wall}.
2884
2885 @item -Wcomment
2886 @opindex Wcomment
2887 @opindex Wno-comment
2888 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2889 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2890 This warning is enabled by @option{-Wall}.
2891
2892 @item -Wformat
2893 @opindex Wformat
2894 @opindex Wno-format
2895 @opindex ffreestanding
2896 @opindex fno-builtin
2897 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2898 the arguments supplied have types appropriate to the format string
2899 specified, and that the conversions specified in the format string make
2900 sense.  This includes standard functions, and others specified by format
2901 attributes (@pxref{Function Attributes}), in the @code{printf},
2902 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2903 not in the C standard) families (or other target-specific families).
2904 Which functions are checked without format attributes having been
2905 specified depends on the standard version selected, and such checks of
2906 functions without the attribute specified are disabled by
2907 @option{-ffreestanding} or @option{-fno-builtin}.
2908
2909 The formats are checked against the format features supported by GNU
2910 libc version 2.2.  These include all ISO C90 and C99 features, as well
2911 as features from the Single Unix Specification and some BSD and GNU
2912 extensions.  Other library implementations may not support all these
2913 features; GCC does not support warning about features that go beyond a
2914 particular library's limitations.  However, if @option{-pedantic} is used
2915 with @option{-Wformat}, warnings will be given about format features not
2916 in the selected standard version (but not for @code{strfmon} formats,
2917 since those are not in any version of the C standard).  @xref{C Dialect
2918 Options,,Options Controlling C Dialect}.
2919
2920 Since @option{-Wformat} also checks for null format arguments for
2921 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2922
2923 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2924 aspects of format checking, the options @option{-Wformat-y2k},
2925 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2926 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2927 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2928
2929 @item -Wformat-y2k
2930 @opindex Wformat-y2k
2931 @opindex Wno-format-y2k
2932 If @option{-Wformat} is specified, also warn about @code{strftime}
2933 formats which may yield only a two-digit year.
2934
2935 @item -Wno-format-contains-nul
2936 @opindex Wno-format-contains-nul
2937 @opindex Wformat-contains-nul
2938 If @option{-Wformat} is specified, do not warn about format strings that
2939 contain NUL bytes.
2940
2941 @item -Wno-format-extra-args
2942 @opindex Wno-format-extra-args
2943 @opindex Wformat-extra-args
2944 If @option{-Wformat} is specified, do not warn about excess arguments to a
2945 @code{printf} or @code{scanf} format function.  The C standard specifies
2946 that such arguments are ignored.
2947
2948 Where the unused arguments lie between used arguments that are
2949 specified with @samp{$} operand number specifications, normally
2950 warnings are still given, since the implementation could not know what
2951 type to pass to @code{va_arg} to skip the unused arguments.  However,
2952 in the case of @code{scanf} formats, this option will suppress the
2953 warning if the unused arguments are all pointers, since the Single
2954 Unix Specification says that such unused arguments are allowed.
2955
2956 @item -Wno-format-zero-length @r{(C and Objective-C only)}
2957 @opindex Wno-format-zero-length
2958 @opindex Wformat-zero-length
2959 If @option{-Wformat} is specified, do not warn about zero-length formats.
2960 The C standard specifies that zero-length formats are allowed.
2961
2962 @item -Wformat-nonliteral
2963 @opindex Wformat-nonliteral
2964 @opindex Wno-format-nonliteral
2965 If @option{-Wformat} is specified, also warn if the format string is not a
2966 string literal and so cannot be checked, unless the format function
2967 takes its format arguments as a @code{va_list}.
2968
2969 @item -Wformat-security
2970 @opindex Wformat-security
2971 @opindex Wno-format-security
2972 If @option{-Wformat} is specified, also warn about uses of format
2973 functions that represent possible security problems.  At present, this
2974 warns about calls to @code{printf} and @code{scanf} functions where the
2975 format string is not a string literal and there are no format arguments,
2976 as in @code{printf (foo);}.  This may be a security hole if the format
2977 string came from untrusted input and contains @samp{%n}.  (This is
2978 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2979 in future warnings may be added to @option{-Wformat-security} that are not
2980 included in @option{-Wformat-nonliteral}.)
2981
2982 @item -Wformat=2
2983 @opindex Wformat=2
2984 @opindex Wno-format=2
2985 Enable @option{-Wformat} plus format checks not included in
2986 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2987 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2988
2989 @item -Wnonnull @r{(C and Objective-C only)}
2990 @opindex Wnonnull
2991 @opindex Wno-nonnull
2992 Warn about passing a null pointer for arguments marked as
2993 requiring a non-null value by the @code{nonnull} function attribute.
2994
2995 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2996 can be disabled with the @option{-Wno-nonnull} option.
2997
2998 @item -Wjump-misses-init @r{(C, Objective-C only)}
2999 @opindex Wjump-misses-init
3000 @opindex Wno-jump-misses-init
3001 Warn if a @code{goto} statement or a @code{switch} statement jumps
3002 forward across the initialization of a variable, or jumps backward to a
3003 label after the variable has been initialized.  This only warns about
3004 variables which are initialized when they are declared.  This warning is
3005 only supported for C and Objective C; in C++ this sort of branch is an
3006 error in any case.
3007
3008 @option{-Wjump-misses-init} is included in @option{-Wall} and
3009 @option{-Wc++-compat}.  It can be disabled with the
3010 @option{-Wno-jump-misses-init} option.
3011
3012 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3013 @opindex Winit-self
3014 @opindex Wno-init-self
3015 Warn about uninitialized variables which are initialized with themselves.
3016 Note this option can only be used with the @option{-Wuninitialized} option.
3017
3018 For example, GCC will warn about @code{i} being uninitialized in the
3019 following snippet only when @option{-Winit-self} has been specified:
3020 @smallexample
3021 @group
3022 int f()
3023 @{
3024   int i = i;
3025   return i;
3026 @}
3027 @end group
3028 @end smallexample
3029
3030 @item -Wimplicit-int @r{(C and Objective-C only)}
3031 @opindex Wimplicit-int
3032 @opindex Wno-implicit-int
3033 Warn when a declaration does not specify a type.
3034 This warning is enabled by @option{-Wall}.
3035
3036 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3037 @opindex Wimplicit-function-declaration
3038 @opindex Wno-implicit-function-declaration
3039 Give a warning whenever a function is used before being declared. In
3040 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3041 enabled by default and it is made into an error by
3042 @option{-pedantic-errors}. This warning is also enabled by
3043 @option{-Wall}.
3044
3045 @item -Wimplicit
3046 @opindex Wimplicit
3047 @opindex Wno-implicit
3048 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3049 This warning is enabled by @option{-Wall}.
3050
3051 @item -Wignored-qualifiers @r{(C and C++ only)}
3052 @opindex Wignored-qualifiers
3053 @opindex Wno-ignored-qualifiers
3054 Warn if the return type of a function has a type qualifier
3055 such as @code{const}.  For ISO C such a type qualifier has no effect,
3056 since the value returned by a function is not an lvalue.
3057 For C++, the warning is only emitted for scalar types or @code{void}.
3058 ISO C prohibits qualified @code{void} return types on function
3059 definitions, so such return types always receive a warning
3060 even without this option.
3061
3062 This warning is also enabled by @option{-Wextra}.
3063
3064 @item -Wmain
3065 @opindex Wmain
3066 @opindex Wno-main
3067 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3068 a function with external linkage, returning int, taking either zero
3069 arguments, two, or three arguments of appropriate types.  This warning
3070 is enabled by default in C++ and is enabled by either @option{-Wall}
3071 or @option{-pedantic}.
3072
3073 @item -Wmissing-braces
3074 @opindex Wmissing-braces
3075 @opindex Wno-missing-braces
3076 Warn if an aggregate or union initializer is not fully bracketed.  In
3077 the following example, the initializer for @samp{a} is not fully
3078 bracketed, but that for @samp{b} is fully bracketed.
3079
3080 @smallexample
3081 int a[2][2] = @{ 0, 1, 2, 3 @};
3082 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3083 @end smallexample
3084
3085 This warning is enabled by @option{-Wall}.
3086
3087 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3088 @opindex Wmissing-include-dirs
3089 @opindex Wno-missing-include-dirs
3090 Warn if a user-supplied include directory does not exist.
3091
3092 @item -Wparentheses
3093 @opindex Wparentheses
3094 @opindex Wno-parentheses
3095 Warn if parentheses are omitted in certain contexts, such
3096 as when there is an assignment in a context where a truth value
3097 is expected, or when operators are nested whose precedence people
3098 often get confused about.
3099
3100 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3101 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3102 interpretation from that of ordinary mathematical notation.
3103
3104 Also warn about constructions where there may be confusion to which
3105 @code{if} statement an @code{else} branch belongs.  Here is an example of
3106 such a case:
3107
3108 @smallexample
3109 @group
3110 @{
3111   if (a)
3112     if (b)
3113       foo ();
3114   else
3115     bar ();
3116 @}
3117 @end group
3118 @end smallexample
3119
3120 In C/C++, every @code{else} branch belongs to the innermost possible
3121 @code{if} statement, which in this example is @code{if (b)}.  This is
3122 often not what the programmer expected, as illustrated in the above
3123 example by indentation the programmer chose.  When there is the
3124 potential for this confusion, GCC will issue a warning when this flag
3125 is specified.  To eliminate the warning, add explicit braces around
3126 the innermost @code{if} statement so there is no way the @code{else}
3127 could belong to the enclosing @code{if}.  The resulting code would
3128 look like this:
3129
3130 @smallexample
3131 @group
3132 @{
3133   if (a)
3134     @{
3135       if (b)
3136         foo ();
3137       else
3138         bar ();
3139     @}
3140 @}
3141 @end group
3142 @end smallexample
3143
3144 This warning is enabled by @option{-Wall}.
3145
3146 @item -Wsequence-point
3147 @opindex Wsequence-point
3148 @opindex Wno-sequence-point
3149 Warn about code that may have undefined semantics because of violations
3150 of sequence point rules in the C and C++ standards.
3151
3152 The C and C++ standards defines the order in which expressions in a C/C++
3153 program are evaluated in terms of @dfn{sequence points}, which represent
3154 a partial ordering between the execution of parts of the program: those
3155 executed before the sequence point, and those executed after it.  These
3156 occur after the evaluation of a full expression (one which is not part
3157 of a larger expression), after the evaluation of the first operand of a
3158 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3159 function is called (but after the evaluation of its arguments and the
3160 expression denoting the called function), and in certain other places.
3161 Other than as expressed by the sequence point rules, the order of
3162 evaluation of subexpressions of an expression is not specified.  All
3163 these rules describe only a partial order rather than a total order,
3164 since, for example, if two functions are called within one expression
3165 with no sequence point between them, the order in which the functions
3166 are called is not specified.  However, the standards committee have
3167 ruled that function calls do not overlap.
3168
3169 It is not specified when between sequence points modifications to the
3170 values of objects take effect.  Programs whose behavior depends on this
3171 have undefined behavior; the C and C++ standards specify that ``Between
3172 the previous and next sequence point an object shall have its stored
3173 value modified at most once by the evaluation of an expression.
3174 Furthermore, the prior value shall be read only to determine the value
3175 to be stored.''.  If a program breaks these rules, the results on any
3176 particular implementation are entirely unpredictable.
3177
3178 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3179 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3180 diagnosed by this option, and it may give an occasional false positive
3181 result, but in general it has been found fairly effective at detecting
3182 this sort of problem in programs.
3183
3184 The standard is worded confusingly, therefore there is some debate
3185 over the precise meaning of the sequence point rules in subtle cases.
3186 Links to discussions of the problem, including proposed formal
3187 definitions, may be found on the GCC readings page, at
3188 @w{@uref{http://gcc.gnu.org/readings.html}}.
3189
3190 This warning is enabled by @option{-Wall} for C and C++.
3191
3192 @item -Wreturn-type
3193 @opindex Wreturn-type
3194 @opindex Wno-return-type
3195 Warn whenever a function is defined with a return-type that defaults
3196 to @code{int}.  Also warn about any @code{return} statement with no
3197 return-value in a function whose return-type is not @code{void}
3198 (falling off the end of the function body is considered returning
3199 without a value), and about a @code{return} statement with an
3200 expression in a function whose return-type is @code{void}.
3201
3202 For C++, a function without return type always produces a diagnostic
3203 message, even when @option{-Wno-return-type} is specified.  The only
3204 exceptions are @samp{main} and functions defined in system headers.
3205
3206 This warning is enabled by @option{-Wall}.
3207
3208 @item -Wswitch
3209 @opindex Wswitch
3210 @opindex Wno-switch
3211 Warn whenever a @code{switch} statement has an index of enumerated type
3212 and lacks a @code{case} for one or more of the named codes of that
3213 enumeration.  (The presence of a @code{default} label prevents this
3214 warning.)  @code{case} labels outside the enumeration range also
3215 provoke warnings when this option is used (even if there is a
3216 @code{default} label).
3217 This warning is enabled by @option{-Wall}.
3218
3219 @item -Wswitch-default
3220 @opindex Wswitch-default
3221 @opindex Wno-switch-default
3222 Warn whenever a @code{switch} statement does not have a @code{default}
3223 case.
3224
3225 @item -Wswitch-enum
3226 @opindex Wswitch-enum
3227 @opindex Wno-switch-enum
3228 Warn whenever a @code{switch} statement has an index of enumerated type
3229 and lacks a @code{case} for one or more of the named codes of that
3230 enumeration.  @code{case} labels outside the enumeration range also
3231 provoke warnings when this option is used.  The only difference
3232 between @option{-Wswitch} and this option is that this option gives a
3233 warning about an omitted enumeration code even if there is a
3234 @code{default} label.
3235
3236 @item -Wsync-nand @r{(C and C++ only)}
3237 @opindex Wsync-nand
3238 @opindex Wno-sync-nand
3239 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3240 built-in functions are used.  These functions changed semantics in GCC 4.4.
3241
3242 @item -Wtrigraphs
3243 @opindex Wtrigraphs
3244 @opindex Wno-trigraphs
3245 Warn if any trigraphs are encountered that might change the meaning of
3246 the program (trigraphs within comments are not warned about).
3247 This warning is enabled by @option{-Wall}.
3248
3249 @item -Wunused-function
3250 @opindex Wunused-function
3251 @opindex Wno-unused-function
3252 Warn whenever a static function is declared but not defined or a
3253 non-inline static function is unused.
3254 This warning is enabled by @option{-Wall}.
3255
3256 @item -Wunused-label
3257 @opindex Wunused-label
3258 @opindex Wno-unused-label
3259 Warn whenever a label is declared but not used.
3260 This warning is enabled by @option{-Wall}.
3261
3262 To suppress this warning use the @samp{unused} attribute
3263 (@pxref{Variable Attributes}).
3264
3265 @item -Wunused-parameter
3266 @opindex Wunused-parameter
3267 @opindex Wno-unused-parameter
3268 Warn whenever a function parameter is unused aside from its declaration.
3269
3270 To suppress this warning use the @samp{unused} attribute
3271 (@pxref{Variable Attributes}).
3272
3273 @item -Wno-unused-result
3274 @opindex Wunused-result
3275 @opindex Wno-unused-result
3276 Do not warn if a caller of a function marked with attribute
3277 @code{warn_unused_result} (@pxref{Variable Attributes}) does not use
3278 its return value. The default is @option{-Wunused-result}.
3279
3280 @item -Wunused-variable
3281 @opindex Wunused-variable
3282 @opindex Wno-unused-variable
3283 Warn whenever a local variable or non-constant static variable is unused
3284 aside from its declaration.
3285 This warning is enabled by @option{-Wall}.
3286
3287 To suppress this warning use the @samp{unused} attribute
3288 (@pxref{Variable Attributes}).
3289
3290 @item -Wunused-value
3291 @opindex Wunused-value
3292 @opindex Wno-unused-value
3293 Warn whenever a statement computes a result that is explicitly not
3294 used. To suppress this warning cast the unused expression to
3295 @samp{void}. This includes an expression-statement or the left-hand
3296 side of a comma expression that contains no side effects. For example,
3297 an expression such as @samp{x[i,j]} will cause a warning, while
3298 @samp{x[(void)i,j]} will not.
3299
3300 This warning is enabled by @option{-Wall}.
3301
3302 @item -Wunused
3303 @opindex Wunused
3304 @opindex Wno-unused
3305 All the above @option{-Wunused} options combined.
3306
3307 In order to get a warning about an unused function parameter, you must
3308 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3309 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3310
3311 @item -Wuninitialized
3312 @opindex Wuninitialized
3313 @opindex Wno-uninitialized
3314 Warn if an automatic variable is used without first being initialized
3315 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3316 warn if a non-static reference or non-static @samp{const} member
3317 appears in a class without constructors.
3318
3319 If you want to warn about code which uses the uninitialized value of the
3320 variable in its own initializer, use the @option{-Winit-self} option.
3321
3322 These warnings occur for individual uninitialized or clobbered
3323 elements of structure, union or array variables as well as for
3324 variables which are uninitialized or clobbered as a whole.  They do
3325 not occur for variables or elements declared @code{volatile}.  Because
3326 these warnings depend on optimization, the exact variables or elements
3327 for which there are warnings will depend on the precise optimization
3328 options and version of GCC used.
3329
3330 Note that there may be no warning about a variable that is used only
3331 to compute a value that itself is never used, because such
3332 computations may be deleted by data flow analysis before the warnings
3333 are printed.
3334
3335 These warnings are made optional because GCC is not smart
3336 enough to see all the reasons why the code might be correct
3337 despite appearing to have an error.  Here is one example of how
3338 this can happen:
3339
3340 @smallexample
3341 @group
3342 @{
3343   int x;
3344   switch (y)
3345     @{
3346     case 1: x = 1;
3347       break;
3348     case 2: x = 4;
3349       break;
3350     case 3: x = 5;
3351     @}
3352   foo (x);
3353 @}
3354 @end group
3355 @end smallexample
3356
3357 @noindent
3358 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3359 always initialized, but GCC doesn't know this.  Here is
3360 another common case:
3361
3362 @smallexample
3363 @{
3364   int save_y;
3365   if (change_y) save_y = y, y = new_y;
3366   @dots{}
3367   if (change_y) y = save_y;
3368 @}
3369 @end smallexample
3370
3371 @noindent
3372 This has no bug because @code{save_y} is used only if it is set.
3373
3374 @cindex @code{longjmp} warnings
3375 This option also warns when a non-volatile automatic variable might be
3376 changed by a call to @code{longjmp}.  These warnings as well are possible
3377 only in optimizing compilation.
3378
3379 The compiler sees only the calls to @code{setjmp}.  It cannot know
3380 where @code{longjmp} will be called; in fact, a signal handler could
3381 call it at any point in the code.  As a result, you may get a warning
3382 even when there is in fact no problem because @code{longjmp} cannot
3383 in fact be called at the place which would cause a problem.
3384
3385 Some spurious warnings can be avoided if you declare all the functions
3386 you use that never return as @code{noreturn}.  @xref{Function
3387 Attributes}.
3388
3389 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3390
3391 @item -Wunknown-pragmas
3392 @opindex Wunknown-pragmas
3393 @opindex Wno-unknown-pragmas
3394 @cindex warning for unknown pragmas
3395 @cindex unknown pragmas, warning
3396 @cindex pragmas, warning of unknown
3397 Warn when a #pragma directive is encountered which is not understood by
3398 GCC@.  If this command line option is used, warnings will even be issued
3399 for unknown pragmas in system header files.  This is not the case if
3400 the warnings were only enabled by the @option{-Wall} command line option.
3401
3402 @item -Wno-pragmas
3403 @opindex Wno-pragmas
3404 @opindex Wpragmas
3405 Do not warn about misuses of pragmas, such as incorrect parameters,
3406 invalid syntax, or conflicts between pragmas.  See also
3407 @samp{-Wunknown-pragmas}.
3408
3409 @item -Wstrict-aliasing
3410 @opindex Wstrict-aliasing
3411 @opindex Wno-strict-aliasing
3412 This option is only active when @option{-fstrict-aliasing} is active.
3413 It warns about code which might break the strict aliasing rules that the
3414 compiler is using for optimization.  The warning does not catch all
3415 cases, but does attempt to catch the more common pitfalls.  It is
3416 included in @option{-Wall}.
3417 It is equivalent to @option{-Wstrict-aliasing=3}
3418
3419 @item -Wstrict-aliasing=n
3420 @opindex Wstrict-aliasing=n
3421 @opindex Wno-strict-aliasing=n
3422 This option is only active when @option{-fstrict-aliasing} is active.
3423 It warns about code which might break the strict aliasing rules that the
3424 compiler is using for optimization.
3425 Higher levels correspond to higher accuracy (fewer false positives).
3426 Higher levels also correspond to more effort, similar to the way -O works.
3427 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3428 with n=3.
3429
3430 Level 1: Most aggressive, quick, least accurate.
3431 Possibly useful when higher levels
3432 do not warn but -fstrict-aliasing still breaks the code, as it has very few
3433 false negatives.  However, it has many false positives.
3434 Warns for all pointer conversions between possibly incompatible types,
3435 even if never dereferenced.  Runs in the frontend only.
3436
3437 Level 2: Aggressive, quick, not too precise.
3438 May still have many false positives (not as many as level 1 though),
3439 and few false negatives (but possibly more than level 1).
3440 Unlike level 1, it only warns when an address is taken.  Warns about
3441 incomplete types.  Runs in the frontend only.
3442
3443 Level 3 (default for @option{-Wstrict-aliasing}):
3444 Should have very few false positives and few false
3445 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3446 Takes care of the common punn+dereference pattern in the frontend:
3447 @code{*(int*)&some_float}.
3448 If optimization is enabled, it also runs in the backend, where it deals
3449 with multiple statement cases using flow-sensitive points-to information.
3450 Only warns when the converted pointer is dereferenced.
3451 Does not warn about incomplete types.
3452
3453 @item -Wstrict-overflow
3454 @itemx -Wstrict-overflow=@var{n}
3455 @opindex Wstrict-overflow
3456 @opindex Wno-strict-overflow
3457 This option is only active when @option{-fstrict-overflow} is active.
3458 It warns about cases where the compiler optimizes based on the
3459 assumption that signed overflow does not occur.  Note that it does not
3460 warn about all cases where the code might overflow: it only warns
3461 about cases where the compiler implements some optimization.  Thus
3462 this warning depends on the optimization level.
3463
3464 An optimization which assumes that signed overflow does not occur is
3465 perfectly safe if the values of the variables involved are such that
3466 overflow never does, in fact, occur.  Therefore this warning can
3467 easily give a false positive: a warning about code which is not
3468 actually a problem.  To help focus on important issues, several
3469 warning levels are defined.  No warnings are issued for the use of
3470 undefined signed overflow when estimating how many iterations a loop
3471 will require, in particular when determining whether a loop will be
3472 executed at all.
3473
3474 @table @gcctabopt
3475 @item -Wstrict-overflow=1
3476 Warn about cases which are both questionable and easy to avoid.  For
3477 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3478 compiler will simplify this to @code{1}.  This level of
3479 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3480 are not, and must be explicitly requested.
3481
3482 @item -Wstrict-overflow=2
3483 Also warn about other cases where a comparison is simplified to a
3484 constant.  For example: @code{abs (x) >= 0}.  This can only be
3485 simplified when @option{-fstrict-overflow} is in effect, because
3486 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3487 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3488 @option{-Wstrict-overflow=2}.
3489
3490 @item -Wstrict-overflow=3
3491 Also warn about other cases where a comparison is simplified.  For
3492 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3493
3494 @item -Wstrict-overflow=4
3495 Also warn about other simplifications not covered by the above cases.
3496 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3497
3498 @item -Wstrict-overflow=5
3499 Also warn about cases where the compiler reduces the magnitude of a
3500 constant involved in a comparison.  For example: @code{x + 2 > y} will
3501 be simplified to @code{x + 1 >= y}.  This is reported only at the
3502 highest warning level because this simplification applies to many
3503 comparisons, so this warning level will give a very large number of
3504 false positives.
3505 @end table
3506
3507 @item -Warray-bounds
3508 @opindex Wno-array-bounds
3509 @opindex Warray-bounds
3510 This option is only active when @option{-ftree-vrp} is active
3511 (default for -O2 and above). It warns about subscripts to arrays
3512 that are always out of bounds. This warning is enabled by @option{-Wall}.
3513
3514 @item -Wno-div-by-zero
3515 @opindex Wno-div-by-zero
3516 @opindex Wdiv-by-zero
3517 Do not warn about compile-time integer division by zero.  Floating point
3518 division by zero is not warned about, as it can be a legitimate way of
3519 obtaining infinities and NaNs.
3520
3521 @item -Wsystem-headers
3522 @opindex Wsystem-headers
3523 @opindex Wno-system-headers
3524 @cindex warnings from system headers
3525 @cindex system headers, warnings from
3526 Print warning messages for constructs found in system header files.
3527 Warnings from system headers are normally suppressed, on the assumption
3528 that they usually do not indicate real problems and would only make the
3529 compiler output harder to read.  Using this command line option tells
3530 GCC to emit warnings from system headers as if they occurred in user
3531 code.  However, note that using @option{-Wall} in conjunction with this
3532 option will @emph{not} warn about unknown pragmas in system
3533 headers---for that, @option{-Wunknown-pragmas} must also be used.
3534
3535 @item -Wfloat-equal
3536 @opindex Wfloat-equal
3537 @opindex Wno-float-equal
3538 Warn if floating point values are used in equality comparisons.
3539
3540 The idea behind this is that sometimes it is convenient (for the
3541 programmer) to consider floating-point values as approximations to
3542 infinitely precise real numbers.  If you are doing this, then you need
3543 to compute (by analyzing the code, or in some other way) the maximum or
3544 likely maximum error that the computation introduces, and allow for it
3545 when performing comparisons (and when producing output, but that's a
3546 different problem).  In particular, instead of testing for equality, you
3547 would check to see whether the two values have ranges that overlap; and
3548 this is done with the relational operators, so equality comparisons are
3549 probably mistaken.
3550
3551 @item -Wtraditional @r{(C and Objective-C only)}
3552 @opindex Wtraditional
3553 @opindex Wno-traditional
3554 Warn about certain constructs that behave differently in traditional and
3555 ISO C@.  Also warn about ISO C constructs that have no traditional C
3556 equivalent, and/or problematic constructs which should be avoided.
3557
3558 @itemize @bullet
3559 @item
3560 Macro parameters that appear within string literals in the macro body.
3561 In traditional C macro replacement takes place within string literals,
3562 but does not in ISO C@.
3563
3564 @item
3565 In traditional C, some preprocessor directives did not exist.
3566 Traditional preprocessors would only consider a line to be a directive
3567 if the @samp{#} appeared in column 1 on the line.  Therefore
3568 @option{-Wtraditional} warns about directives that traditional C
3569 understands but would ignore because the @samp{#} does not appear as the
3570 first character on the line.  It also suggests you hide directives like
3571 @samp{#pragma} not understood by traditional C by indenting them.  Some
3572 traditional implementations would not recognize @samp{#elif}, so it
3573 suggests avoiding it altogether.
3574
3575 @item
3576 A function-like macro that appears without arguments.
3577
3578 @item
3579 The unary plus operator.
3580
3581 @item
3582 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3583 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3584 constants.)  Note, these suffixes appear in macros defined in the system
3585 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3586 Use of these macros in user code might normally lead to spurious
3587 warnings, however GCC's integrated preprocessor has enough context to
3588 avoid warning in these cases.
3589
3590 @item
3591 A function declared external in one block and then used after the end of
3592 the block.
3593
3594 @item
3595 A @code{switch} statement has an operand of type @code{long}.
3596
3597 @item
3598 A non-@code{static} function declaration follows a @code{static} one.
3599 This construct is not accepted by some traditional C compilers.
3600
3601 @item
3602 The ISO type of an integer constant has a different width or
3603 signedness from its traditional type.  This warning is only issued if
3604 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3605 typically represent bit patterns, are not warned about.
3606
3607 @item
3608 Usage of ISO string concatenation is detected.
3609
3610 @item
3611 Initialization of automatic aggregates.
3612
3613 @item
3614 Identifier conflicts with labels.  Traditional C lacks a separate
3615 namespace for labels.
3616
3617 @item
3618 Initialization of unions.  If the initializer is zero, the warning is
3619 omitted.  This is done under the assumption that the zero initializer in
3620 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3621 initializer warnings and relies on default initialization to zero in the
3622 traditional C case.
3623
3624 @item
3625 Conversions by prototypes between fixed/floating point values and vice
3626 versa.  The absence of these prototypes when compiling with traditional
3627 C would cause serious problems.  This is a subset of the possible
3628 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3629
3630 @item
3631 Use of ISO C style function definitions.  This warning intentionally is
3632 @emph{not} issued for prototype declarations or variadic functions
3633 because these ISO C features will appear in your code when using
3634 libiberty's traditional C compatibility macros, @code{PARAMS} and
3635 @code{VPARAMS}.  This warning is also bypassed for nested functions
3636 because that feature is already a GCC extension and thus not relevant to
3637 traditional C compatibility.
3638 @end itemize
3639
3640 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3641 @opindex Wtraditional-conversion
3642 @opindex Wno-traditional-conversion
3643 Warn if a prototype causes a type conversion that is different from what
3644 would happen to the same argument in the absence of a prototype.  This
3645 includes conversions of fixed point to floating and vice versa, and
3646 conversions changing the width or signedness of a fixed point argument
3647 except when the same as the default promotion.
3648
3649 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3650 @opindex Wdeclaration-after-statement
3651 @opindex Wno-declaration-after-statement
3652 Warn when a declaration is found after a statement in a block.  This
3653 construct, known from C++, was introduced with ISO C99 and is by default
3654 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3655 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3656
3657 @item -Wundef
3658 @opindex Wundef
3659 @opindex Wno-undef
3660 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3661
3662 @item -Wno-endif-labels
3663 @opindex Wno-endif-labels
3664 @opindex Wendif-labels
3665 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3666
3667 @item -Wshadow
3668 @opindex Wshadow
3669 @opindex Wno-shadow
3670 Warn whenever a local variable shadows another local variable, parameter or
3671 global variable or whenever a built-in function is shadowed.
3672
3673 @item -Wlarger-than=@var{len}
3674 @opindex Wlarger-than=@var{len}
3675 @opindex Wlarger-than-@var{len}
3676 Warn whenever an object of larger than @var{len} bytes is defined.
3677
3678 @item -Wframe-larger-than=@var{len}
3679 @opindex Wframe-larger-than
3680 Warn if the size of a function frame is larger than @var{len} bytes.
3681 The computation done to determine the stack frame size is approximate
3682 and not conservative.
3683 The actual requirements may be somewhat greater than @var{len}
3684 even if you do not get a warning.  In addition, any space allocated
3685 via @code{alloca}, variable-length arrays, or related constructs
3686 is not included by the compiler when determining
3687 whether or not to issue a warning.
3688
3689 @item -Wunsafe-loop-optimizations
3690 @opindex Wunsafe-loop-optimizations
3691 @opindex Wno-unsafe-loop-optimizations
3692 Warn if the loop cannot be optimized because the compiler could not
3693 assume anything on the bounds of the loop indices.  With
3694 @option{-funsafe-loop-optimizations} warn if the compiler made
3695 such assumptions.
3696
3697 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
3698 @opindex Wno-pedantic-ms-format
3699 @opindex Wpedantic-ms-format
3700 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
3701 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
3702 depending on the MS runtime, when you are using the options @option{-Wformat}
3703 and @option{-pedantic} without gnu-extensions.
3704
3705 @item -Wpointer-arith
3706 @opindex Wpointer-arith
3707 @opindex Wno-pointer-arith
3708 Warn about anything that depends on the ``size of'' a function type or
3709 of @code{void}.  GNU C assigns these types a size of 1, for
3710 convenience in calculations with @code{void *} pointers and pointers
3711 to functions.  In C++, warn also when an arithmetic operation involves
3712 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3713
3714 @item -Wtype-limits
3715 @opindex Wtype-limits
3716 @opindex Wno-type-limits
3717 Warn if a comparison is always true or always false due to the limited
3718 range of the data type, but do not warn for constant expressions.  For
3719 example, warn if an unsigned variable is compared against zero with
3720 @samp{<} or @samp{>=}.  This warning is also enabled by
3721 @option{-Wextra}.
3722
3723 @item -Wbad-function-cast @r{(C and Objective-C only)}
3724 @opindex Wbad-function-cast
3725 @opindex Wno-bad-function-cast
3726 Warn whenever a function call is cast to a non-matching type.
3727 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3728
3729 @item -Wc++-compat @r{(C and Objective-C only)}
3730 Warn about ISO C constructs that are outside of the common subset of
3731 ISO C and ISO C++, e.g.@: request for implicit conversion from
3732 @code{void *} to a pointer to non-@code{void} type.
3733
3734 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3735 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3736 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3737 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3738
3739 @item -Wcast-qual
3740 @opindex Wcast-qual
3741 @opindex Wno-cast-qual
3742 Warn whenever a pointer is cast so as to remove a type qualifier from
3743 the target type.  For example, warn if a @code{const char *} is cast
3744 to an ordinary @code{char *}.
3745
3746 Also warn when making a cast which introduces a type qualifier in an
3747 unsafe way.  For example, casting @code{char **} to @code{const char **}
3748 is unsafe, as in this example:
3749
3750 @smallexample
3751   /* p is char ** value.  */
3752   const char **q = (const char **) p;
3753   /* Assignment of readonly string to const char * is OK.  */
3754   *q = "string";
3755   /* Now char** pointer points to read-only memory.  */
3756   **p = 'b';
3757 @end smallexample
3758
3759 @item -Wcast-align
3760 @opindex Wcast-align
3761 @opindex Wno-cast-align
3762 Warn whenever a pointer is cast such that the required alignment of the
3763 target is increased.  For example, warn if a @code{char *} is cast to
3764 an @code{int *} on machines where integers can only be accessed at
3765 two- or four-byte boundaries.
3766
3767 @item -Wwrite-strings
3768 @opindex Wwrite-strings
3769 @opindex Wno-write-strings
3770 When compiling C, give string constants the type @code{const
3771 char[@var{length}]} so that copying the address of one into a
3772 non-@code{const} @code{char *} pointer will get a warning.  These
3773 warnings will help you find at compile time code that can try to write
3774 into a string constant, but only if you have been very careful about
3775 using @code{const} in declarations and prototypes.  Otherwise, it will
3776 just be a nuisance. This is why we did not make @option{-Wall} request
3777 these warnings.
3778
3779 When compiling C++, warn about the deprecated conversion from string
3780 literals to @code{char *}.  This warning is enabled by default for C++
3781 programs.
3782
3783 @item -Wclobbered
3784 @opindex Wclobbered
3785 @opindex Wno-clobbered
3786 Warn for variables that might be changed by @samp{longjmp} or
3787 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3788
3789 @item -Wconversion
3790 @opindex Wconversion
3791 @opindex Wno-conversion
3792 Warn for implicit conversions that may alter a value. This includes
3793 conversions between real and integer, like @code{abs (x)} when
3794 @code{x} is @code{double}; conversions between signed and unsigned,
3795 like @code{unsigned ui = -1}; and conversions to smaller types, like
3796 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3797 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3798 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3799 conversions between signed and unsigned integers can be disabled by
3800 using @option{-Wno-sign-conversion}.
3801
3802 For C++, also warn for conversions between @code{NULL} and non-pointer
3803 types; confusing overload resolution for user-defined conversions; and
3804 conversions that will never use a type conversion operator:
3805 conversions to @code{void}, the same type, a base class or a reference
3806 to them. Warnings about conversions between signed and unsigned
3807 integers are disabled by default in C++ unless
3808 @option{-Wsign-conversion} is explicitly enabled.
3809
3810 @item -Wempty-body
3811 @opindex Wempty-body
3812 @opindex Wno-empty-body
3813 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3814 while} statement.  This warning is also enabled by @option{-Wextra}.
3815
3816 @item -Wenum-compare
3817 @opindex Wenum-compare
3818 @opindex Wno-enum-compare
3819 Warn about a comparison between values of different enum types. In C++
3820 this warning is enabled by default.  In C this warning is enabled by
3821 @option{-Wall}.
3822
3823 @item -Wsign-compare
3824 @opindex Wsign-compare
3825 @opindex Wno-sign-compare
3826 @cindex warning for comparison of signed and unsigned values
3827 @cindex comparison of signed and unsigned values, warning
3828 @cindex signed and unsigned values, comparison warning
3829 Warn when a comparison between signed and unsigned values could produce
3830 an incorrect result when the signed value is converted to unsigned.
3831 This warning is also enabled by @option{-Wextra}; to get the other warnings
3832 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3833
3834 @item -Wsign-conversion
3835 @opindex Wsign-conversion
3836 @opindex Wno-sign-conversion
3837 Warn for implicit conversions that may change the sign of an integer
3838 value, like assigning a signed integer expression to an unsigned
3839 integer variable. An explicit cast silences the warning. In C, this
3840 option is enabled also by @option{-Wconversion}.
3841
3842 @item -Waddress
3843 @opindex Waddress
3844 @opindex Wno-address
3845 Warn about suspicious uses of memory addresses. These include using
3846 the address of a function in a conditional expression, such as
3847 @code{void func(void); if (func)}, and comparisons against the memory
3848 address of a string literal, such as @code{if (x == "abc")}.  Such
3849 uses typically indicate a programmer error: the address of a function
3850 always evaluates to true, so their use in a conditional usually
3851 indicate that the programmer forgot the parentheses in a function
3852 call; and comparisons against string literals result in unspecified
3853 behavior and are not portable in C, so they usually indicate that the
3854 programmer intended to use @code{strcmp}.  This warning is enabled by
3855 @option{-Wall}.
3856
3857 @item -Wlogical-op
3858 @opindex Wlogical-op
3859 @opindex Wno-logical-op
3860 Warn about suspicious uses of logical operators in expressions.
3861 This includes using logical operators in contexts where a
3862 bit-wise operator is likely to be expected.
3863
3864 @item -Waggregate-return
3865 @opindex Waggregate-return
3866 @opindex Wno-aggregate-return
3867 Warn if any functions that return structures or unions are defined or
3868 called.  (In languages where you can return an array, this also elicits
3869 a warning.)
3870
3871 @item -Wno-attributes
3872 @opindex Wno-attributes
3873 @opindex Wattributes
3874 Do not warn if an unexpected @code{__attribute__} is used, such as
3875 unrecognized attributes, function attributes applied to variables,
3876 etc.  This will not stop errors for incorrect use of supported
3877 attributes.
3878
3879 @item -Wno-builtin-macro-redefined
3880 @opindex Wno-builtin-macro-redefined
3881 @opindex Wbuiltin-macro-redefined
3882 Do not warn if certain built-in macros are redefined.  This suppresses
3883 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
3884 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
3885
3886 @item -Wstrict-prototypes @r{(C and Objective-C only)}
3887 @opindex Wstrict-prototypes
3888 @opindex Wno-strict-prototypes
3889 Warn if a function is declared or defined without specifying the
3890 argument types.  (An old-style function definition is permitted without
3891 a warning if preceded by a declaration which specifies the argument
3892 types.)
3893
3894 @item -Wold-style-declaration @r{(C and Objective-C only)}
3895 @opindex Wold-style-declaration
3896 @opindex Wno-old-style-declaration
3897 Warn for obsolescent usages, according to the C Standard, in a
3898 declaration. For example, warn if storage-class specifiers like
3899 @code{static} are not the first things in a declaration.  This warning
3900 is also enabled by @option{-Wextra}.
3901
3902 @item -Wold-style-definition @r{(C and Objective-C only)}
3903 @opindex Wold-style-definition
3904 @opindex Wno-old-style-definition
3905 Warn if an old-style function definition is used.  A warning is given
3906 even if there is a previous prototype.
3907
3908 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
3909 @opindex Wmissing-parameter-type
3910 @opindex Wno-missing-parameter-type
3911 A function parameter is declared without a type specifier in K&R-style
3912 functions:
3913
3914 @smallexample
3915 void foo(bar) @{ @}
3916 @end smallexample
3917
3918 This warning is also enabled by @option{-Wextra}.
3919
3920 @item -Wmissing-prototypes @r{(C and Objective-C only)}
3921 @opindex Wmissing-prototypes
3922 @opindex Wno-missing-prototypes
3923 Warn if a global function is defined without a previous prototype
3924 declaration.  This warning is issued even if the definition itself
3925 provides a prototype.  The aim is to detect global functions that fail
3926 to be declared in header files.
3927
3928 @item -Wmissing-declarations
3929 @opindex Wmissing-declarations
3930 @opindex Wno-missing-declarations
3931 Warn if a global function is defined without a previous declaration.
3932 Do so even if the definition itself provides a prototype.
3933 Use this option to detect global functions that are not declared in
3934 header files.  In C++, no warnings are issued for function templates,
3935 or for inline functions, or for functions in anonymous namespaces.
3936
3937 @item -Wmissing-field-initializers
3938 @opindex Wmissing-field-initializers
3939 @opindex Wno-missing-field-initializers
3940 @opindex W
3941 @opindex Wextra
3942 @opindex Wno-extra
3943 Warn if a structure's initializer has some fields missing.  For
3944 example, the following code would cause such a warning, because
3945 @code{x.h} is implicitly zero:
3946
3947 @smallexample
3948 struct s @{ int f, g, h; @};
3949 struct s x = @{ 3, 4 @};
3950 @end smallexample
3951
3952 This option does not warn about designated initializers, so the following
3953 modification would not trigger a warning:
3954
3955 @smallexample
3956 struct s @{ int f, g, h; @};
3957 struct s x = @{ .f = 3, .g = 4 @};
3958 @end smallexample
3959
3960 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3961 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3962
3963 @item -Wmissing-noreturn
3964 @opindex Wmissing-noreturn
3965 @opindex Wno-missing-noreturn
3966 Warn about functions which might be candidates for attribute @code{noreturn}.
3967 Note these are only possible candidates, not absolute ones.  Care should
3968 be taken to manually verify functions actually do not ever return before
3969 adding the @code{noreturn} attribute, otherwise subtle code generation
3970 bugs could be introduced.  You will not get a warning for @code{main} in
3971 hosted C environments.
3972
3973 @item -Wmissing-format-attribute
3974 @opindex Wmissing-format-attribute
3975 @opindex Wno-missing-format-attribute
3976 @opindex Wformat
3977 @opindex Wno-format
3978 Warn about function pointers which might be candidates for @code{format}
3979 attributes.  Note these are only possible candidates, not absolute ones.
3980 GCC will guess that function pointers with @code{format} attributes that
3981 are used in assignment, initialization, parameter passing or return
3982 statements should have a corresponding @code{format} attribute in the
3983 resulting type.  I.e.@: the left-hand side of the assignment or
3984 initialization, the type of the parameter variable, or the return type
3985 of the containing function respectively should also have a @code{format}
3986 attribute to avoid the warning.
3987
3988 GCC will also warn about function definitions which might be
3989 candidates for @code{format} attributes.  Again, these are only
3990 possible candidates.  GCC will guess that @code{format} attributes
3991 might be appropriate for any function that calls a function like
3992 @code{vprintf} or @code{vscanf}, but this might not always be the
3993 case, and some functions for which @code{format} attributes are
3994 appropriate may not be detected.
3995
3996 @item -Wno-multichar
3997 @opindex Wno-multichar
3998 @opindex Wmultichar
3999 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4000 Usually they indicate a typo in the user's code, as they have
4001 implementation-defined values, and should not be used in portable code.
4002
4003 @item -Wnormalized=<none|id|nfc|nfkc>
4004 @opindex Wnormalized=
4005 @cindex NFC
4006 @cindex NFKC
4007 @cindex character set, input normalization
4008 In ISO C and ISO C++, two identifiers are different if they are
4009 different sequences of characters.  However, sometimes when characters
4010 outside the basic ASCII character set are used, you can have two
4011 different character sequences that look the same.  To avoid confusion,
4012 the ISO 10646 standard sets out some @dfn{normalization rules} which
4013 when applied ensure that two sequences that look the same are turned into
4014 the same sequence.  GCC can warn you if you are using identifiers which
4015 have not been normalized; this option controls that warning.
4016
4017 There are four levels of warning that GCC supports.  The default is
4018 @option{-Wnormalized=nfc}, which warns about any identifier which is
4019 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4020 recommended form for most uses.
4021
4022 Unfortunately, there are some characters which ISO C and ISO C++ allow
4023 in identifiers that when turned into NFC aren't allowable as
4024 identifiers.  That is, there's no way to use these symbols in portable
4025 ISO C or C++ and have all your identifiers in NFC@.
4026 @option{-Wnormalized=id} suppresses the warning for these characters.
4027 It is hoped that future versions of the standards involved will correct
4028 this, which is why this option is not the default.
4029
4030 You can switch the warning off for all characters by writing
4031 @option{-Wnormalized=none}.  You would only want to do this if you
4032 were using some other normalization scheme (like ``D''), because
4033 otherwise you can easily create bugs that are literally impossible to see.
4034
4035 Some characters in ISO 10646 have distinct meanings but look identical
4036 in some fonts or display methodologies, especially once formatting has
4037 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4038 LETTER N'', will display just like a regular @code{n} which has been
4039 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4040 normalization scheme to convert all these into a standard form as
4041 well, and GCC will warn if your code is not in NFKC if you use
4042 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4043 about every identifier that contains the letter O because it might be
4044 confused with the digit 0, and so is not the default, but may be
4045 useful as a local coding convention if the programming environment is
4046 unable to be fixed to display these characters distinctly.
4047
4048 @item -Wno-deprecated
4049 @opindex Wno-deprecated
4050 @opindex Wdeprecated
4051 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4052
4053 @item -Wno-deprecated-declarations
4054 @opindex Wno-deprecated-declarations
4055 @opindex Wdeprecated-declarations
4056 Do not warn about uses of functions (@pxref{Function Attributes}),
4057 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4058 Attributes}) marked as deprecated by using the @code{deprecated}
4059 attribute.
4060
4061 @item -Wno-overflow
4062 @opindex Wno-overflow
4063 @opindex Woverflow
4064 Do not warn about compile-time overflow in constant expressions.
4065
4066 @item -Woverride-init @r{(C and Objective-C only)}
4067 @opindex Woverride-init
4068 @opindex Wno-override-init
4069 @opindex W
4070 @opindex Wextra
4071 @opindex Wno-extra
4072 Warn if an initialized field without side effects is overridden when
4073 using designated initializers (@pxref{Designated Inits, , Designated
4074 Initializers}).
4075
4076 This warning is included in @option{-Wextra}.  To get other
4077 @option{-Wextra} warnings without this one, use @samp{-Wextra
4078 -Wno-override-init}.
4079
4080 @item -Wpacked
4081 @opindex Wpacked
4082 @opindex Wno-packed
4083 Warn if a structure is given the packed attribute, but the packed
4084 attribute has no effect on the layout or size of the structure.
4085 Such structures may be mis-aligned for little benefit.  For
4086 instance, in this code, the variable @code{f.x} in @code{struct bar}
4087 will be misaligned even though @code{struct bar} does not itself
4088 have the packed attribute:
4089
4090 @smallexample
4091 @group
4092 struct foo @{
4093   int x;
4094   char a, b, c, d;
4095 @} __attribute__((packed));
4096 struct bar @{
4097   char z;
4098   struct foo f;
4099 @};
4100 @end group
4101 @end smallexample
4102
4103 @item -Wpacked-bitfield-compat
4104 @opindex Wpacked-bitfield-compat
4105 @opindex Wno-packed-bitfield-compat
4106 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4107 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4108 the change can lead to differences in the structure layout.  GCC
4109 informs you when the offset of such a field has changed in GCC 4.4.
4110 For example there is no longer a 4-bit padding between field @code{a}
4111 and @code{b} in this structure:
4112
4113 @smallexample
4114 struct foo
4115 @{
4116   char a:4;
4117   char b:8;
4118 @} __attribute__ ((packed));
4119 @end smallexample
4120
4121 This warning is enabled by default.  Use
4122 @option{-Wno-packed-bitfield-compat} to disable this warning.
4123
4124 @item -Wpadded
4125 @opindex Wpadded
4126 @opindex Wno-padded
4127 Warn if padding is included in a structure, either to align an element
4128 of the structure or to align the whole structure.  Sometimes when this
4129 happens it is possible to rearrange the fields of the structure to
4130 reduce the padding and so make the structure smaller.
4131
4132 @item -Wredundant-decls
4133 @opindex Wredundant-decls
4134 @opindex Wno-redundant-decls
4135 Warn if anything is declared more than once in the same scope, even in
4136 cases where multiple declaration is valid and changes nothing.
4137
4138 @item -Wnested-externs @r{(C and Objective-C only)}
4139 @opindex Wnested-externs
4140 @opindex Wno-nested-externs
4141 Warn if an @code{extern} declaration is encountered within a function.
4142
4143 @item -Wunreachable-code
4144 @opindex Wunreachable-code
4145 @opindex Wno-unreachable-code
4146 Warn if the compiler detects that code will never be executed.
4147
4148 This option is intended to warn when the compiler detects that at
4149 least a whole line of source code will never be executed, because
4150 some condition is never satisfied or because it is after a
4151 procedure that never returns.
4152
4153 It is possible for this option to produce a warning even though there
4154 are circumstances under which part of the affected line can be executed,
4155 so care should be taken when removing apparently-unreachable code.
4156
4157 For instance, when a function is inlined, a warning may mean that the
4158 line is unreachable in only one inlined copy of the function.
4159
4160 This option is not made part of @option{-Wall} because in a debugging
4161 version of a program there is often substantial code which checks
4162 correct functioning of the program and is, hopefully, unreachable
4163 because the program does work.  Another common use of unreachable
4164 code is to provide behavior which is selectable at compile-time.
4165
4166 @item -Winline
4167 @opindex Winline
4168 @opindex Wno-inline
4169 Warn if a function can not be inlined and it was declared as inline.
4170 Even with this option, the compiler will not warn about failures to
4171 inline functions declared in system headers.
4172
4173 The compiler uses a variety of heuristics to determine whether or not
4174 to inline a function.  For example, the compiler takes into account
4175 the size of the function being inlined and the amount of inlining
4176 that has already been done in the current function.  Therefore,
4177 seemingly insignificant changes in the source program can cause the
4178 warnings produced by @option{-Winline} to appear or disappear.
4179
4180 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4181 @opindex Wno-invalid-offsetof
4182 @opindex Winvalid-offsetof
4183 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4184 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4185 to a non-POD type is undefined.  In existing C++ implementations,
4186 however, @samp{offsetof} typically gives meaningful results even when
4187 applied to certain kinds of non-POD types. (Such as a simple
4188 @samp{struct} that fails to be a POD type only by virtue of having a
4189 constructor.)  This flag is for users who are aware that they are
4190 writing nonportable code and who have deliberately chosen to ignore the
4191 warning about it.
4192
4193 The restrictions on @samp{offsetof} may be relaxed in a future version
4194 of the C++ standard.
4195
4196 @item -Wno-int-to-pointer-cast @r{(C and Objective-C only)}
4197 @opindex Wno-int-to-pointer-cast
4198 @opindex Wint-to-pointer-cast
4199 Suppress warnings from casts to pointer type of an integer of a
4200 different size.
4201
4202 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4203 @opindex Wno-pointer-to-int-cast
4204 @opindex Wpointer-to-int-cast
4205 Suppress warnings from casts from a pointer to an integer type of a
4206 different size.
4207
4208 @item -Winvalid-pch
4209 @opindex Winvalid-pch
4210 @opindex Wno-invalid-pch
4211 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4212 the search path but can't be used.
4213
4214 @item -Wlong-long
4215 @opindex Wlong-long
4216 @opindex Wno-long-long
4217 Warn if @samp{long long} type is used.  This is enabled by either
4218 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4219 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4220
4221 @item -Wvariadic-macros
4222 @opindex Wvariadic-macros
4223 @opindex Wno-variadic-macros
4224 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4225 alternate syntax when in pedantic ISO C99 mode.  This is default.
4226 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4227
4228 @item -Wvla
4229 @opindex Wvla
4230 @opindex Wno-vla
4231 Warn if variable length array is used in the code.
4232 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4233 the variable length array.
4234
4235 @item -Wvolatile-register-var
4236 @opindex Wvolatile-register-var
4237 @opindex Wno-volatile-register-var
4238 Warn if a register variable is declared volatile.  The volatile
4239 modifier does not inhibit all optimizations that may eliminate reads
4240 and/or writes to register variables.  This warning is enabled by
4241 @option{-Wall}.
4242
4243 @item -Wdisabled-optimization
4244 @opindex Wdisabled-optimization
4245 @opindex Wno-disabled-optimization
4246 Warn if a requested optimization pass is disabled.  This warning does
4247 not generally indicate that there is anything wrong with your code; it
4248 merely indicates that GCC's optimizers were unable to handle the code
4249 effectively.  Often, the problem is that your code is too big or too
4250 complex; GCC will refuse to optimize programs when the optimization
4251 itself is likely to take inordinate amounts of time.
4252
4253 @item -Wpointer-sign @r{(C and Objective-C only)}
4254 @opindex Wpointer-sign
4255 @opindex Wno-pointer-sign
4256 Warn for pointer argument passing or assignment with different signedness.
4257 This option is only supported for C and Objective-C@.  It is implied by
4258 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4259 @option{-Wno-pointer-sign}.
4260
4261 @item -Wstack-protector
4262 @opindex Wstack-protector
4263 @opindex Wno-stack-protector
4264 This option is only active when @option{-fstack-protector} is active.  It
4265 warns about functions that will not be protected against stack smashing.
4266
4267 @item -Wno-mudflap
4268 @opindex Wno-mudflap
4269 Suppress warnings about constructs that cannot be instrumented by
4270 @option{-fmudflap}.
4271
4272 @item -Woverlength-strings
4273 @opindex Woverlength-strings
4274 @opindex Wno-overlength-strings
4275 Warn about string constants which are longer than the ``minimum
4276 maximum'' length specified in the C standard.  Modern compilers
4277 generally allow string constants which are much longer than the
4278 standard's minimum limit, but very portable programs should avoid
4279 using longer strings.
4280
4281 The limit applies @emph{after} string constant concatenation, and does
4282 not count the trailing NUL@.  In C89, the limit was 509 characters; in
4283 C99, it was raised to 4095.  C++98 does not specify a normat