]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/c-family/c.opt
Implement C++20 P0388R4, DR 1307, and DR 330.
[thirdparty/gcc.git] / gcc / c-family / c.opt
CommitLineData
fef3106c 1; Options for the C, ObjC, C++ and ObjC++ front ends.
a5544970 2; Copyright (C) 2003-2019 Free Software Foundation, Inc.
fef3106c
NB
3;
4; This file is part of GCC.
5;
6; GCC is free software; you can redistribute it and/or modify it under
7; the terms of the GNU General Public License as published by the Free
9dcd6f09 8; Software Foundation; either version 3, or (at your option) any later
fef3106c 9; version.
c22cacf3 10;
fef3106c
NB
11; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12; WARRANTY; without even the implied warranty of MERCHANTABILITY or
13; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14; for more details.
c22cacf3 15;
fef3106c 16; You should have received a copy of the GNU General Public License
9dcd6f09
NC
17; along with GCC; see the file COPYING3. If not see
18; <http://www.gnu.org/licenses/>.
fef3106c 19
8abb6b22 20; See the GCC internals manual for a description of this file's format.
fef3106c 21
fef3106c
NB
22; Please try to keep this file in ASCII collating order.
23
be43ab4e
NB
24Language
25C
26
27Language
28ObjC
29
30Language
31C++
32
33Language
34ObjC++
35
e200444e
JM
36-all-warnings
37C ObjC C++ ObjC++ Warning Alias(Wall)
38
39-ansi
40C ObjC C++ ObjC++ Alias(ansi)
41
42-assert
43C ObjC C++ ObjC++ Separate Alias(A) MissingArgError(assertion missing after %qs)
44
45-assert=
46C ObjC C++ ObjC++ Joined Alias(A) MissingArgError(assertion missing after %qs)
47
48-comments
49C ObjC C++ ObjC++ Alias(C)
50
51-comments-in-macros
52C ObjC C++ ObjC++ Alias(CC)
53
54-define-macro
55C ObjC C++ ObjC++ Separate Alias(D) MissingArgError(macro name missing after %qs)
56
57-define-macro=
58C ObjC C++ ObjC++ Joined Alias(D) MissingArgError(macro name missing after %qs)
59
60-dependencies
61C ObjC C++ ObjC++ Alias(M)
62
63-dump
64C ObjC C++ ObjC++ Separate Alias(d)
65
66-dump=
67C ObjC C++ ObjC++ Joined Alias(d)
68
69-imacros
70C ObjC C++ ObjC++ Separate Alias(imacros) MissingArgError(missing filename after %qs)
71
72-imacros=
73C ObjC C++ ObjC++ Joined Alias(imacros) MissingArgError(missing filename after %qs)
74
75-include
76C ObjC C++ ObjC++ Separate Alias(include) MissingArgError(missing filename after %qs)
77
78-include=
79C ObjC C++ ObjC++ Joined Alias(include) MissingArgError(missing filename after %qs)
80
81-include-barrier
82C ObjC C++ ObjC++ Alias(I, -)
83
84-include-directory
85C ObjC C++ ObjC++ Separate Alias(I) MissingArgError(missing path after %qs)
86
87-include-directory=
88C ObjC C++ ObjC++ Joined Alias(I) MissingArgError(missing path after %qs)
89
90-include-directory-after
91C ObjC C++ ObjC++ Separate Alias(idirafter) MissingArgError(missing path after %qs)
92
93-include-directory-after=
94C ObjC C++ ObjC++ Joined Alias(idirafter) MissingArgError(missing path after %qs)
95
96-include-prefix
97C ObjC C++ ObjC++ Separate Alias(iprefix)
98
99-include-prefix=
100C ObjC C++ ObjC++ JoinedOrMissing Alias(iprefix)
101
102-include-with-prefix
103C ObjC C++ ObjC++ Separate Alias(iwithprefix)
104
105-include-with-prefix=
106C ObjC C++ ObjC++ JoinedOrMissing Alias(iwithprefix)
107
108-include-with-prefix-after
109C ObjC C++ ObjC++ Separate Alias(iwithprefix)
110
111-include-with-prefix-after=
112C ObjC C++ ObjC++ JoinedOrMissing Alias(iwithprefix)
113
114-include-with-prefix-before
115C ObjC C++ ObjC++ Separate Alias(iwithprefixbefore)
116
117-include-with-prefix-before=
118C ObjC C++ ObjC++ JoinedOrMissing Alias(iwithprefixbefore)
119
120-no-integrated-cpp
121Driver Alias(no-integrated-cpp)
122
123-no-line-commands
124C ObjC C++ ObjC++ Alias(P)
125
126-no-standard-includes
127C ObjC C++ ObjC++ Alias(nostdinc)
128
129-no-warnings
130C ObjC C++ ObjC++ Alias(w)
131
132-output
133C ObjC C++ ObjC++ Separate Alias(o)
134
135-output=
136C ObjC C++ ObjC++ Joined Alias(o)
137
fef3106c
NB
138-output-pch=
139C ObjC C++ ObjC++ Joined Separate
140
e200444e
JM
141-pedantic
142C ObjC C++ ObjC++ Alias(pedantic)
143
e200444e
JM
144-preprocess
145C ObjC C++ ObjC++ Undocumented Alias(E)
146
147-print-missing-file-dependencies
148C ObjC C++ ObjC++ Alias(MG)
149
150-trace-includes
151C ObjC C++ ObjC++ Alias(H)
152
153-traditional
154Driver Alias(traditional)
155
156-traditional-cpp
157C ObjC C++ ObjC++ Alias(traditional-cpp)
158
159-trigraphs
160C ObjC C++ ObjC++ Alias(trigraphs)
161
162-undefine-macro
163C ObjC C++ ObjC++ Separate Alias(U) MissingArgError(macro name missing after %qs)
164
165-undefine-macro=
166C ObjC C++ ObjC++ Joined Alias(U) MissingArgError(macro name missing after %qs)
167
168-user-dependencies
169C ObjC C++ ObjC++ Alias(MM)
170
171-verbose
172Common C ObjC C++ ObjC++ Alias(v)
173
174-write-dependencies
175C ObjC C++ ObjC++ NoDriverArg Separate Alias(MD) MissingArgError(missing filename after %qs)
176
177-write-user-dependencies
178C ObjC C++ ObjC++ NoDriverArg Separate Alias(MMD) MissingArgError(missing filename after %qs)
179
fef3106c 180A
61ff2bdc 181C ObjC C++ ObjC++ Joined Separate MissingArgError(assertion missing after %qs)
a7b2e184 182-A<question>=<answer> Assert the <answer> to <question>. Putting '-' before <question> disables the <answer> to <question>.
fef3106c
NB
183
184C
185C ObjC C++ ObjC++
a7b2e184 186Do not discard comments.
fef3106c
NB
187
188CC
189C ObjC C++ ObjC++
a7b2e184 190Do not discard comments in macro expansions.
fef3106c
NB
191
192D
61ff2bdc 193C ObjC C++ ObjC++ Joined Separate MissingArgError(macro name missing after %qs)
a7b2e184 194-D<macro>[=<val>] Define a <macro> with <val> as its value. If just <macro> is given, <val> is taken to be 1.
fef3106c
NB
195
196E
5498f011 197C ObjC C++ ObjC++ Undocumented Var(flag_preprocess_only)
fef3106c 198
94d1613b 199F
bd837408 200Driver C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
a7b2e184 201-F <dir> Add <dir> to the end of the main framework include path.
94d1613b 202
1ee62b92
PG
203fgimple
204C Var(flag_gimple) Init(0)
205Enable parsing GIMPLE.
206
fef3106c
NB
207H
208C ObjC C++ ObjC++
a7b2e184 209Print the name of header files as they are used.
fef3106c
NB
210
211I
61ff2bdc 212C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
a7b2e184 213-I <dir> Add <dir> to the end of the main include path.
fef3106c
NB
214
215M
216C ObjC C++ ObjC++
a7b2e184 217Generate make dependencies.
fef3106c 218
c878765b
JM
219MD
220C ObjC C++ ObjC++ NoDriverArg Separate MissingArgError(missing filename after %qs)
a7b2e184 221Generate make dependencies and compile.
fef3106c
NB
222
223MF
61ff2bdc 224C ObjC C++ ObjC++ Joined Separate MissingArgError(missing filename after %qs)
a7b2e184 225-MF <file> Write dependency output to the given file.
fef3106c
NB
226
227MG
228C ObjC C++ ObjC++
a7b2e184 229Treat missing header files as generated files.
fef3106c
NB
230
231MM
232C ObjC C++ ObjC++
a7b2e184 233Like -M but ignore system header files.
fef3106c 234
c878765b
JM
235MMD
236C ObjC C++ ObjC++ NoDriverArg Separate MissingArgError(missing filename after %qs)
a7b2e184 237Like -MD but ignore system header files.
fef3106c
NB
238
239MP
240C ObjC C++ ObjC++
a7b2e184 241Generate phony targets for all headers.
fef3106c
NB
242
243MQ
61ff2bdc 244C ObjC C++ ObjC++ Joined Separate MissingArgError(missing makefile target after %qs)
a7b2e184 245-MQ <target> Add a MAKE-quoted target.
fef3106c
NB
246
247MT
61ff2bdc 248C ObjC C++ ObjC++ Joined Separate MissingArgError(missing makefile target after %qs)
a7b2e184 249-MT <target> Add an unquoted target.
fef3106c
NB
250
251P
252C ObjC C++ ObjC++
a7b2e184 253Do not generate #line directives.
fef3106c
NB
254
255U
61ff2bdc 256C ObjC C++ ObjC++ Joined Separate MissingArgError(macro name missing after %qs)
a7b2e184 257-U<macro> Undefine <macro>.
fef3106c
NB
258
259Wabi
d7f09764 260C ObjC C++ ObjC++ LTO Var(warn_abi) Warning
a7b2e184 261Warn about things that will change when compiling with an ABI-compliant compiler.
fef3106c 262
62984918
JM
263Wabi=
264C ObjC C++ ObjC++ LTO Joined RejectNegative UInteger Warning
a7b2e184 265Warn about things that change between the current -fabi-version and the specified version.
62984918 266
7dbb85a7
JM
267Wabi-tag
268C++ ObjC++ Var(warn_abi_tag) Warning
a7b2e184 269Warn if a subobject has an abi_tag attribute that the complete object type does not have.
7dbb85a7 270
bce08d50 271Wpsabi
50b15873 272C ObjC C++ ObjC++ LTO Var(warn_psabi) Init(1) Warning Undocumented LangEnabledBy(C ObjC C++ ObjC++,Wabi)
bce08d50 273
80c6d1f4
MJ
274Wabsolute-value
275C ObjC Var(warn_absolute_value) Warning EnabledBy(Wextra)
276Warn on suspicious calls of standard functions computing absolute values.
277
c116cd05 278Waddress
4a0ae68e 279C ObjC C++ ObjC++ Var(warn_address) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 280Warn about suspicious uses of memory addresses.
c116cd05 281
af63ba4b
JM
282Enum
283Name(warn_aligned_new_level) Type(int) UnknownError(argument %qs to %<-Waligned-new%> not recognized)
284
285EnumValue
286Enum(warn_aligned_new_level) String(none) Value(0)
287
288EnumValue
289Enum(warn_aligned_new_level) String(global) Value(1)
290
291EnumValue
292Enum(warn_aligned_new_level) String(all) Value(2)
293
294Waligned-new
295C++ ObjC++ Alias(Waligned-new=,global,none)
296Warn about 'new' of type with extended alignment without -faligned-new.
297
298Waligned-new=
2e1c20b1 299C++ ObjC++ Var(warn_aligned_new) Enum(warn_aligned_new_level) Joined RejectNegative Warning LangEnabledBy(C++ ObjC++,Wall,1,0)
6a825afe 300-Waligned-new=[none|global|all] Warn even if 'new' uses a class member allocation function.
af63ba4b 301
fef3106c 302Wall
c662432e 303C ObjC C++ ObjC++ Warning
a7b2e184 304Enable most warning messages.
fef3106c 305
adc577c5
AH
306Walloca
307C ObjC C++ ObjC++ Var(warn_alloca) Warning
308Warn on any use of alloca.
309
8bd9f164 310Walloc-size-larger-than=
00abf86c 311C ObjC C++ LTO ObjC++ Var(warn_alloc_size_limit) Joined Host_Wide_Int ByteSize Warning Init(HOST_WIDE_INT_MAX)
8bd9f164
MS
312-Walloc-size-larger-than=<bytes> Warn for calls to allocation functions that
313attempt to allocate objects larger than the specified number of bytes.
314
d258f4aa 315Wno-alloc-size-larger-than
00abf86c 316C ObjC C++ LTO ObjC++ Alias(Walloc-size-larger-than=,18446744073709551615EiB,none) Warning
d258f4aa
MS
317-Wno-alloc-size-larger-than Disable Walloc-size-larger-than= warning. Equivalent to Walloc-size-larger-than=<SIZE_MAX> or larger.
318
8bd9f164
MS
319Walloc-zero
320C ObjC C++ ObjC++ Var(warn_alloc_zero) Warning
321-Walloc-zero Warn for calls to allocation functions that specify zero bytes.
322
adc577c5 323Walloca-larger-than=
00abf86c 324C ObjC C++ LTO ObjC++ Var(warn_alloca_limit) Warning Joined Host_Wide_Int ByteSize Init(HOST_WIDE_INT_MAX)
9453ba0a 325-Walloca-larger-than=<number> Warn on unbounded uses of
adc577c5
AH
326alloca, and on bounded uses of alloca whose bound can be larger than
327<number> bytes.
328
00abf86c
MS
329Wno-alloca-larger-than
330C ObjC C++ LTO ObjC++ Alias(Walloca-larger-than=,18446744073709551615EiB,none) Warning
331-Wno-alloca-larger-than Disable Walloca-larger-than= warning. Equivalent to Walloca-larger-than=<SIZE_MAX> or larger.
332
34a180a6 333Warray-bounds
0d7f9065 334LangEnabledBy(C ObjC C++ LTO ObjC++)
34a180a6
MLI
335; in common.opt
336
de1b5c17 337Warray-bounds=
cea71f0a 338LangEnabledBy(C ObjC C++ LTO ObjC++,Wall,1,0)
de1b5c17
MU
339; in common.opt
340
6e955430 341Wassign-intercept
c662432e 342ObjC ObjC++ Var(warn_assign_intercept) Warning
a7b2e184 343Warn whenever an Objective-C assignment is being intercepted by the garbage collector.
6e955430 344
fef3106c 345Wbad-function-cast
c662432e 346C ObjC Var(warn_bad_function_cast) Warning
a7b2e184 347Warn about casting functions to incompatible types.
fef3106c 348
04159acf
MP
349Wbool-compare
350C ObjC C++ ObjC++ Var(warn_bool_compare) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 351Warn about boolean expression compared with an integer value different from true/false.
04159acf 352
9a2300e9
MP
353Wbool-operation
354C ObjC C++ ObjC++ Var(warn_bool_op) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
355Warn about certain operations on boolean expressions.
356
8423e57c
MS
357Wframe-address
358C ObjC C++ ObjC++ Var(warn_frame_address) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 359Warn when __builtin_frame_address or __builtin_return_address is used unsafely.
8423e57c 360
48330c93
BE
361Wbuiltin-declaration-mismatch
362C ObjC C++ ObjC++ Var(warn_builtin_declaraion_mismatch) Init(1) Warning
363Warn when a built-in function is declared with the wrong signature.
364
c047ce93 365Wbuiltin-macro-redefined
b559c810 366C ObjC C++ ObjC++ CPP(warn_builtin_macro_redefined) CppReason(CPP_W_BUILTIN_MACRO_REDEFINED) Var(cpp_warn_builtin_macro_redefined) Init(1) Warning
a7b2e184 367Warn when a built-in preprocessor macro is undefined or redefined.
c047ce93 368
9f936c86
JM
369Wc11-c2x-compat
370C ObjC Var(warn_c11_c2x_compat) Init(-1) Warning
371Warn about features not present in ISO C11, but present in ISO C2X.
372
f3bede71 373Wc90-c99-compat
b559c810 374C ObjC CPP(cpp_warn_c90_c99_compat) CppReason(CPP_W_C90_C99_COMPAT) Var(warn_c90_c99_compat) Init(-1) Warning
a7b2e184 375Warn about features not present in ISO C90, but present in ISO C99.
f3bede71 376
35aff4fb
MP
377Wc99-c11-compat
378C ObjC Var(warn_c99_c11_compat) Init(-1) Warning
a7b2e184 379Warn about features not present in ISO C99, but present in ISO C11.
35aff4fb 380
b7e20b53 381Wc++-compat
b559c810 382C ObjC Var(warn_cxx_compat) CPP(warn_cxx_operator_names) CppReason(CPP_W_CXX_OPERATOR_NAMES) Init(0) Warning
a7b2e184 383Warn about C constructs that are not in the common subset of C and C++.
b7e20b53 384
e1f1ee86 385Wc++0x-compat
765189ff 386C++ ObjC++ Warning Alias(Wc++11-compat) Undocumented
97e3ad20
JM
387
388Wc++11-compat
765189ff 389C++ ObjC++ Var(warn_cxx11_compat) Warning LangEnabledBy(C++ ObjC++,Wall) Init(0) CPP(cpp_warn_cxx11_compat) CppReason(CPP_W_CXX11_COMPAT)
a7b2e184 390Warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++ 2011.
b7e20b53 391
20b06add
JM
392Wc++14-compat
393C++ ObjC++ Var(warn_cxx14_compat) Warning LangEnabledBy(C++ ObjC++,Wall)
a7b2e184 394Warn about C++ constructs whose meaning differs between ISO C++ 2011 and ISO C++ 2014.
20b06add 395
51dc6603 396Wc++1z-compat
7b936140 397C++ ObjC++ Warning Alias(Wc++17-compat) Undocumented
51dc6603
JM
398
399Wc++17-compat
7b936140
JJ
400C++ ObjC++ Var(warn_cxx17_compat) Warning LangEnabledBy(C++ ObjC++,Wall)
401Warn about C++ constructs whose meaning differs between ISO C++ 2014 and ISO C++ 2017.
51dc6603 402
4742dbe7
MP
403Wc++2a-compat
404C++ ObjC++ Warning Alias(Wc++20-compat) Undocumented
405
406Wc++20-compat
407C++ ObjC++ Var(warn_cxx20_compat) Warning LangEnabledBy(C++ ObjC++,Wall)
408Warn about C++ constructs whose meaning differs between ISO C++ 2017 and ISO C++ 2020.
409
c65e18d3
BE
410Wcast-function-type
411C ObjC C++ ObjC++ Var(warn_cast_function_type) Warning EnabledBy(Wextra)
412Warn about casts between incompatible function types.
413
fef3106c 414Wcast-qual
c662432e 415C ObjC C++ ObjC++ Var(warn_cast_qual) Warning
a7b2e184 416Warn about casts which discard qualifiers.
fef3106c 417
3fa4634c
VR
418Wcatch-value
419C++ ObjC++ Warning Alias(Wcatch-value=, 1, 0)
420Warn about catch handlers of non-reference type.
421
63dbcd13 422Wcatch-value=
b22dbd03 423C++ ObjC++ Var(warn_catch_value) Warning Joined RejectNegative UInteger LangEnabledBy(C++ ObjC++,Wall, 1, 0) IntegerRange(0, 3)
63dbcd13
VR
424Warn about catch handlers of non-reference type.
425
fef3106c 426Wchar-subscripts
4a0ae68e 427C ObjC C++ ObjC++ Var(warn_char_subscripts) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 428Warn about subscripts whose type is \"char\".
fef3106c 429
d5e254e1 430Wchkp
68a57628 431C ObjC C++ ObjC++ Warning WarnRemoved
f48ef52e 432Removed in GCC 9. This switch has no effect.
d5e254e1 433
2b001724 434Wclobbered
95744782 435C ObjC C++ ObjC++ Var(warn_clobbered) Warning EnabledBy(Wextra)
a7b2e184 436Warn about variables that might be changed by \"longjmp\" or \"vfork\".
2b001724 437
ab574db6
MP
438Wcomma-subscript
439C++ ObjC++ Var(warn_comma_subscript) Warning
440Warn about uses of a comma operator within a subscripting expression.
441
fef3106c 442Wcomment
b559c810 443C ObjC C++ ObjC++ CPP(warn_comments) CppReason(CPP_W_COMMENTS) Var(cpp_warn_comment) Init(0) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 444Warn about possibly nested block comments, and C++ comments spanning more than one physical line.
fef3106c
NB
445
446Wcomments
5de8299c 447C ObjC C++ ObjC++ Warning Alias(Wcomment)
a7b2e184 448Synonym for -Wcomment.
fef3106c 449
dfeadaa0
PC
450Wconditionally-supported
451C++ ObjC++ Var(warn_conditionally_supported) Warning
a7b2e184 452Warn for conditionally-supported constructs.
dfeadaa0 453
fef3106c 454Wconversion
c662432e 455C ObjC C++ ObjC++ Var(warn_conversion) Warning
a7b2e184 456Warn for implicit type conversions that may change a value.
fef3106c 457
17251338
MLI
458Wconversion-null
459C++ ObjC++ Var(warn_conversion_null) Init(1) Warning
a7b2e184 460Warn for converting NULL from/to a non-pointer type.
17251338 461
b559c810
MLI
462Wcpp
463C ObjC C++ ObjC++ CppReason(CPP_W_WARNING_DIRECTIVE)
464; Documented in common.opt
465
fef3106c 466Wctor-dtor-privacy
c662432e 467C++ ObjC++ Var(warn_ctor_dtor_privacy) Warning
a7b2e184 468Warn when all constructors and destructors are private.
deef7113
MP
469
470Wdangling-else
471C ObjC C++ ObjC++ Var(warn_dangling_else) Warning LangEnabledBy(C ObjC C++ ObjC++,Wparentheses)
472Warn about dangling else.
fef3106c 473
b559c810
MLI
474Wdate-time
475C ObjC C++ ObjC++ CPP(warn_date_time) CppReason(CPP_W_DATE_TIME) Var(cpp_warn_date_time) Init(0) Warning
a7b2e184 476Warn about __TIME__, __DATE__ and __TIMESTAMP__ usage.
b559c810 477
85617eba 478Wdeclaration-after-statement
177cce46 479C ObjC Var(warn_declaration_after_statement) Init(-1) Warning
a7b2e184 480Warn when a declaration is found after a statement.
85617eba 481
c9b0866a
PC
482Wdelete-incomplete
483C++ ObjC++ Var(warn_delete_incomplete) Init(1) Warning
a7b2e184 484Warn when deleting a pointer to incomplete type.
c9b0866a 485
014ab419 486Wdelete-non-virtual-dtor
27e51192 487C++ ObjC++ Var(warn_delnonvdtor) Warning LangEnabledBy(C++ ObjC++,Wall || Weffc++)
a7b2e184 488Warn about deleting polymorphic objects with non-virtual destructors.
014ab419 489
fef3106c 490Wdeprecated
99063eee
RS
491C C++ ObjC ObjC++ CPP(cpp_warn_deprecated) CppReason(CPP_W_DEPRECATED)
492; Documented in common.opt
fef3106c 493
b46b715d 494Wdeprecated-copy
5c8b3702
JM
495C++ ObjC++ Var(warn_deprecated_copy) Warning LangEnabledBy(C++ ObjC++, Wextra)
496Mark implicitly-declared copy operations as deprecated if the class has a
497user-provided copy operation.
498
499Wdeprecated-copy-dtor
500C++ ObjC++ Var(warn_deprecated_copy, 2) Warning
b46b715d
JM
501Mark implicitly-declared copy operations as deprecated if the class has a
502user-provided copy operation or destructor.
503
976d5a22
TT
504Wdesignated-init
505C ObjC Var(warn_designated_init) Init(1) Warning
a7b2e184 506Warn about positional initialization of structs requiring designated initializers.
976d5a22 507
768952be
MU
508Wdiscarded-array-qualifiers
509C ObjC Var(warn_discarded_array_qualifiers) Init(1) Warning
a7b2e184 510Warn if qualifiers on arrays which are pointer targets are discarded.
768952be 511
d00887e8
MP
512Wdiscarded-qualifiers
513C ObjC Var(warn_discarded_qualifiers) Init(1) Warning
a7b2e184 514Warn if type qualifiers on pointers are discarded.
d00887e8 515
fef3106c 516Wdiv-by-zero
2cbac420 517C ObjC C++ ObjC++ Var(warn_div_by_zero) Init(1) Warning
a7b2e184 518Warn about compile-time integer division by zero.
fef3106c 519
2ebd93e1
MP
520Wduplicated-branches
521C ObjC C++ ObjC++ Var(warn_duplicated_branches) Init(0) Warning
522Warn about duplicated branches in if-else statements.
523
3e3b8d63 524Wduplicated-cond
12651878 525C ObjC C++ ObjC++ Var(warn_duplicated_cond) Init(0) Warning
a7b2e184 526Warn about duplicated conditions in an if-else-if chain.
3e3b8d63 527
fef3106c 528Weffc++
c662432e 529C++ ObjC++ Var(warn_ecpp) Warning
a7b2e184 530Warn about violations of Effective C++ style rules.
fef3106c 531
b3b433c5 532Wempty-body
95744782 533C ObjC C++ ObjC++ Var(warn_empty_body) Warning EnabledBy(Wextra)
a7b2e184 534Warn about an empty body in an if or else statement.
b3b433c5 535
fef3106c 536Wendif-labels
b559c810 537C ObjC C++ ObjC++ CPP(warn_endif_labels) CppReason(CPP_W_ENDIF_LABELS) Var(cpp_warn_endif_labels) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wpedantic)
f6a7a9d5 538Warn about stray tokens after #else and #endif.
fef3106c 539
a3299096 540Wenum-compare
27e51192 541C ObjC C++ ObjC++ Var(warn_enum_compare) Init(-1) Warning LangEnabledBy(C ObjC,Wall || Wc++-compat)
a7b2e184 542Warn about comparison of different enum types.
a3299096 543
68e2c199
PK
544Wenum-conversion
545C ObjC Var(warn_enum_conversion) Init(0) Warning LangEnabledBy(C ObjC,Wextra)
546Warn about implicit conversion of enum types.
547
fef3106c
NB
548Werror
549C ObjC C++ ObjC++
72de27ea 550; Documented in common.opt
fef3106c
NB
551
552Werror-implicit-function-declaration
5de8299c 553C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration)
a7b2e184 554This switch is deprecated; use -Werror=implicit-function-declaration instead.
fef3106c 555
70f6d5e1
JJ
556Wextra
557C ObjC C++ ObjC++ Warning
558; in common.opt
559
c3cbcd45
VR
560Wextra-semi
561C++ ObjC++ Var(warn_extra_semi) Warning
562Warn about semicolon after in-class function definition.
563
49b0aa18 564Wfloat-conversion
63bbf46d 565C ObjC C++ ObjC++ Var(warn_float_conversion) Warning LangEnabledBy(C ObjC C++ ObjC++,Wconversion)
a7b2e184 566Warn for implicit type conversions that cause loss of floating point precision.
49b0aa18 567
fef3106c 568Wfloat-equal
c662432e 569C ObjC C++ ObjC++ Var(warn_float_equal) Warning
a7b2e184 570Warn if testing floating point numbers for equality.
fef3106c
NB
571
572Wformat
7332899a 573C ObjC C++ ObjC++ Warning Alias(Wformat=, 1, 0)
a7b2e184 574Warn about printf/scanf/strftime/strfmon format string anomalies.
fef3106c 575
7332899a
MLI
576Wformat-contains-nul
577C ObjC C++ ObjC++ Var(warn_format_contains_nul) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 1, 0)
a7b2e184 578Warn about format strings that contain NUL bytes.
7332899a 579
a9c697b8
MS
580Wformat-diag
581C ObjC C++ ObjC++ Var(warn_format_diag) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 1, 0)
36b34127 582Warn about GCC format strings with strings unsuitable for diagnostics.
a9c697b8 583
fef3106c 584Wformat-extra-args
7332899a 585C ObjC C++ ObjC++ Var(warn_format_extra_args) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 1, 0)
a7b2e184 586Warn if passing too many arguments to a function for its format string.
fef3106c
NB
587
588Wformat-nonliteral
7332899a 589C ObjC C++ ObjC++ Var(warn_format_nonliteral) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
a7b2e184 590Warn about format strings that are not literals.
fef3106c 591
bce6f760 592Wformat-overflow
63010089 593C ObjC C++ LTO ObjC++ Warning Alias(Wformat-overflow=, 1, 0) IntegerRange(0, 2)
bce6f760
MS
594Warn about function calls with format strings that write past the end
595of the destination region. Same as -Wformat-overflow=1.
596
fef3106c 597Wformat-security
7332899a 598C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
a7b2e184 599Warn about possible security problems with format functions.
fef3106c 600
cbbd2b1c 601Wformat-signedness
7631f0e2 602C ObjC C++ ObjC++ Var(warn_format_signedness) Warning
a7b2e184 603Warn about sign differences with format functions.
cbbd2b1c 604
efcc8d38 605Wformat-truncation
bf5fbf46 606C ObjC C++ LTO ObjC++ Warning Alias(Wformat-truncation=, 1, 0)
efcc8d38
MS
607Warn about calls to snprintf and similar functions that truncate output.
608Same as -Wformat-truncation=1.
609
fef3106c 610Wformat-y2k
7332899a 611C ObjC C++ ObjC++ Var(warn_format_y2k) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=,warn_format >= 2, 0)
a7b2e184 612Warn about strftime formats yielding 2-digit years.
fef3106c
NB
613
614Wformat-zero-length
7332899a 615C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=,warn_format >= 1, 0)
a7b2e184 616Warn about zero-length formats.
fef3106c
NB
617
618Wformat=
63010089 619C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
a7b2e184 620Warn about printf/scanf/strftime/strfmon format string anomalies.
fef3106c 621
bce6f760 622Wformat-overflow=
cea71f0a 623C ObjC C++ LTO ObjC++ Joined RejectNegative UInteger Var(warn_format_overflow) Warning LangEnabledBy(C ObjC C++ LTO ObjC++,Wformat=, warn_format >= 1, 0) IntegerRange(0, 2)
88d0c3f0
MS
624Warn about function calls with format strings that write past the end
625of the destination region.
626
efcc8d38 627Wformat-truncation=
cea71f0a 628C ObjC C++ LTO ObjC++ Joined RejectNegative UInteger Var(warn_format_trunc) Warning LangEnabledBy(C ObjC C++ LTO ObjC++,Wformat=, warn_format >= 1, 0) IntegerRange(0, 2)
efcc8d38
MS
629Warn about calls to snprintf and similar functions that truncate output.
630
00aa1fa2
L
631Wif-not-aligned
632C ObjC C++ ObjC++ Var(warn_if_not_aligned) Init(1) Warning
633Warn when the field in a struct is not aligned.
634
5db2e9ca 635Wignored-qualifiers
95744782 636C C++ Var(warn_ignored_qualifiers) Warning EnabledBy(Wextra)
5db2e9ca
DK
637Warn whenever type qualifiers are ignored.
638
fbdb6baf
MP
639Wignored-attributes
640C C++ Var(warn_ignored_attributes) Init(1) Warning
641Warn whenever attributes are ignored.
642
d3786ebb
MB
643Winaccessible-base
644C++ ObjC++ Var(warn_inaccessible_base) Init(1) Warning
645Warn when a base is inaccessible in derived due to ambiguity.
646
d5c3d343
MP
647Wincompatible-pointer-types
648C ObjC Var(warn_incompatible_pointer_types) Init(1) Warning
a7b2e184 649Warn when there is a conversion between pointers that have incompatible types.
d5c3d343 650
da77eace
L
651Waddress-of-packed-member
652C ObjC C++ ObjC++ Var(warn_address_of_packed_member) Init(1) Warning
653Warn when the address of packed member of struct or union is taken.
654
3390f9c9 655Winit-self
0ccb505d 656C ObjC C++ ObjC++ Var(warn_init_self) Warning LangEnabledBy(C++ ObjC++,Wall)
a7b2e184 657Warn about variables which are initialized to themselves.
3390f9c9 658
04eb9c55
JM
659Winit-list-lifetime
660C++ ObjC++ Var(warn_init_list) Warning Init(1)
661Warn about uses of std::initializer_list that can result in dangling pointers.
662
fef3106c 663Wimplicit
4a0ae68e 664C ObjC Var(warn_implicit) Warning LangEnabledBy(C ObjC,Wall)
a7b2e184 665Warn about implicit declarations.
fef3106c 666
70f6d5e1
JJ
667Wimplicit-fallthrough=
668LangEnabledBy(C ObjC C++ ObjC++,Wextra,3,0)
669; in common.opt
670
0a0b3574
MM
671Wdouble-promotion
672C ObjC C++ ObjC++ Var(warn_double_promotion) Warning
a7b2e184 673Warn about implicit conversions from \"float\" to \"double\".
0a0b3574 674
fb2675cb
PB
675Wexpansion-to-defined
676C ObjC C++ ObjC++ CPP(warn_expansion_to_defined) CppReason(CPP_W_EXPANSION_TO_DEFINED) Var(cpp_warn_expansion_to_defined) Init(0) Warning EnabledBy(Wextra || Wpedantic)
677Warn if \"defined\" is used outside #if.
678
fef3106c 679Wimplicit-function-declaration
4a0ae68e 680C ObjC Var(warn_implicit_function_declaration) Init(-1) Warning LangEnabledBy(C ObjC,Wimplicit)
a7b2e184 681Warn about implicit function declarations.
fef3106c
NB
682
683Wimplicit-int
92574c7c 684C ObjC Var(warn_implicit_int) Init(-1) Warning LangEnabledBy(C ObjC,Wimplicit)
a7b2e184 685Warn when a declaration does not specify a type.
fef3106c
NB
686
687Wimport
2d2bd949 688C ObjC C++ ObjC++ Undocumented Ignore
fef3106c 689
4514a96b
JM
690Winherited-variadic-ctor
691C++ ObjC++ Var(warn_inh_var_ctor) Init(1) Warning
a7b2e184 692Warn about C++11 inheriting constructors when the base has a variadic constructor.
4514a96b 693
52ec0ea3
MP
694Wint-conversion
695C ObjC Var(warn_int_conversion) Init(1) Warning
a7b2e184 696Warn about incompatible integer to pointer and pointer to integer conversions.
52ec0ea3 697
144a96e4
BE
698Wint-in-bool-context
699C ObjC C++ ObjC++ Var(warn_int_in_bool_context) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
700Warn for suspicious integer expressions in boolean context.
701
53a2494e 702Wint-to-pointer-cast
dc8d2739 703C ObjC C++ ObjC++ Var(warn_int_to_pointer_cast) Init(1) Warning
a7b2e184 704Warn when there is a cast to a pointer from an integer of a different size.
53a2494e 705
fef3106c 706Winvalid-offsetof
c662432e 707C++ ObjC++ Var(warn_invalid_offsetof) Init(1) Warning
a7b2e184 708Warn about invalid uses of the \"offsetof\" macro.
fef3106c
NB
709
710Winvalid-pch
b559c810 711C ObjC C++ ObjC++ CPP(warn_invalid_pch) CppReason(CPP_W_INVALID_PCH) Var(cpp_warn_invalid_pch) Init(0) Warning
a7b2e184 712Warn about PCH files that are found but not used.
fef3106c 713
e1b7793c 714Wjump-misses-init
f2bc201f 715C ObjC Var(warn_jump_misses_init) Warning LangEnabledby(C ObjC,Wc++-compat)
a7b2e184 716Warn when a jump misses a variable initialization.
e1b7793c 717
7f5f5f98 718Wliteral-suffix
b559c810 719C++ ObjC++ CPP(warn_literal_suffix) CppReason(CPP_W_LITERAL_SUFFIX) Var(cpp_warn_literal_suffix) Init(1) Warning
7f5f5f98
OW
720Warn when a string or character literal is followed by a ud-suffix which does not begin with an underscore.
721
ca409efd 722Wlogical-op
a7b2e184
MS
723C ObjC C++ ObjC++ Var(warn_logical_op) Init(0) Warning
724Warn when a logical operator is suspiciously always evaluating to true or false.
ca409efd 725
742938c9 726Wlogical-not-parentheses
d2e4feca 727C ObjC C++ ObjC++ Var(warn_logical_not_paren) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 728Warn when logical not is used on the left hand side operand of a comparison.
742938c9 729
fef3106c 730Wlong-long
b559c810 731C ObjC C++ ObjC++ CPP(cpp_warn_long_long) CppReason(CPP_W_LONG_LONG) Var(warn_long_long) Init(-1) Warning LangEnabledBy(C ObjC,Wc90-c99-compat)
a7b2e184 732Do not warn about using \"long long\" when -pedantic.
fef3106c
NB
733
734Wmain
34a180a6 735C ObjC C++ ObjC++ Var(warn_main) Init(-1) Warning LangEnabledBy(C ObjC,Wall, 2, 0)
a7b2e184 736Warn about suspicious declarations of \"main\".
fef3106c 737
34a180a6
MLI
738Wmain
739LangEnabledBy(C ObjC C++ ObjC++,Wpedantic, 2, 0)
740;
741
b108f48f
JJ
742Wmemset-transposed-args
743C ObjC C++ ObjC++ Var(warn_memset_transposed_args) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 744Warn about suspicious calls to memset where the third argument is constant literal zero and the second is not.
b108f48f 745
c1e1f433
BS
746Wmemset-elt-size
747C ObjC C++ ObjC++ Var(warn_memset_elt_size) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
748Warn about suspicious calls to memset where the third argument contains the number of elements not multiplied by the element size.
749
c3388e62 750Wmisleading-indentation
f6069ccc 751C C++ Common Var(warn_misleading_indentation) Warning LangEnabledBy(C C++,Wall)
a7b2e184 752Warn when the indentation of the code does not reflect the block structure.
c3388e62 753
fef3106c 754Wmissing-braces
4f7f7aca 755C ObjC C++ ObjC++ Var(warn_missing_braces) Warning LangEnabledBy(C ObjC,Wall)
a7b2e184 756Warn about possibly missing braces around initializers.
fef3106c
NB
757
758Wmissing-declarations
c662432e 759C ObjC C++ ObjC++ Var(warn_missing_declarations) Warning
a7b2e184 760Warn about global functions without previous declarations.
fef3106c 761
eaac4679 762Wmissing-field-initializers
95744782 763C ObjC C++ ObjC++ Var(warn_missing_field_initializers) Warning EnabledBy(Wextra)
a7b2e184 764Warn about missing fields in struct initializers.
eaac4679 765
3e2becc4
MP
766Wmultistatement-macros
767C ObjC C++ ObjC++ Var(warn_multistatement_macros) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
768Warn about unsafe macros expanding to multiple statements used as a body of a clause such as if, else, while, switch, or for.
769
6b333269
NS
770Wmultiple-inheritance
771C++ ObjC++ Var(warn_multiple_inheritance) Warning
a7b2e184 772Warn on direct multiple inheritance.
6b333269
NS
773
774Wnamespaces
775C++ ObjC++ Var(warn_namespaces) Warning
a7b2e184 776Warn on namespace definition.
6b333269 777
00aa1fa2
L
778Wpacked-not-aligned
779C ObjC C++ ObjC++ Var(warn_packed_not_aligned) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
780Warn when fields in a struct with the packed attribute are misaligned.
781
20b06add
JM
782Wsized-deallocation
783C++ ObjC++ Var(warn_sized_deallocation) Warning EnabledBy(Wextra)
a7b2e184 784Warn about missing sized deallocation functions.
20b06add 785
40ffd95f
BE
786Wsizeof-pointer-div
787C ObjC C++ ObjC++ Var(warn_sizeof_pointer_div) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
788Warn about suspicious divisions of two sizeof expressions that don't work correctly with pointers.
789
1a4049e7 790Wsizeof-pointer-memaccess
4a0ae68e 791C ObjC C++ ObjC++ Var(warn_sizeof_pointer_memaccess) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 792Warn about suspicious length parameters to certain string functions if the argument uses sizeof.
1a4049e7 793
773ec47f
MP
794Wsizeof-array-argument
795C ObjC C++ ObjC++ Var(warn_sizeof_array_argument) Warning Init(1)
a7b2e184 796Warn when sizeof is applied on a parameter declared as an array.
773ec47f 797
ee92e7ba 798Wstringop-overflow
cea71f0a 799C ObjC C++ LTO ObjC++ Warning Alias(Wstringop-overflow=, 2, 0)
ee92e7ba
MS
800Warn about buffer overflow in string manipulation functions like memcpy
801and strcpy.
802
803Wstringop-overflow=
cea71f0a 804C ObjC C++ LTO ObjC++ Joined RejectNegative UInteger Var(warn_stringop_overflow) Init(2) Warning LangEnabledBy(C ObjC C++ LTO ObjC++, Wall, 2, 0) IntegerRange(0, 4)
ee92e7ba
MS
805Under the control of Object Size type, warn about buffer overflow in string
806manipulation functions like memcpy and strcpy.
807
025d57f0 808Wstringop-truncation
cea71f0a 809C ObjC C++ LTO ObjC++ Var(warn_stringop_truncation) Warning Init (1) LangEnabledBy(C ObjC C++ LTO ObjC++, Wall)
025d57f0
MS
810Warn about truncation in string manipulation functions like strncat and strncpy.
811
90137d8f
MLI
812Wsuggest-attribute=format
813C ObjC C++ ObjC++ Var(warn_suggest_attribute_format) Warning
a7b2e184 814Warn about functions which might be candidates for format attributes.
fef3106c 815
2f42e5de
TS
816Wsuggest-override
817C++ ObjC++ Var(warn_override) Warning
818Suggest that the override keyword be used when the declaration of a virtual
819function overrides another.
820
34a180a6
MLI
821Wswitch
822C ObjC C++ ObjC++ Var(warn_switch) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 823Warn about enumerated switches, with no default, missing a case.
34a180a6
MLI
824
825Wswitch-default
826C ObjC C++ ObjC++ Var(warn_switch_default) Warning
a7b2e184 827Warn about enumerated switches missing a \"default:\" statement.
34a180a6
MLI
828
829Wswitch-enum
830C ObjC C++ ObjC++ Var(warn_switch_enum) Warning
a7b2e184 831Warn about all enumerated switches missing a specific case.
34a180a6 832
fedfecef 833Wswitch-bool
5c3d09f7 834C ObjC C++ ObjC++ Var(warn_switch_bool) Warning Init(1)
a7b2e184 835Warn about switches with boolean controlling expression.
fedfecef 836
da9e9b57
MB
837Wswitch-outside-range
838C ObjC C++ ObjC++ Var(warn_switch_outside_range) Warning Init(1)
839Warn about switch values that are outside of the switch's type range.
840
6b333269
NS
841Wtemplates
842C++ ObjC++ Var(warn_templates) Warning
a7b2e184 843Warn on primary template declaration.
6b333269 844
d4cfd486
MS
845Wmissing-attributes
846C ObjC C++ ObjC++ Var(warn_missing_attributes) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
847Warn about declarations of entities that may be missing attributes
d3a02ae5 848that related entities have been declared with.
d4cfd486 849
90137d8f 850Wmissing-format-attribute
54d62f51 851C ObjC C++ ObjC++ Warning Alias(Wsuggest-attribute=format)
90137d8f
MLI
852;
853
b02398bd 854Wmissing-include-dirs
b559c810 855C ObjC C++ ObjC++ CPP(warn_missing_include_dirs) CppReason(CPP_W_MISSING_INCLUDE_DIRS) Var(cpp_warn_missing_include_dirs) Init(0) Warning
a7b2e184 856Warn about user-specified include directories that do not exist.
b02398bd 857
cb4af25a 858Wmissing-parameter-type
95744782 859C ObjC Var(warn_missing_parameter_type) Warning EnabledBy(Wextra)
a7b2e184 860Warn about function parameters declared without a type specifier in K&R-style functions.
cb4af25a 861
fef3106c 862Wmissing-prototypes
c662432e 863C ObjC Var(warn_missing_prototypes) Warning
a7b2e184 864Warn about global functions without prototypes.
fef3106c 865
5720c0dc 866Wmudflap
68a57628 867C ObjC C++ ObjC++ WarnRemoved
5720c0dc 868
fef3106c 869Wmultichar
b559c810 870C ObjC C++ ObjC++ CPP(warn_multichar) CppReason(CPP_W_MULTICHAR) Var(cpp_warn_multichar) Init(0) Warning
a7b2e184 871Warn about use of multi-character character constants.
fef3106c 872
76f86d00 873Wnarrowing
765189ff 874C ObjC C++ ObjC++ Warning Var(warn_narrowing) Init(-1) LangEnabledBy(C++ ObjC++,Wall || Wc++11-compat)
a7b2e184 875Warn about narrowing conversions within { } that are ill-formed in C++11.
76f86d00 876
fef3106c 877Wnested-externs
c662432e 878C ObjC Var(warn_nested_externs) Warning
a7b2e184 879Warn about \"extern\" declarations not at file scope.
fef3106c 880
59f9c2ed
JM
881Wnoexcept
882C++ ObjC++ Var(warn_noexcept) Warning
a7b2e184 883Warn when a noexcept expression evaluates to false even though the expression can't actually throw.
59f9c2ed 884
108154ff 885Wnoexcept-type
7b936140
JJ
886C++ ObjC++ Warning Var(warn_noexcept_type) LangEnabledBy(C++ ObjC++,Wabi || Wc++17-compat)
887Warn if C++17 noexcept function type will change the mangled name of a symbol.
108154ff 888
fef3106c 889Wnon-template-friend
c662432e 890C++ ObjC++ Var(warn_nontemplate_friend) Init(1) Warning
a7b2e184 891Warn when non-templatized friend functions are declared within a template.
fef3106c 892
a599af84
MP
893Wclass-conversion
894C++ ObjC++ Var(warn_class_conversion) Init(1) Warning
895Warn when a conversion function will never be called due to the type it converts to.
896
c3684b7b
MS
897Wclass-memaccess
898C++ ObjC++ Var(warn_class_memaccess) Warning LangEnabledBy(C++ ObjC++, Wall)
899Warn for unsafe raw memory writes to objects of class types.
900
fef3106c 901Wnon-virtual-dtor
880a467b 902C++ ObjC++ Var(warn_nonvdtor) Warning LangEnabledBy(C++ ObjC++,Weffc++)
a7b2e184 903Warn about non-virtual destructors.
fef3106c
NB
904
905Wnonnull
cea71f0a 906C ObjC C++ LTO ObjC++ Var(warn_nonnull) Warning LangEnabledBy(C ObjC C++ LTO ObjC++,Wformat=,warn_format >= 1,0)
a7b2e184 907Warn about NULL being passed to argument slots marked as requiring non-NULL.
fef3106c 908
7332899a 909Wnonnull
cea71f0a 910C ObjC C++ LTO ObjC++ LangEnabledBy(C ObjC C++ LTO ObjC++,Wall)
7332899a
MLI
911;
912
bf14eba2
JJ
913Wnonnull-compare
914C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall)
915;
916
1ef33fd4 917Wnormalized
54d62f51 918C ObjC C++ ObjC++ Warning Alias(Wnormalized=,nfc,none)
1ef33fd4
MLI
919;
920
50668cf6 921Wnormalized=
b559c810 922C ObjC C++ ObjC++ RejectNegative Joined Warning CPP(warn_normalize) CppReason(CPP_W_NORMALIZE) Init(normalized_C) Var(cpp_warn_normalize) Enum(cpp_normalize_level)
54dcd526 923-Wnormalized=[none|id|nfc|nfkc] Warn about non-normalized Unicode strings.
1ef33fd4
MLI
924
925; Required for these enum values.
926SourceInclude
927cpplib.h
928
929Enum
930Name(cpp_normalize_level) Type(int) UnknownError(argument %qs to %<-Wnormalized%> not recognized)
931
932EnumValue
933Enum(cpp_normalize_level) String(none) Value(normalized_none)
934
935EnumValue
936Enum(cpp_normalize_level) String(nfkc) Value(normalized_KC)
937
938EnumValue
939Enum(cpp_normalize_level) String(id) Value(normalized_identifier_C)
940
941EnumValue
942Enum(cpp_normalize_level) String(nfc) Value(normalized_C)
50668cf6 943
fef3106c 944Wold-style-cast
c662432e 945C++ ObjC++ Var(warn_old_style_cast) Warning
a7b2e184 946Warn if a C-style cast is used in a program.
fef3106c 947
b1ed4cb4 948Wold-style-declaration
95744782 949C ObjC Var(warn_old_style_declaration) Warning EnabledBy(Wextra)
a7b2e184 950Warn for obsolescent usage in a declaration.
b1ed4cb4 951
c034f121 952Wold-style-definition
c662432e 953C ObjC Var(warn_old_style_definition) Warning
a7b2e184 954Warn if an old-style parameter definition is used.
c034f121 955
8b5e1202
SO
956Wopenmp-simd
957C C++ Var(warn_openmp_simd) Warning LangEnabledBy(C C++,Wall)
a7b2e184 958Warn if a simd directive is overridden by the vectorizer cost model.
8b5e1202 959
89a42ac8 960Woverlength-strings
34a180a6 961C ObjC C++ ObjC++ Var(warn_overlength_strings) Warning LangEnabledBy(C ObjC C++ ObjC++,Wpedantic)
a7b2e184 962Warn if a string is longer than the maximum portable length specified by the standard.
89a42ac8 963
fef3106c 964Woverloaded-virtual
c662432e 965C++ ObjC++ Var(warn_overloaded_virtual) Warning
a7b2e184 966Warn about overloaded virtual function names.
fef3106c 967
7ed322d7 968Woverride-init
95744782 969C ObjC Var(warn_override_init) Warning EnabledBy(Wextra)
a7b2e184 970Warn about overriding initializers without side effects.
7ed322d7 971
755e528f
MP
972Woverride-init-side-effects
973C ObjC Var(warn_override_init_side_effects) Init(1) Warning
a7b2e184 974Warn about overriding initializers with side effects.
755e528f 975
2cd36c22 976Wpacked-bitfield-compat
bee6fa6d 977C ObjC C++ ObjC++ Var(warn_packed_bitfield_compat) Init(-1) Warning
a7b2e184 978Warn about packed bit-fields whose offset changed in GCC 4.4.
2cd36c22 979
fef3106c 980Wparentheses
4a0ae68e 981C ObjC C++ ObjC++ Var(warn_parentheses) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 982Warn about possibly missing parentheses.
fef3106c 983
c1771a20 984Wpedantic
b559c810 985C ObjC C++ ObjC++ CPP(cpp_pedantic) CppReason(CPP_W_PEDANTIC) Warning
c1771a20
MLI
986; Documented in common.opt
987
79ca9c35
MP
988Wpessimizing-move
989C++ ObjC++ Var(warn_pessimizing_move) Warning LangEnabledBy(C++ ObjC++, Wall)
990Warn about calling std::move on a local object in a return statement preventing copy elision.
991
fef3106c 992Wpmf-conversions
c662432e 993C++ ObjC++ Var(warn_pmf2ptr) Init(1) Warning
a7b2e184 994Warn when converting the type of pointers to member functions.
fef3106c
NB
995
996Wpointer-arith
44d90fe1 997C ObjC C++ ObjC++ Var(warn_pointer_arith) Warning LangEnabledBy(C ObjC C++ ObjC++,Wpedantic)
a7b2e184 998Warn about function pointer arithmetic.
fef3106c 999
4a0ae68e 1000Wpointer-sign
27e51192 1001C ObjC Var(warn_pointer_sign) Warning LangEnabledBy(C ObjC,Wall || Wpedantic)
a7b2e184 1002Warn when a pointer differs in signedness in an assignment.
4a0ae68e 1003
a9342885
MP
1004Wpointer-compare
1005C ObjC C++ ObjC++ Var(warn_pointer_compare) Init(1) Warning
1006Warn when a pointer is compared with a zero character constant.
1007
53a2494e 1008Wpointer-to-int-cast
c662432e 1009C ObjC Var(warn_pointer_to_int_cast) Init(1) Warning
a7b2e184 1010Warn when a pointer is cast to an integer of a different size.
53a2494e 1011
b9b8dde3 1012Wpragmas
c662432e 1013C ObjC C++ ObjC++ Var(warn_pragmas) Init(1) Warning
a7b2e184 1014Warn about misuses of pragmas.
b9b8dde3 1015
8cff0652
VK
1016Wprio-ctor-dtor
1017C ObjC C++ ObjC++ Var(warn_prio_ctor_dtor) Init(1) Warning
1018Warn if constructor or destructors with priorities from 0 to 100 are used.
1019
9a179d01
NP
1020Wproperty-assign-default
1021ObjC ObjC++ Var(warn_property_assign_default) Init(1) Warning
a7b2e184 1022Warn if a property for an Objective-C object has no assign semantics specified.
9a179d01 1023
fef3106c 1024Wprotocol
c662432e 1025ObjC ObjC++ Var(warn_protocol) Init(1) Warning
a7b2e184 1026Warn if inherited methods are unimplemented.
fef3106c 1027
e2f5cc96 1028Wplacement-new
46cb9332
MS
1029C++ Warning Alias(Wplacement-new=, 1, 0)
1030Warn for placement new expressions with undefined behavior.
1031
1032Wplacement-new=
63010089 1033C++ Joined RejectNegative UInteger Var(warn_placement_new) Init(-1) Warning IntegerRange(0, 2)
eb11eb15 1034Warn for placement new expressions with undefined behavior.
e2f5cc96 1035
fef3106c 1036Wredundant-decls
c662432e 1037C ObjC C++ ObjC++ Var(warn_redundant_decls) Warning
a7b2e184 1038Warn about multiple declarations of the same object.
fef3106c 1039
b5be6d0c
MP
1040Wredundant-move
1041C++ ObjC++ Var(warn_redundant_move) Warning LangEnabledBy(C++ ObjC++,Wextra)
1042Warn about redundant calls to std::move.
1043
a2c6e7f2
JJ
1044Wregister
1045C++ ObjC++ Var(warn_register) Warning
1046Warn about uses of register storage specifier.
1047
fef3106c 1048Wreorder
f2bc201f 1049C++ ObjC++ Var(warn_reorder) Warning LangEnabledBy(C++ ObjC++,Wall)
a7b2e184 1050Warn when the compiler reorders code.
fef3106c
NB
1051
1052Wreturn-type
1b6fa695 1053C ObjC C++ ObjC++ Var(warn_return_type) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) Init(-1)
a7b2e184 1054Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++).
fef3106c 1055
ee45a32d
EB
1056Wscalar-storage-order
1057C ObjC C++ ObjC++ Init(1) Warning
1058Warn on suspicious constructs involving reverse scalar storage order.
1059
fef3106c 1060Wselector
c662432e 1061ObjC ObjC++ Var(warn_selector) Warning
a7b2e184 1062Warn if a selector has multiple methods.
fef3106c 1063
13c21655
PC
1064Wsequence-point
1065C ObjC C++ ObjC++ Var(warn_sequence_point) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 1066Warn about possible violations of sequence point rules.
13c21655 1067
dcaaa5a0 1068Wshadow-ivar
dff8943f 1069ObjC ObjC++ Var(warn_shadow_ivar) EnabledBy(Wshadow) Init(1) Warning
a7b2e184 1070Warn if a local declaration hides an instance variable.
dcaaa5a0 1071
451b5e48
MP
1072Wshift-overflow
1073C ObjC C++ ObjC++ Warning Alias(Wshift-overflow=, 1, 0)
a7b2e184 1074Warn if left shift of a signed value overflows.
451b5e48
MP
1075
1076Wshift-overflow=
63010089 1077C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_shift_overflow) Init(-1) Warning IntegerRange(0, 2)
a7b2e184 1078Warn if left shift of a signed value overflows.
451b5e48 1079
13c21655
PC
1080Wshift-count-negative
1081C ObjC C++ ObjC++ Var(warn_shift_count_negative) Init(1) Warning
a7b2e184 1082Warn if shift count is negative.
13c21655
PC
1083
1084Wshift-count-overflow
1085C ObjC C++ ObjC++ Var(warn_shift_count_overflow) Init(1) Warning
a7b2e184 1086Warn if shift count >= width of type.
fef3106c 1087
0173bd2a
MP
1088Wshift-negative-value
1089C ObjC C++ ObjC++ Var(warn_shift_negative_value) Init(-1) Warning
a7b2e184 1090Warn if left shifting a negative value.
0173bd2a 1091
fef3106c 1092Wsign-compare
4a0ae68e 1093C ObjC C++ ObjC++ Var(warn_sign_compare) Warning LangEnabledBy(C++ ObjC++,Wall)
a7b2e184 1094Warn about signed-unsigned comparisons.
fef3106c 1095
4a0ae68e
MLI
1096Wsign-compare
1097C ObjC C++ ObjC++ EnabledBy(Wextra)
1098;
1099
1100Wsign-conversion
63bbf46d 1101C ObjC C++ ObjC++ Var(warn_sign_conversion) Warning LangEnabledBy(C ObjC,Wconversion)
a7b2e184 1102Warn for implicit type conversions between signed and unsigned integers.
4a0ae68e 1103
fef3106c 1104Wsign-promo
c662432e 1105C++ ObjC++ Var(warn_sign_promo) Warning
a7b2e184 1106Warn when overload promotes from unsigned to signed.
fef3106c 1107
b2f97e4a 1108Wstrict-null-sentinel
5498f011 1109C++ ObjC++ Warning Var(warn_strict_null_sentinel)
a7b2e184 1110Warn about uncasted NULL used as sentinel.
b2f97e4a 1111
fef3106c 1112Wstrict-prototypes
c662432e 1113C ObjC Var(warn_strict_prototypes) Warning
a7b2e184 1114Warn about unprototyped function declarations.
fef3106c 1115
65d4f2cd 1116Wstrict-aliasing=
63010089 1117C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall, 3, 0) IntegerRange(0, 3)
65d4f2cd
MLI
1118;
1119
1120Wstrict-overflow=
63010089 1121C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 5)
65d4f2cd
MLI
1122;
1123
6e955430 1124Wstrict-selector-match
c662432e 1125ObjC ObjC++ Var(warn_strict_selector_match) Warning
a7b2e184 1126Warn if type signatures of candidate methods do not match exactly.
6e955430 1127
23462d4d
UB
1128Wsync-nand
1129C C++ Var(warn_sync_nand) Init(1) Warning
a7b2e184 1130Warn when __sync_fetch_and_nand and __sync_nand_and_fetch built-in functions are used.
23462d4d 1131
fef3106c 1132Wsynth
c662432e 1133C++ ObjC++ Var(warn_synth) Warning
a7b2e184 1134Deprecated. This switch has no effect.
fef3106c
NB
1135
1136Wsystem-headers
c662432e 1137C ObjC C++ ObjC++ Warning
9a0f3e86 1138; Documented in common.opt
fef3106c 1139
05b28fd6
MP
1140Wtautological-compare
1141C ObjC C++ ObjC++ Var(warn_tautological_compare) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 1142Warn if a comparison always evaluates to true or false.
05b28fd6 1143
8243e2a9
JM
1144Wterminate
1145C++ ObjC++ Warning Var(warn_terminate) Init(1)
a7b2e184 1146Warn if a throw expression will always result in a call to terminate().
8243e2a9 1147
fef3106c 1148Wtraditional
b559c810 1149C ObjC CPP(cpp_warn_traditional) CppReason(CPP_W_TRADITIONAL) Var(warn_traditional) Init(0) Warning
a7b2e184 1150Warn about features not present in traditional C.
fef3106c 1151
05170031 1152Wtraditional-conversion
c662432e 1153C ObjC Var(warn_traditional_conversion) Warning
a7b2e184 1154Warn of prototypes causing type conversions different from what would happen in the absence of prototype.
05170031 1155
fef3106c 1156Wtrigraphs
b559c810 1157C ObjC C++ ObjC++ CPP(warn_trigraphs) CppReason(CPP_W_TRIGRAPHS) Var(cpp_warn_trigraphs) Init(2) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 1158Warn if trigraphs are encountered that might affect the meaning of the program.
fef3106c
NB
1159
1160Wundeclared-selector
c662432e 1161ObjC ObjC++ Var(warn_undeclared_selector) Warning
a7b2e184 1162Warn about @selector()s without previously declared methods.
fef3106c
NB
1163
1164Wundef
b559c810 1165C ObjC C++ ObjC++ CPP(warn_undef) CppReason(CPP_W_UNDEF) Var(cpp_warn_undef) Init(0) Warning
a7b2e184 1166Warn if an undefined macro is used in an #if directive.
fef3106c 1167
4a0ae68e 1168Wuninitialized
cea71f0a 1169C ObjC C++ ObjC++ LTO LangEnabledBy(C ObjC C++ ObjC++ LTO,Wall)
4a0ae68e
MLI
1170;
1171
1172Wmaybe-uninitialized
cea71f0a 1173C ObjC C++ ObjC++ LTO LangEnabledBy(C ObjC C++ ObjC++ LTO,Wall)
4a0ae68e
MLI
1174;
1175
fef3106c 1176Wunknown-pragmas
34a180a6 1177C ObjC C++ ObjC++ Warning Var(warn_unknown_pragmas) LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0)
a7b2e184 1178Warn about unrecognized pragmas.
fef3106c 1179
6ec637a4
JJ
1180Wunsuffixed-float-constants
1181C ObjC Var(warn_unsuffixed_float_constants) Warning
a7b2e184 1182Warn about unsuffixed float constants.
6ec637a4 1183
4a0ae68e
MLI
1184Wunused
1185C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall)
1186; documented in common.opt
1187
3797cb21 1188Wunused-local-typedefs
650dc14a 1189C ObjC C++ ObjC++ Var(warn_unused_local_typedefs) Warning EnabledBy(Wunused)
a7b2e184 1190Warn when typedefs locally defined in a function are not used.
3797cb21 1191
fef3106c 1192Wunused-macros
b559c810 1193C ObjC C++ ObjC++ CppReason(CPP_W_UNUSED_MACROS) Var(cpp_warn_unused_macros) Warning
a7b2e184 1194Warn about macros defined in the main file that are not used.
fef3106c 1195
156f545a
MLI
1196Wunused-result
1197C ObjC C++ ObjC++ Var(warn_unused_result) Init(1) Warning
a7b2e184 1198Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value.
156f545a 1199
0f876f22
MW
1200Wunused-variable
1201C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wunused)
1202; documented in common.opt
1203
1204Wunused-const-variable
4246c8da
MW
1205C ObjC C++ ObjC++ Warning Alias(Wunused-const-variable=, 2, 0)
1206Warn when a const variable is unused.
1207
1208Wunused-const-variable=
63010089 1209C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_unused_const_variable) Warning LangEnabledBy(C ObjC,Wunused-variable, 1, 0) IntegerRange(0, 2)
a7b2e184 1210Warn when a const variable is unused.
0f876f22 1211
e5b79219 1212Wvariadic-macros
27e51192 1213C ObjC C++ ObjC++ CPP(warn_variadic_macros) CppReason(CPP_W_VARIADIC_MACROS) Var(cpp_warn_variadic_macros) Init(0) Warning LangEnabledBy(C ObjC C++ ObjC++,Wpedantic || Wtraditional)
a7b2e184 1214Warn about using variadic macros.
e5b79219 1215
b9c8da34
DS
1216Wvarargs
1217C ObjC C++ ObjC++ Warning Var(warn_varargs) Init(1)
a7b2e184 1218Warn about questionable usage of the macros used to retrieve variable arguments.
b9c8da34 1219
50d50fc7
SP
1220Wvla
1221C ObjC C++ ObjC++ Var(warn_vla) Init(-1) Warning
a7b2e184 1222Warn if a variable length array is used.
50d50fc7 1223
adc577c5 1224Wvla-larger-than=
00abf86c
MS
1225C ObjC C++ LTO ObjC++ Var(warn_vla_limit) Warning Joined Host_Wide_Int ByteSize Init(HOST_WIDE_INT_MAX)
1226-Wvla-larger-than=<number> Warn on unbounded uses of variable-length
1227arrays, and on bounded uses of variable-length arrays whose bound can be
adc577c5 1228larger than <number> bytes.
00abf86c
MS
1229<number> bytes.
1230
1231Wno-vla-larger-than
1232C ObjC C++ LTO ObjC++ Alias(Wvla-larger-than=,18446744073709551615EiB,none) Warning
1233-Wno-vla-larger-than Disable Wvla-larger-than= warning. Equivalent to Wvla-larger-than=<SIZE_MAX> or larger.
adc577c5 1234
8a902edb
MP
1235Wvolatile
1236C++ ObjC++ Var(warn_volatile) Warning
1237Warn about deprecated uses of volatile qualifier.
1238
16302daf 1239Wvolatile-register-var
4a0ae68e 1240C ObjC C++ ObjC++ Var(warn_volatile_register_var) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 1241Warn when a register variable is declared volatile.
16302daf 1242
6b333269
NS
1243Wvirtual-inheritance
1244C++ ObjC++ Var(warn_virtual_inheritance) Warning
a7b2e184 1245Warn on direct virtual inheritance.
6b333269 1246
f14edc1a
JM
1247Wvirtual-move-assign
1248C++ ObjC++ Var(warn_virtual_move_assign) Warning Init(1)
a7b2e184 1249Warn if a virtual base has a non-trivial move assignment operator.
f14edc1a 1250
fef3106c 1251Wwrite-strings
c662432e 1252C ObjC C++ ObjC++ Var(warn_write_strings) Warning
d8a07487 1253In C++, nonzero means warn about deprecated conversion from string literals to 'char *'. In C, similar warning, except that the conversion is of course not deprecated by the ISO C standard.
fef3106c 1254
89401152
PC
1255Wzero-as-null-pointer-constant
1256C++ ObjC++ Var(warn_zero_as_null_pointer_constant) Warning
a7b2e184 1257Warn when a literal '0' is used as null pointer.
89401152 1258
04398fa8
PC
1259Wuseless-cast
1260C++ ObjC++ Var(warn_useless_cast) Warning
a7b2e184 1261Warn about useless casts.
04398fa8 1262
273aa49e
PC
1263Wsubobject-linkage
1264C++ ObjC++ Var(warn_subobject_linkage) Warning Init(1)
a7b2e184 1265Warn if a class type has a base or a field whose type uses the anonymous namespace or depends on a type with no linkage.
273aa49e 1266
d6e83a8d
MM
1267Wduplicate-decl-specifier
1268C ObjC Var(warn_duplicate_decl_specifier) Warning LangEnabledBy(C ObjC,Wall)
1269Warn when a declaration has duplicate const, volatile, restrict or _Atomic specifier.
1270
975672f3 1271Wrestrict
cc8bea0a 1272C ObjC C++ ObjC++ Var(warn_restrict) Warning LangEnabledBy(C ObjC C++ ObjC++, Wall)
975672f3
PK
1273Warn when an argument passed to a restrict-qualified parameter aliases with
1274another argument.
1275
fef3106c
NB
1276ansi
1277C ObjC C++ ObjC++
a7b2e184 1278A synonym for -std=c89 (for C) or -std=c++98 (for C++).
fef3106c
NB
1279
1280d
1281C ObjC C++ ObjC++ Joined
72de27ea 1282; Documented in common.opt. FIXME - what about -dI, -dD, -dN and -dD?
fef3106c 1283
62984918
JM
1284fabi-compat-version=
1285C++ ObjC++ Joined RejectNegative UInteger Var(flag_abi_compat_version) Init(-1)
a7b2e184 1286The version of the C++ ABI used for -Wabi warnings and link compatibility aliases.
62984918 1287
fef3106c 1288faccess-control
5498f011 1289C++ ObjC++ Var(flag_access_control) Init(1)
a7b2e184 1290Enforce class member access control semantics.
fef3106c 1291
da5182be
TQ
1292fada-spec-parent=
1293C ObjC C++ ObjC++ RejectNegative Joined Var(ada_specs_parent)
a7b2e184 1294-fada-spec-parent=unit Dump Ada specs as child units of given parent.
da5182be 1295
af63ba4b
JM
1296faligned-new
1297C++ ObjC++ Alias(faligned-new=,1,0)
1298Support C++17 allocation of over-aligned types.
1299
1300faligned-new=
2e1c20b1 1301C++ ObjC++ Joined RejectNegative Var(aligned_new_threshold) UInteger Init(-1)
af63ba4b
JM
1302-faligned-new=<N> Use C++17 over-aligned type allocation for alignments greater than N.
1303
fef3106c 1304fall-virtual
68a57628 1305C++ ObjC++ WarnRemoved
fef3106c 1306
6637388f
TG
1307fallow-parameterless-variadic-functions
1308C ObjC Var(flag_allow_parameterless_variadic_functions)
a7b2e184 1309Allow variadic functions without named parameter.
6637388f 1310
fef3106c 1311falt-external-templates
68a57628 1312C++ ObjC++ WarnRemoved
a7b2e184 1313No longer supported.
fef3106c
NB
1314
1315fasm
5498f011 1316C ObjC C++ ObjC++ Var(flag_no_asm, 0)
a7b2e184 1317Recognize the \"asm\" keyword.
fef3106c 1318
10e48e39
RO
1319; Define extra predefined macros for use in libgcc.
1320fbuilding-libgcc
1321C ObjC C++ ObjC++ Undocumented Var(flag_building_libgcc)
1322
fef3106c 1323fbuiltin
5498f011 1324C ObjC C++ ObjC++ Var(flag_no_builtin, 0)
a7b2e184 1325Recognize built-in functions.
fef3106c
NB
1326
1327fbuiltin-
1328C ObjC C++ ObjC++ Joined
1329
5dc99c46
SB
1330fcanonical-system-headers
1331C ObjC C++ ObjC++
1332Where shorter, use canonicalized paths to systems headers.
1333
2d91f79d
TH
1334fchar8_t
1335C++ ObjC++ Var(flag_char8_t) Init(-1)
1336Enable the char8_t fundamental type and use it as the type for UTF-8 string
1337and character literals.
1338
d5e254e1 1339fcheck-pointer-bounds
68a57628 1340C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1341Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1342
1343fchkp-check-incomplete-type
68a57628 1344C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1345Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1346
1347fchkp-zero-input-bounds-for-main
68a57628 1348C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1349Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1350
1351fchkp-first-field-has-own-bounds
68a57628 1352C ObjC C++ ObjC++ LTO WarnRemoved RejectNegative
f48ef52e 1353Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1354
1355fchkp-narrow-bounds
68a57628 1356C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1357Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1358
1359fchkp-narrow-to-innermost-array
68a57628 1360C ObjC C++ ObjC++ LTO WarnRemoved RejectNegative
f48ef52e 1361Removed in GCC 9. This switch has no effect.
8ba4f506
AI
1362
1363fchkp-flexible-struct-trailing-arrays
68a57628 1364C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1365Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1366
1367fchkp-optimize
68a57628 1368C ObjC C++ ObjC++ LTO WarnRemoved
d5e254e1
IE
1369
1370fchkp-use-fast-string-functions
68a57628 1371C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1372Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1373
1374fchkp-use-nochk-string-functions
68a57628 1375C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1376Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1377
1378fchkp-use-static-bounds
68a57628 1379C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1380Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1381
1382fchkp-use-static-const-bounds
68a57628 1383C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1384Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1385
1386fchkp-treat-zero-dynamic-size-as-infinite
68a57628 1387C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1388Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1389
1390fchkp-check-read
68a57628 1391C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1392Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1393
1394fchkp-check-write
68a57628 1395C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1396Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1397
1398fchkp-store-bounds
68a57628 1399C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1400Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1401
1402fchkp-instrument-calls
68a57628 1403C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1404Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1405
1406fchkp-instrument-marked-only
68a57628 1407C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1408Removed in GCC 9. This switch has no effect.
d5e254e1 1409
226d62d2 1410fchkp-use-wrappers
68a57628 1411C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1412Removed in GCC 9. This switch has no effect.
226d62d2 1413
5373cd33 1414static-libmpx
68a57628 1415Driver WarnRemoved
f48ef52e 1416Removed in GCC 9. This switch has no effect.
5373cd33 1417
d2d7e672 1418static-libmpxwrappers
68a57628 1419Driver WarnRemoved
f48ef52e 1420Removed in GCC 9. This switch has no effect.
d2d7e672 1421
c0c12356
ML
1422fcilkplus
1423C ObjC C++ ObjC++ LTO Undocumented Ignore
f48ef52e 1424Removed in GCC 8. This switch has no effect.
36536d79 1425
971e17ff
AS
1426fconcepts
1427C++ ObjC++ Var(flag_concepts)
a7b2e184 1428Enable support for C++ concepts.
971e17ff 1429
cb57504a
JM
1430fconcepts-ts
1431C++ ObjC++ Var(flag_concepts_ts) Init(0)
1432Enable certain features present in the Concepts TS.
1433
fef3106c
NB
1434fcond-mismatch
1435C ObjC C++ ObjC++
a7b2e184 1436Allow the arguments of the '?' operator to have different types.
fef3106c
NB
1437
1438fconserve-space
c0c12356 1439C++ ObjC++ Ignore
6f07a821 1440Does nothing. Preserved for backward compatibility.
fef3106c 1441
fef3106c 1442fconstant-string-class=
61ff2bdc 1443ObjC ObjC++ Joined MissingArgError(no class name specified with %qs)
a7b2e184 1444-fconst-string-class=<name> Use class <name> for constant strings.
fef3106c 1445
17bc631c 1446fconstexpr-depth=
49a000c3 1447C++ ObjC++ Joined RejectNegative UInteger Var(max_constexpr_depth) Init(512)
a7b2e184 1448-fconstexpr-depth=<number> Specify maximum constexpr recursion depth.
17bc631c 1449
7ffc7de5
JM
1450fconstexpr-cache-depth=
1451C++ ObjC++ Joined RejectNegative UInteger Var(constexpr_cache_depth) Init(8)
1452-fconstexpr-cache-depth=<number> Specify maximum constexpr recursion cache depth.
1453
5ec2cd9f
JM
1454fconstexpr-loop-limit=
1455C++ ObjC++ Joined RejectNegative UInteger Var(constexpr_loop_limit) Init(262144)
1456-fconstexpr-loop-limit=<number> Specify maximum constexpr loop iteration count.
1457
a15ffa22
JJ
1458fconstexpr-ops-limit=
1459C++ ObjC++ Joined RejectNegative Host_Wide_Int Var(constexpr_ops_limit) Init(33554432)
1460-fconstexpr-ops-limit=<number> Specify maximum number of constexpr operations during a single constexpr evaluation.
1461
847e697a
TT
1462fdebug-cpp
1463C ObjC C++ ObjC++
a7b2e184 1464Emit debug annotations during preprocessing.
847e697a 1465
5f5babf1 1466fdeduce-init-list
db9d2274
MP
1467C++ ObjC++ Ignore
1468Does nothing. Preserved for backward compatibility.
5f5babf1 1469
1f26ac87
JM
1470fdeclone-ctor-dtor
1471C++ ObjC++ Var(flag_declone_ctor_dtor) Init(-1)
a7b2e184 1472Factor complex constructors and destructors to favor space over speed.
1f26ac87 1473
fef3106c 1474fdefault-inline
2d2bd949 1475C++ ObjC++ Ignore
5498f011 1476Does nothing. Preserved for backward compatibility.
fef3106c 1477
f012c8ef
DM
1478fdiagnostics-show-template-tree
1479C++ ObjC++ Var(flag_diagnostics_show_template_tree) Init(0)
1480Print hierarchical comparisons when template types are mismatched.
1481
ccfc4c91
OW
1482fdirectives-only
1483C ObjC C++ ObjC++
1484Preprocess directives only.
1485
fef3106c
NB
1486fdollars-in-identifiers
1487C ObjC C++ ObjC++
a7b2e184 1488Permit '$' as an identifier character.
fef3106c 1489
7365279f
BK
1490fmacro-prefix-map=
1491C ObjC C++ ObjC++ Joined RejectNegative
1492-fmacro-prefix-map=<old>=<new> Map one directory name to another in __FILE__, __BASE_FILE__, and __builtin_FILE().
1493
3b78de56
AC
1494fdump-ada-spec
1495C ObjC C++ ObjC++ RejectNegative Var(flag_dump_ada_spec)
a7b2e184 1496Write all declarations as Ada code transitively.
3b78de56
AC
1497
1498fdump-ada-spec-slim
1499C ObjC C++ ObjC++ RejectNegative Var(flag_dump_ada_spec_slim)
a7b2e184 1500Write all declarations as Ada code for the given file only.
3b78de56 1501
fef3106c 1502felide-constructors
5498f011 1503C++ ObjC++ Var(flag_elide_constructors) Init(1)
fef3106c 1504
f012c8ef
DM
1505felide-type
1506C++ ObjC++ Var(flag_elide_type) Init(1)
1507-fno-elide-type Do not elide common elements in template comparisons.
1508
fef3106c 1509fenforce-eh-specs
5498f011 1510C++ ObjC++ Var(flag_enforce_eh_specs) Init(1)
a7b2e184 1511Generate code to check exception specifications.
fef3106c
NB
1512
1513fenum-int-equiv
68a57628 1514C++ ObjC++ WarnRemoved
fef3106c 1515
e6cc3a24
ZW
1516fexec-charset=
1517C ObjC C++ ObjC++ Joined RejectNegative
a7b2e184 1518-fexec-charset=<cset> Convert all strings and character constants to character set <cset>.
e6cc3a24 1519
af15a2fe
JM
1520fextended-identifiers
1521C ObjC C++ ObjC++
a7b2e184 1522Permit universal character names (\\u and \\U) in identifiers.
af15a2fe 1523
16dd5cfe
EC
1524finput-charset=
1525C ObjC C++ ObjC++ Joined RejectNegative
a7b2e184 1526-finput-charset=<cset> Specify the default character set for source files.
16dd5cfe 1527
5af057d8
JM
1528fextern-tls-init
1529C++ ObjC++ Var(flag_extern_tls_init) Init(-1)
a7b2e184 1530Support dynamic initialization of thread-local variables in a different translation unit.
16dd5cfe 1531
fef3106c 1532fexternal-templates
68a57628 1533C++ ObjC++ WarnRemoved
fef3106c 1534
fef3106c 1535ffor-scope
68a57628 1536C++ ObjC++ WarnRemoved
fef3106c
NB
1537
1538ffreestanding
820b51ae 1539C ObjC C++ ObjC++
a7b2e184 1540Do not assume that standard C libraries and \"main\" exist.
fef3106c
NB
1541
1542fgnu-keywords
5498f011 1543C++ ObjC++ Var(flag_no_gnu_keywords, 0)
a7b2e184 1544Recognize GNU-defined keywords.
fef3106c
NB
1545
1546fgnu-runtime
fb5610fb 1547ObjC ObjC++ LTO Report RejectNegative Var(flag_next_runtime,0) Init(NEXT_OBJC_RUNTIME)
a7b2e184 1548Generate code for GNU runtime environment.
fef3106c 1549
da1c7394 1550fgnu89-inline
2cbac420 1551C ObjC Var(flag_gnu89_inline) Init(-1)
a7b2e184 1552Use traditional GNU semantics for inline functions.
da1c7394 1553
fef3106c 1554fguiding-decls
68a57628 1555C++ ObjC++ WarnRemoved
fef3106c
NB
1556
1557fhandle-exceptions
63b8a166 1558C++ ObjC++ Optimization Alias(fexceptions) Warn({%<-fhandle-exceptions%> has been renamed %<-fexceptions%> (and is now on by default)})
fef3106c
NB
1559
1560fhonor-std
68a57628 1561C++ ObjC++ WarnRemoved
fef3106c
NB
1562
1563fhosted
1564C ObjC
a7b2e184 1565Assume normal C execution environment.
fef3106c
NB
1566
1567fhuge-objects
68a57628 1568C++ ObjC++ WarnRemoved
a7b2e184 1569No longer supported.
fef3106c
NB
1570
1571fimplement-inlines
5498f011 1572C++ ObjC++ Var(flag_implement_inlines) Init(1)
a7b2e184 1573Export functions even if they can be inlined.
fef3106c
NB
1574
1575fimplicit-inline-templates
5498f011 1576C++ ObjC++ Var(flag_implicit_inline_templates) Init(1)
a7b2e184 1577Emit implicit instantiations of inline templates.
fef3106c
NB
1578
1579fimplicit-templates
5498f011 1580C++ ObjC++ Var(flag_implicit_templates) Init(1)
a7b2e184 1581Emit implicit instantiations of templates.
fef3106c 1582
31f7f784
JM
1583fnew-inheriting-ctors
1584C++ ObjC++ Var(flag_new_inheriting_ctors) Init(1)
1585Implement C++17 inheriting constructor semantics.
1586
d63d5d0c 1587ffriend-injection
68a57628 1588C++ ObjC++ WarnRemoved
d63d5d0c 1589
47ea1edf
DK
1590fkeep-inline-dllexport
1591C C++ ObjC ObjC++ Var(flag_keep_inline_dllexport) Init(1) Report Condition(TARGET_DLLIMPORT_DECL_ATTRIBUTES)
a7b2e184 1592Don't emit dllexported inline functions unless needed.
47ea1edf 1593
fef3106c 1594flabels-ok
68a57628 1595C++ ObjC++ WarnRemoved
fef3106c 1596
00c8e9f6 1597flax-vector-conversions
5498f011 1598C ObjC C++ ObjC++ Var(flag_lax_vector_conversions)
00c8e9f6
MS
1599Allow implicit conversions between vectors with differing numbers of subparts and/or differing element types.
1600
1c6ffbab
QZ
1601fmax-include-depth=
1602C ObjC C++ ObjC++ Joined RejectNegative UInteger
1603fmax-include-depth=<number> Set the maximum depth of the nested #include.
1604
fef3106c 1605fms-extensions
5498f011 1606C ObjC C++ ObjC++ Var(flag_ms_extensions)
a7b2e184 1607Don't warn about uses of Microsoft extensions.
fef3106c 1608
5720c0dc 1609fmudflap
68a57628 1610C ObjC C++ ObjC++ WarnRemoved
5720c0dc
RG
1611
1612fmudflapth
68a57628 1613C ObjC C++ ObjC++ WarnRemoved
5720c0dc
RG
1614
1615fmudflapir
68a57628 1616C ObjC C++ ObjC++ WarnRemoved
5720c0dc 1617
fef3106c 1618fname-mangling-version-
68a57628 1619C++ ObjC++ Joined WarnRemoved
fef3106c
NB
1620
1621fnew-abi
68a57628 1622C++ ObjC++ WarnRemoved
fef3106c 1623
31bfc9b9
JM
1624fnew-ttp-matching
1625C++ ObjC++ Var(flag_new_ttp)
1626Implement resolution of DR 150 for matching of template template arguments.
1627
fef3106c 1628fnext-runtime
fb5610fb 1629ObjC ObjC++ LTO Report RejectNegative Var(flag_next_runtime)
a7b2e184 1630Generate code for NeXT (Apple Mac OS X) runtime environment.
264fa2db
ZL
1631
1632fnil-receivers
5498f011 1633ObjC ObjC++ Var(flag_nil_receivers) Init(1)
a7b2e184 1634Assume that receivers of Objective-C messages may be nil.
fef3106c 1635
dcaaa5a0
DP
1636flocal-ivars
1637ObjC ObjC++ Var(flag_local_ivars) Init(1)
1638Allow access to instance variables as if they were local declarations within instance method implementations.
1639
1640fivar-visibility=
1641ObjC ObjC++ Joined RejectNegative Enum(ivar_visibility) Var(default_ivar_visibility) Init(IVAR_VISIBILITY_PROTECTED)
a7b2e184 1642-fvisibility=[private|protected|public|package] Set the default symbol visibility.
dcaaa5a0
DP
1643
1644Enum
1645Name(ivar_visibility) Type(enum ivar_visibility) UnknownError(unrecognized ivar visibility value %qs)
1646
1647EnumValue
1648Enum(ivar_visibility) String(private) Value(IVAR_VISIBILITY_PRIVATE)
1649
1650EnumValue
1651Enum(ivar_visibility) String(protected) Value(IVAR_VISIBILITY_PROTECTED)
1652
1653EnumValue
1654Enum(ivar_visibility) String(public) Value(IVAR_VISIBILITY_PUBLIC)
1655
1656EnumValue
1657Enum(ivar_visibility) String(package) Value(IVAR_VISIBILITY_PACKAGE)
1658
fef3106c 1659fnonansi-builtins
5498f011 1660C++ ObjC++ Var(flag_no_nonansi_builtin, 0)
fef3106c
NB
1661
1662fnonnull-objects
68a57628 1663C++ ObjC++ WarnRemoved
fef3106c 1664
9feb3d6a
JM
1665fnothrow-opt
1666C++ ObjC++ Optimization Var(flag_nothrow_opt)
a7b2e184 1667Treat a throw() exception specification as noexcept to improve code size.
9feb3d6a 1668
0a256240 1669fobjc-abi-version=
fb5610fb 1670ObjC ObjC++ LTO Joined Report RejectNegative UInteger Var(flag_objc_abi)
0a256240
NP
1671Specify which ABI to use for Objective-C family code and meta-data generation.
1672
6e955430
ZL
1673; Generate special '- .cxx_construct' and '- .cxx_destruct' methods
1674; to initialize any non-POD ivars in Objective-C++ classes.
1675fobjc-call-cxx-cdtors
1676ObjC++ Var(flag_objc_call_cxx_cdtors)
a7b2e184 1677Generate special Objective-C methods to initialize/destroy non-POD C++ ivars, if needed.
6e955430
ZL
1678
1679fobjc-direct-dispatch
1680ObjC ObjC++ Var(flag_objc_direct_dispatch)
a7b2e184 1681Allow fast jumps to the message dispatcher.
6e955430
ZL
1682
1683; Nonzero means that we will allow new ObjC exception syntax (@throw,
1684; @try, etc.) in source code.
264fa2db 1685fobjc-exceptions
6e955430 1686ObjC ObjC++ Var(flag_objc_exceptions)
a7b2e184 1687Enable Objective-C exception and synchronization syntax.
264fa2db 1688
6e955430 1689fobjc-gc
fb5610fb 1690ObjC ObjC++ LTO Var(flag_objc_gc)
a7b2e184 1691Enable garbage collection (GC) in Objective-C/Objective-C++ programs.
6e955430 1692
0a256240
NP
1693fobjc-nilcheck
1694ObjC ObjC++ Var(flag_objc_nilcheck,1)
1695Enable inline checks for nil receivers with the NeXT runtime and ABI version 2.
1696
6e955430 1697; Nonzero means that we generate NeXT setjmp based exceptions.
093c7153 1698fobjc-sjlj-exceptions
6e955430 1699ObjC ObjC++ Var(flag_objc_sjlj_exceptions) Init(-1)
a7b2e184 1700Enable Objective-C setjmp exception handling runtime.
093c7153 1701
22d8d616
NP
1702fobjc-std=objc1
1703ObjC ObjC++ Var(flag_objc1_only)
a7b2e184 1704Conform to the Objective-C 1.0 language as implemented in GCC 4.0.
22d8d616 1705
41dbbb37 1706fopenacc
a0c88d06 1707C ObjC C++ ObjC++ LTO Var(flag_openacc)
a7b2e184 1708Enable OpenACC.
41dbbb37 1709
b6adbb9f
NS
1710fopenacc-dim=
1711C ObjC C++ ObjC++ LTO Joined Var(flag_openacc_dims)
1712Specify default OpenACC compute dimensions.
1713
953ff289 1714fopenmp
1506ae0e 1715C ObjC C++ ObjC++ LTO Var(flag_openmp)
a7b2e184 1716Enable OpenMP (implies -frecursive in Fortran).
953ff289 1717
6d7f7e0a
TB
1718fopenmp-simd
1719C ObjC C++ ObjC++ Var(flag_openmp_simd)
a7b2e184 1720Enable OpenMP's SIMD directives.
6d7f7e0a 1721
fef3106c
NB
1722foperator-names
1723C++ ObjC++
a7b2e184 1724Recognize C++ keywords like \"compl\" and \"xor\".
fef3106c
NB
1725
1726foptional-diags
2d2bd949 1727C++ ObjC++ Ignore
5498f011 1728Does nothing. Preserved for backward compatibility.
fef3106c
NB
1729
1730fpch-deps
1731C ObjC C++ ObjC++
1732
c0d578e6
GK
1733fpch-preprocess
1734C ObjC C++ ObjC++
a7b2e184 1735Look for and use PCH files even when preprocessing.
c0d578e6 1736
fef3106c 1737fpermissive
0c3641b0 1738C++ ObjC++ Var(flag_permissive)
a7b2e184 1739Downgrade conformance errors to warnings.
fef3106c 1740
478a1c5b
ILT
1741fplan9-extensions
1742C ObjC Var(flag_plan9_extensions)
a7b2e184 1743Enable Plan 9 language extensions.
478a1c5b 1744
fef3106c
NB
1745fpreprocessed
1746C ObjC C++ ObjC++
a7b2e184 1747Treat the input file as already preprocessed.
fef3106c 1748
92582b75
TT
1749ftrack-macro-expansion
1750C ObjC C++ ObjC++ JoinedOrMissing RejectNegative UInteger
1751; converted into ftrack-macro-expansion=
1752
1753ftrack-macro-expansion=
1754C ObjC C++ ObjC++ JoinedOrMissing RejectNegative UInteger
a7b2e184 1755-ftrack-macro-expansion=<0|1|2> Track locations of tokens coming from macro expansion and display them in error messages.
92582b75 1756
6ea2bd47 1757fpretty-templates
5498f011 1758C++ ObjC++ Var(flag_pretty_templates) Init(1)
a7b2e184 1759-fno-pretty-templates Do not pretty-print template specializations as the template signature followed by the arguments.
6ea2bd47 1760
88d0c3f0 1761fprintf-return-value
89990732 1762C ObjC C++ ObjC++ LTO Optimization Var(flag_printf_return_value) Init(1)
88d0c3f0
MS
1763Treat known sprintf return values as constants.
1764
264fa2db 1765freplace-objc-classes
fb5610fb 1766ObjC ObjC++ LTO Var(flag_replace_objc_classes)
a7b2e184 1767Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime.
264fa2db 1768
fef3106c 1769frepo
68a57628 1770C++ ObjC++ WarnRemoved
f48ef52e 1771Removed in GCC 10. This switch has no effect.
fef3106c
NB
1772
1773frtti
5498f011 1774C++ ObjC++ Optimization Var(flag_rtti) Init(1)
a7b2e184 1775Generate run time type descriptor information.
fef3106c 1776
fef3106c 1777fshort-enums
dd6fe7d4 1778C ObjC C++ ObjC++ LTO Optimization Var(flag_short_enums)
a7b2e184 1779Use the narrowest integer type possible for enumeration types.
fef3106c
NB
1780
1781fshort-wchar
dd6fe7d4 1782C ObjC C++ ObjC++ LTO Optimization Var(flag_short_wchar)
a7b2e184 1783Force the underlying type for \"wchar_t\" to be \"unsigned short\".
fef3106c 1784
fef3106c 1785fsigned-bitfields
5498f011 1786C ObjC C++ ObjC++ Var(flag_signed_bitfields) Init(1)
a7b2e184 1787When \"signed\" or \"unsigned\" is not given make the bitfield signed.
fef3106c
NB
1788
1789fsigned-char
5498f011 1790C ObjC C++ ObjC++ LTO Var(flag_signed_char)
a7b2e184 1791Make \"char\" signed by default.
fef3106c 1792
20b06add
JM
1793fsized-deallocation
1794C++ ObjC++ Var(flag_sized_deallocation) Init(-1)
a7b2e184 1795Enable C++14 sized deallocation support.
20b06add 1796
fef3106c 1797fsquangle
68a57628 1798C++ ObjC++ WarnRemoved
fef3106c 1799
ee45a32d 1800fsso-struct=
fc73e60c 1801C ObjC Joined RejectNegative Enum(sso_struct) Var(default_sso) Init(SSO_NATIVE)
4e89adf9 1802-fsso-struct=[big-endian|little-endian|native] Set the default scalar storage order.
ee45a32d
EB
1803
1804Enum
1805Name(sso_struct) Type(enum scalar_storage_order_kind) UnknownError(unrecognized scalar storage order value %qs)
1806
1807EnumValue
1808Enum(sso_struct) String(big-endian) Value(SSO_BIG_ENDIAN)
1809
1810EnumValue
1811Enum(sso_struct) String(little-endian) Value(SSO_LITTLE_ENDIAN)
1812
4e89adf9
EB
1813EnumValue
1814Enum(sso_struct) String(native) Value(SSO_NATIVE)
1815
fef3106c 1816fstats
5498f011 1817C++ ObjC++ Var(flag_detailed_statistics)
a7b2e184 1818Display statistics accumulated during compilation.
fef3106c 1819
cbb4feb3
JM
1820fstrict-enums
1821C++ ObjC++ Optimization Var(flag_strict_enums)
a7b2e184 1822Assume that values of enumeration type are always within the minimum range of that type.
cbb4feb3 1823
fef3106c 1824fstrict-prototype
68a57628 1825C++ ObjC++ WarnRemoved
fef3106c 1826
d0cf395a
JM
1827fstrong-eval-order
1828C++ ObjC++ Common Alias(fstrong-eval-order=, all, none)
1829Follow the C++17 evaluation order requirements for assignment expressions,
1830shift, member function calls, etc.
1831
1832fstrong-eval-order=
d4a6c0ea 1833C++ ObjC++ Common Var(flag_strong_eval_order) Joined Enum(strong_eval_order) RejectNegative Init(-1)
d0cf395a
JM
1834Follow the C++17 evaluation order requirements for assignment expressions,
1835shift, member function calls, etc.
1836
1837Enum
1838Name(strong_eval_order) Type(int)
1839
1840EnumValue
1841Enum(strong_eval_order) String(none) Value(0)
1842
1843EnumValue
1844Enum(strong_eval_order) String(some) Value(1)
1845
1846EnumValue
1847Enum(strong_eval_order) String(all) Value(2)
1848
fef3106c 1849ftabstop=
7b086b11 1850C ObjC C++ ObjC++ Joined RejectNegative UInteger
a7b2e184 1851-ftabstop=<number> Distance between tab stops for column reporting.
fef3106c 1852
a12bf402
MLI
1853ftemplate-backtrace-limit=
1854C++ ObjC++ Joined RejectNegative UInteger Var(template_backtrace_limit) Init(10)
a7b2e184 1855Set the maximum number of template instantiation notes for a single warning or error.
a12bf402 1856
fef3106c 1857ftemplate-depth-
5de8299c 1858C++ ObjC++ Joined RejectNegative Undocumented Alias(ftemplate-depth=)
124e0d27
MLI
1859
1860ftemplate-depth=
c22cacf3 1861C++ ObjC++ Joined RejectNegative UInteger
a7b2e184 1862-ftemplate-depth=<number> Specify maximum template instantiation depth.
fef3106c
NB
1863
1864fthis-is-variable
68a57628 1865C++ ObjC++ WarnRemoved
fef3106c 1866
40aac948 1867fthreadsafe-statics
5498f011 1868C++ ObjC++ Optimization Var(flag_threadsafe_statics) Init(1)
a7b2e184 1869-fno-threadsafe-statics Do not generate thread-safe code for initializing local statics.
40aac948 1870
fef3106c 1871funsigned-bitfields
f0036cca 1872C ObjC C++ ObjC++ Var(flag_signed_bitfields, 0)
a7b2e184 1873When \"signed\" or \"unsigned\" is not given make the bitfield unsigned.
fef3106c
NB
1874
1875funsigned-char
f0036cca 1876C ObjC C++ ObjC++ LTO Var(flag_signed_char, 0)
a7b2e184 1877Make \"char\" unsigned by default.
fef3106c
NB
1878
1879fuse-cxa-atexit
5498f011 1880C++ ObjC++ Var(flag_use_cxa_atexit) Init(DEFAULT_USE_CXA_ATEXIT)
a7b2e184 1881Use __cxa_atexit to register destructors.
fef3106c 1882
c7b5e395 1883fuse-cxa-get-exception-ptr
5498f011 1884C++ ObjC++ Var(flag_use_cxa_get_exception_ptr) Init(2)
a7b2e184 1885Use __cxa_get_exception_ptr in exception handling.
c7b5e395 1886
d7afec4b 1887fvisibility-inlines-hidden
d0b07283 1888C++ ObjC++
a7b2e184 1889Marks all inlined functions and methods as having hidden visibility.
d7afec4b 1890
ddbfd28d
GK
1891fvisibility-ms-compat
1892C++ ObjC++ Var(flag_visibility_ms_compat)
a7b2e184 1893Changes visibility to match Microsoft Visual Studio by default.
ddbfd28d 1894
fef3106c 1895fvtable-gc
68a57628 1896C++ ObjC++ WarnRemoved
a7b2e184 1897No longer supported.
fef3106c
NB
1898
1899fvtable-thunks
68a57628 1900C++ ObjC++ WarnRemoved
a7b2e184 1901No longer supported.
fef3106c
NB
1902
1903fweak
5498f011 1904C++ ObjC++ Var(flag_weak) Init(1)
a7b2e184 1905Emit common-like symbols as weak symbols.
fef3106c 1906
e6cc3a24
ZW
1907fwide-exec-charset=
1908C ObjC C++ ObjC++ Joined RejectNegative
a7b2e184 1909-fwide-exec-charset=<cset> Convert all wide strings and character constants to character set <cset>.
e6cc3a24 1910
b20d9f0c 1911fworking-directory
5498f011 1912C ObjC C++ ObjC++ Var(flag_working_directory) Init(-1)
a7b2e184 1913Generate a #line directive pointing at the current working directory.
b20d9f0c 1914
fef3106c 1915fxref
68a57628 1916C++ ObjC++ WarnRemoved
a7b2e184 1917No longer supported.
fef3106c 1918
264fa2db 1919fzero-link
5498f011 1920ObjC ObjC++ Var(flag_zero_link)
a7b2e184 1921Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode.
264fa2db 1922
fef3106c 1923gen-decls
9ed32e27 1924ObjC ObjC++ Driver Var(flag_gen_declaration) RejectNegative
a7b2e184 1925Dump declarations to a .decl file.
fef3106c 1926
39ef6592
LC
1927femit-struct-debug-baseonly
1928C ObjC C++ ObjC++
a7b2e184 1929-femit-struct-debug-baseonly Aggressive reduced debug info for structs.
39ef6592
LC
1930
1931femit-struct-debug-reduced
1932C ObjC C++ ObjC++
a7b2e184 1933-femit-struct-debug-reduced Conservative reduced debug info for structs.
39ef6592
LC
1934
1935femit-struct-debug-detailed=
1936C ObjC C++ ObjC++ Joined
a7b2e184 1937-femit-struct-debug-detailed=<spec-list> Detailed reduced debug info for structs.
39ef6592 1938
a4a0016d 1939fext-numeric-literals
dcb466ec 1940C++ ObjC++ Var(flag_ext_numeric_literals) Init(1)
a4a0016d
ESR
1941Interpret imaginary, fixed-point, or other gnu number suffix as the corresponding
1942number literal rather than a user-defined number literal.
1943
fef3106c 1944idirafter
61ff2bdc 1945C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
a7b2e184 1946-idirafter <dir> Add <dir> to the end of the system include path.
fef3106c
NB
1947
1948imacros
61ff2bdc 1949C ObjC C++ ObjC++ Joined Separate MissingArgError(missing filename after %qs)
a7b2e184 1950-imacros <file> Accept definition of macros in <file>.
fef3106c 1951
2b6dd222
JM
1952imultilib
1953C ObjC C++ ObjC++ Joined Separate
a7b2e184 1954-imultilib <dir> Set <dir> to be the multilib include subdirectory.
2b6dd222 1955
fef3106c 1956include
61ff2bdc 1957C ObjC C++ ObjC++ Joined Separate MissingArgError(missing filename after %qs)
a7b2e184 1958-include <file> Include the contents of <file> before other files.
fef3106c
NB
1959
1960iprefix
1961C ObjC C++ ObjC++ Joined Separate
a7b2e184 1962-iprefix <path> Specify <path> as a prefix for next two options.
fef3106c
NB
1963
1964isysroot
61ff2bdc 1965C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
a7b2e184 1966-isysroot <dir> Set <dir> to be the system root directory.
fef3106c
NB
1967
1968isystem
61ff2bdc 1969C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
a7b2e184 1970-isystem <dir> Add <dir> to the start of the system include path.
fef3106c 1971
4bed3787 1972iquote
61ff2bdc 1973C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
a7b2e184 1974-iquote <dir> Add <dir> to the end of the quote include path.
4bed3787 1975
fef3106c
NB
1976iwithprefix
1977C ObjC C++ ObjC++ Joined Separate
a7b2e184 1978-iwithprefix <dir> Add <dir> to the end of the system include path.
fef3106c
NB
1979
1980iwithprefixbefore
1981C ObjC C++ ObjC++ Joined Separate
a7b2e184 1982-iwithprefixbefore <dir> Add <dir> to the end of the main include path.
fef3106c
NB
1983
1984lang-asm
603349bf 1985C Undocumented RejectDriver
fef3106c 1986
e200444e
JM
1987no-integrated-cpp
1988Driver
1989
fef3106c
NB
1990nostdinc
1991C ObjC C++ ObjC++
a7b2e184 1992Do not search standard system include directories (those specified with -isystem will still be used).
fef3106c
NB
1993
1994nostdinc++
72de27ea 1995C++ ObjC++
a7b2e184 1996Do not search standard system include directories for C++.
fef3106c
NB
1997
1998o
1999C ObjC C++ ObjC++ Joined Separate
72de27ea 2000; Documented in common.opt
fef3106c
NB
2001
2002pedantic
c1771a20 2003C ObjC C++ ObjC++ Alias(Wpedantic)
72de27ea 2004; Documented in common.opt
fef3106c 2005
fef3106c
NB
2006print-objc-runtime-info
2007ObjC ObjC++
a7b2e184 2008Generate C header of platform-specific features.
fef3106c
NB
2009
2010remap
2011C ObjC C++ ObjC++
a7b2e184 2012Remap file names when including files.
fef3106c
NB
2013
2014std=c++98
2015C++ ObjC++
a7b2e184 2016Conform to the ISO 1998 C++ standard revised by the 2003 technical corrigendum.
c7dc8804
JM
2017
2018std=c++03
2019C++ ObjC++ Alias(std=c++98)
a7b2e184 2020Conform to the ISO 1998 C++ standard revised by the 2003 technical corrigendum.
fef3106c 2021
97e3ad20 2022std=c++11
966541e3 2023C++ ObjC++
a7b2e184 2024Conform to the ISO 2011 C++ standard.
97e3ad20
JM
2025
2026std=c++0x
70e24808 2027C++ ObjC++ Alias(std=c++11) Undocumented
a7b2e184 2028Deprecated in favor of -std=c++11.
966541e3 2029
552b8185 2030std=c++1y
028aee17 2031C++ ObjC++ Alias(std=c++14) Undocumented
a7b2e184 2032Deprecated in favor of -std=c++14.
70e24808
JM
2033
2034std=c++14
381bf11e 2035C++ ObjC++
a7b2e184 2036Conform to the ISO 2014 C++ standard.
552b8185 2037
da73100b 2038std=c++1z
7b936140
JJ
2039C++ ObjC++ Alias(std=c++17) Undocumented
2040Deprecated in favor of -std=c++17.
da73100b
JM
2041
2042std=c++17
7b936140
JJ
2043C++ ObjC++
2044Conform to the ISO 2017 C++ standard.
da73100b 2045
026a79f7
AS
2046std=c++2a
2047C++ ObjC++
2048Conform to the ISO 2020(?) C++ draft standard (experimental and incomplete support).
2049
48b0b196 2050std=c11
2778d766 2051C ObjC
a7b2e184 2052Conform to the ISO 2011 C standard.
48b0b196
JM
2053
2054std=c1x
2055C ObjC Alias(std=c11)
a7b2e184 2056Deprecated in favor of -std=c11.
2778d766 2057
c76dc9c3
JM
2058std=c17
2059C ObjC
7a8a92c4 2060Conform to the ISO 2017 C standard (published in 2018).
1e39313a
JM
2061
2062std=c18
2063C ObjC Alias(std=c17)
7a8a92c4 2064Conform to the ISO 2017 C standard (published in 2018).
c76dc9c3 2065
9f936c86
JM
2066std=c2x
2067C ObjC
2068Conform to the ISO 202X C standard draft (experimental and incomplete support).
2069
fef3106c 2070std=c89
5de8299c 2071C ObjC Alias(std=c90)
a7b2e184 2072Conform to the ISO 1990 C standard.
fef3106c 2073
7e1542b9
MLI
2074std=c90
2075C ObjC
a7b2e184 2076Conform to the ISO 1990 C standard.
7e1542b9 2077
fef3106c
NB
2078std=c99
2079C ObjC
a7b2e184 2080Conform to the ISO 1999 C standard.
fef3106c
NB
2081
2082std=c9x
5de8299c 2083C ObjC Alias(std=c99)
a7b2e184 2084Deprecated in favor of -std=c99.
fef3106c
NB
2085
2086std=gnu++98
2087C++ ObjC++
97e3ad20 2088Conform to the ISO 1998 C++ standard revised by the 2003 technical
a7b2e184 2089corrigendum with GNU extensions.
fef3106c 2090
97e3ad20
JM
2091std=gnu++03
2092C++ ObjC++ Alias(std=gnu++98)
2093Conform to the ISO 1998 C++ standard revised by the 2003 technical
a7b2e184 2094corrigendum with GNU extensions.
97e3ad20
JM
2095
2096std=gnu++11
966541e3 2097C++ ObjC++
a7b2e184 2098Conform to the ISO 2011 C++ standard with GNU extensions.
97e3ad20
JM
2099
2100std=gnu++0x
381bf11e 2101C++ ObjC++ Alias(std=gnu++11) Undocumented
a7b2e184 2102Deprecated in favor of -std=gnu++11.
966541e3 2103
552b8185 2104std=gnu++1y
028aee17 2105C++ ObjC++ Alias(std=gnu++14) Undocumented
a7b2e184 2106Deprecated in favor of -std=gnu++14.
552b8185 2107
a07f6ed2 2108std=gnu++14
028aee17 2109C++ ObjC++
a7b2e184 2110Conform to the ISO 2014 C++ standard with GNU extensions.
a07f6ed2 2111
da73100b 2112std=gnu++1z
7b936140
JJ
2113C++ ObjC++ Alias(std=gnu++17) Undocumented
2114Deprecated in favor of -std=gnu++17.
da73100b
JM
2115
2116std=gnu++17
7b936140
JJ
2117C++ ObjC++
2118Conform to the ISO 2017 C++ standard with GNU extensions.
da73100b 2119
026a79f7
AS
2120std=gnu++2a
2121C++ ObjC++
2122Conform to the ISO 2020(?) C++ draft standard with GNU extensions (experimental and incomplete support).
2123
48b0b196 2124std=gnu11
2778d766 2125C ObjC
a7b2e184 2126Conform to the ISO 2011 C standard with GNU extensions.
48b0b196
JM
2127
2128std=gnu1x
2129C ObjC Alias(std=gnu11)
a7b2e184 2130Deprecated in favor of -std=gnu11.
2778d766 2131
c76dc9c3
JM
2132std=gnu17
2133C ObjC
7a8a92c4 2134Conform to the ISO 2017 C standard (published in 2018) with GNU extensions.
1e39313a
JM
2135
2136std=gnu18
2137C ObjC Alias(std=gnu17)
7a8a92c4 2138Conform to the ISO 2017 C standard (published in 2018) with GNU extensions.
c76dc9c3 2139
9f936c86
JM
2140std=gnu2x
2141C ObjC
2142Conform to the ISO 202X C standard draft with GNU extensions (experimental and incomplete support).
2143
fef3106c 2144std=gnu89
5de8299c 2145C ObjC Alias(std=gnu90)
a7b2e184 2146Conform to the ISO 1990 C standard with GNU extensions.
fef3106c 2147
7e1542b9
MLI
2148std=gnu90
2149C ObjC
a7b2e184 2150Conform to the ISO 1990 C standard with GNU extensions.
7e1542b9 2151
fef3106c
NB
2152std=gnu99
2153C ObjC
a7b2e184 2154Conform to the ISO 1999 C standard with GNU extensions.
fef3106c
NB
2155
2156std=gnu9x
5de8299c 2157C ObjC Alias(std=gnu99)
a7b2e184 2158Deprecated in favor of -std=gnu99.
fef3106c
NB
2159
2160std=iso9899:1990
5de8299c 2161C ObjC Alias(std=c90)
a7b2e184 2162Conform to the ISO 1990 C standard.
fef3106c
NB
2163
2164std=iso9899:199409
2165C ObjC
a7b2e184 2166Conform to the ISO 1990 C standard as amended in 1994.
fef3106c
NB
2167
2168std=iso9899:1999
5de8299c 2169C ObjC Alias(std=c99)
a7b2e184 2170Conform to the ISO 1999 C standard.
fef3106c
NB
2171
2172std=iso9899:199x
5de8299c 2173C ObjC Alias(std=c99)
a7b2e184 2174Deprecated in favor of -std=iso9899:1999.
fef3106c 2175
48b0b196
JM
2176std=iso9899:2011
2177C ObjC Alias(std=c11)
a7b2e184 2178Conform to the ISO 2011 C standard.
48b0b196 2179
c76dc9c3
JM
2180std=iso9899:2017
2181C ObjC Alias(std=c17)
7a8a92c4 2182Conform to the ISO 2017 C standard (published in 2018).
1e39313a
JM
2183
2184std=iso9899:2018
2185C ObjC Alias(std=c17)
7a8a92c4 2186Conform to the ISO 2017 C standard (published in 2018).
c76dc9c3 2187
e200444e
JM
2188traditional
2189Driver
2190
fef3106c
NB
2191traditional-cpp
2192C ObjC C++ ObjC++
a7b2e184 2193Enable traditional preprocessing.
fef3106c
NB
2194
2195trigraphs
2196C ObjC C++ ObjC++
a7b2e184 2197-trigraphs Support ISO C trigraphs.
fef3106c
NB
2198
2199undef
5498f011 2200C ObjC C++ ObjC++ Var(flag_undef)
a7b2e184 2201Do not predefine system-specific and GCC-specific macros.
fef3106c
NB
2202
2203v
d5478783
JM
2204C ObjC C++ ObjC++
2205; Documented in common.opt
fef3106c
NB
2206
2207w
2208C ObjC C++ ObjC++
72de27ea 2209; Documented in common.opt
e11a4ae5
NB
2210
2211; This comment is to ensure we retain the blank line above.