]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/c-family/c.opt
Add a new warning option -Wstrict-flex-arrays.
[thirdparty/gcc.git] / gcc / c-family / c.opt
CommitLineData
fef3106c 1; Options for the C, ObjC, C++ and ObjC++ front ends.
7adcbafe 2; Copyright (C) 2003-2022 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
9e1e962e
ML
138-output-pch
139C ObjC C++ ObjC++ Separate
fef3106c 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 238
10ee6da6
NS
239Mmodules
240C++
241Generate C++ Module dependency information.
242
243Mno-modules
244C++
245; undocumented
246
fef3106c
NB
247MP
248C ObjC C++ ObjC++
a7b2e184 249Generate phony targets for all headers.
fef3106c
NB
250
251MQ
61ff2bdc 252C ObjC C++ ObjC++ Joined Separate MissingArgError(missing makefile target after %qs)
918e8b10 253-MQ <target> Add a target that may require quoting.
fef3106c
NB
254
255MT
61ff2bdc 256C ObjC C++ ObjC++ Joined Separate MissingArgError(missing makefile target after %qs)
918e8b10 257-MT <target> Add a target that does not require quoting.
fef3106c
NB
258
259P
260C ObjC C++ ObjC++
a7b2e184 261Do not generate #line directives.
fef3106c
NB
262
263U
61ff2bdc 264C ObjC C++ ObjC++ Joined Separate MissingArgError(macro name missing after %qs)
a7b2e184 265-U<macro> Undefine <macro>.
fef3106c 266
0c30bf43
IS
267WNSObject-attribute
268C ObjC C++ ObjC++ LTO Var(warn_nsobject_attribute) Warning Init(1)
269Warn if the NSObject attribute is applied to a non-typedef.
270
fef3106c 271Wabi
d7f09764 272C ObjC C++ ObjC++ LTO Var(warn_abi) Warning
a7b2e184 273Warn about things that will change when compiling with an ABI-compliant compiler.
fef3106c 274
62984918
JM
275Wabi=
276C ObjC C++ ObjC++ LTO Joined RejectNegative UInteger Warning
a7b2e184 277Warn about things that change between the current -fabi-version and the specified version.
62984918 278
7dbb85a7
JM
279Wabi-tag
280C++ ObjC++ Var(warn_abi_tag) Warning
a7b2e184 281Warn if a subobject has an abi_tag attribute that the complete object type does not have.
7dbb85a7 282
bce08d50 283Wpsabi
50b15873 284C ObjC C++ ObjC++ LTO Var(warn_psabi) Init(1) Warning Undocumented LangEnabledBy(C ObjC C++ ObjC++,Wabi)
bce08d50 285
80c6d1f4
MJ
286Wabsolute-value
287C ObjC Var(warn_absolute_value) Warning EnabledBy(Wextra)
288Warn on suspicious calls of standard functions computing absolute values.
289
c116cd05 290Waddress
4a0ae68e 291C ObjC C++ ObjC++ Var(warn_address) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 292Warn about suspicious uses of memory addresses.
c116cd05 293
af63ba4b
JM
294Enum
295Name(warn_aligned_new_level) Type(int) UnknownError(argument %qs to %<-Waligned-new%> not recognized)
296
297EnumValue
298Enum(warn_aligned_new_level) String(none) Value(0)
299
300EnumValue
301Enum(warn_aligned_new_level) String(global) Value(1)
302
303EnumValue
304Enum(warn_aligned_new_level) String(all) Value(2)
305
306Waligned-new
307C++ ObjC++ Alias(Waligned-new=,global,none)
308Warn about 'new' of type with extended alignment without -faligned-new.
309
310Waligned-new=
2e1c20b1 311C++ ObjC++ Var(warn_aligned_new) Enum(warn_aligned_new_level) Joined RejectNegative Warning LangEnabledBy(C++ ObjC++,Wall,1,0)
6a825afe 312-Waligned-new=[none|global|all] Warn even if 'new' uses a class member allocation function.
af63ba4b 313
fef3106c 314Wall
c662432e 315C ObjC C++ ObjC++ Warning
a7b2e184 316Enable most warning messages.
fef3106c 317
adc577c5
AH
318Walloca
319C ObjC C++ ObjC++ Var(warn_alloca) Warning
320Warn on any use of alloca.
321
8bd9f164 322Walloc-size-larger-than=
00abf86c 323C ObjC C++ LTO ObjC++ Var(warn_alloc_size_limit) Joined Host_Wide_Int ByteSize Warning Init(HOST_WIDE_INT_MAX)
b408e010 324-Walloc-size-larger-than=<bytes> Warn for calls to allocation functions that
8bd9f164
MS
325attempt to allocate objects larger than the specified number of bytes.
326
d258f4aa 327Wno-alloc-size-larger-than
00abf86c 328C ObjC C++ LTO ObjC++ Alias(Walloc-size-larger-than=,18446744073709551615EiB,none) Warning
b408e010 329Disable Walloc-size-larger-than= warning. Equivalent to Walloc-size-larger-than=<SIZE_MAX> or larger.
d258f4aa 330
8bd9f164
MS
331Walloc-zero
332C ObjC C++ ObjC++ Var(warn_alloc_zero) Warning
b408e010 333Warn for calls to allocation functions that specify zero bytes.
8bd9f164 334
adc577c5 335Walloca-larger-than=
00abf86c 336C ObjC C++ LTO ObjC++ Var(warn_alloca_limit) Warning Joined Host_Wide_Int ByteSize Init(HOST_WIDE_INT_MAX)
9453ba0a 337-Walloca-larger-than=<number> Warn on unbounded uses of
adc577c5
AH
338alloca, and on bounded uses of alloca whose bound can be larger than
339<number> bytes.
340
00abf86c
MS
341Wno-alloca-larger-than
342C ObjC C++ LTO ObjC++ Alias(Walloca-larger-than=,18446744073709551615EiB,none) Warning
b408e010 343Disable Walloca-larger-than= warning. Equivalent to Walloca-larger-than=<SIZE_MAX> or larger.
00abf86c 344
de1b5c17 345Warray-bounds=
cea71f0a 346LangEnabledBy(C ObjC C++ LTO ObjC++,Wall,1,0)
de1b5c17
MU
347; in common.opt
348
2dda00b7
MP
349Warray-compare
350C ObjC C++ ObjC++ Var(warn_array_compare) Warning LangEnabledBy(C ObjC C++ ObjC++, Wall)
351Warn about comparisons between two operands of array type.
352
6450f073
MS
353Warray-parameter
354C ObjC C++ ObjC++ Warning Alias(Warray-parameter=, 2, 0)
355Warn about mismatched declarations of array parameters and unsafe accesses to them.
356
357Warray-parameter=
358C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_array_parameter) IntegerRange(0, 2) LangEnabledBy(C ObjC C++ ObjC++,Wall, 2, 0) Warning
359Warn about mismatched declarations of array parameters and unsafe accesses to them.
360
49fb45c8
MS
361Wzero-length-bounds
362C ObjC C++ ObjC++ Var(warn_zero_length_bounds) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
363Warn about accesses to interior zero-length array members.
364
6e955430 365Wassign-intercept
c662432e 366ObjC ObjC++ Var(warn_assign_intercept) Warning
a7b2e184 367Warn whenever an Objective-C assignment is being intercepted by the garbage collector.
6e955430 368
fef3106c 369Wbad-function-cast
c662432e 370C ObjC Var(warn_bad_function_cast) Warning
a7b2e184 371Warn about casting functions to incompatible types.
fef3106c 372
51c50026
MP
373Wbidi-chars
374C ObjC C++ ObjC++ Warning Alias(Wbidi-chars=,any,none)
375;
376
377Wbidi-chars=
ae36f839
MP
378C ObjC C++ ObjC++ RejectNegative Joined Warning CPP(cpp_warn_bidirectional) CppReason(CPP_W_BIDIRECTIONAL) Var(warn_bidirectional) Init(bidirectional_unpaired) Enum(cpp_bidirectional_level) EnumSet
379-Wbidi-chars=[none|unpaired|any|ucn] Warn about UTF-8 bidirectional control characters.
51c50026
MP
380
381; Required for these enum values.
382SourceInclude
383cpplib.h
384
385Enum
386Name(cpp_bidirectional_level) Type(int) UnknownError(argument %qs to %<-Wbidi-chars%> not recognized)
387
388EnumValue
ae36f839 389Enum(cpp_bidirectional_level) String(none) Value(bidirectional_none) Set(1)
51c50026
MP
390
391EnumValue
ae36f839 392Enum(cpp_bidirectional_level) String(unpaired) Value(bidirectional_unpaired) Set(1)
51c50026
MP
393
394EnumValue
ae36f839
MP
395Enum(cpp_bidirectional_level) String(any) Value(bidirectional_any) Set(1)
396
397EnumValue
398Enum(cpp_bidirectional_level) String(ucn) Value(bidirectional_ucn) Set(2)
51c50026 399
04159acf
MP
400Wbool-compare
401C ObjC C++ ObjC++ Var(warn_bool_compare) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 402Warn about boolean expression compared with an integer value different from true/false.
04159acf 403
9a2300e9
MP
404Wbool-operation
405C ObjC C++ ObjC++ Var(warn_bool_op) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
406Warn about certain operations on boolean expressions.
407
8423e57c
MS
408Wframe-address
409C ObjC C++ ObjC++ Var(warn_frame_address) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 410Warn when __builtin_frame_address or __builtin_return_address is used unsafely.
8423e57c 411
48330c93 412Wbuiltin-declaration-mismatch
46a27415 413C ObjC C++ ObjC++ Var(warn_builtin_declaration_mismatch) Init(1) Warning
48330c93
BE
414Warn when a built-in function is declared with the wrong signature.
415
c047ce93 416Wbuiltin-macro-redefined
b559c810 417C ObjC C++ ObjC++ CPP(warn_builtin_macro_redefined) CppReason(CPP_W_BUILTIN_MACRO_REDEFINED) Var(cpp_warn_builtin_macro_redefined) Init(1) Warning
a7b2e184 418Warn when a built-in preprocessor macro is undefined or redefined.
c047ce93 419
9f936c86 420Wc11-c2x-compat
175a85b2 421C ObjC CPP(cpp_warn_c11_c2x_compat) CppReason(CPP_W_C11_C2X_COMPAT) Var(warn_c11_c2x_compat) Init(-1) Warning
9f936c86
JM
422Warn about features not present in ISO C11, but present in ISO C2X.
423
f3bede71 424Wc90-c99-compat
b559c810 425C ObjC CPP(cpp_warn_c90_c99_compat) CppReason(CPP_W_C90_C99_COMPAT) Var(warn_c90_c99_compat) Init(-1) Warning
a7b2e184 426Warn about features not present in ISO C90, but present in ISO C99.
f3bede71 427
35aff4fb
MP
428Wc99-c11-compat
429C ObjC Var(warn_c99_c11_compat) Init(-1) Warning
a7b2e184 430Warn about features not present in ISO C99, but present in ISO C11.
35aff4fb 431
b7e20b53 432Wc++-compat
b559c810 433C ObjC Var(warn_cxx_compat) CPP(warn_cxx_operator_names) CppReason(CPP_W_CXX_OPERATOR_NAMES) Init(0) Warning
a7b2e184 434Warn about C constructs that are not in the common subset of C and C++.
b7e20b53 435
e1f1ee86 436Wc++0x-compat
765189ff 437C++ ObjC++ Warning Alias(Wc++11-compat) Undocumented
97e3ad20
JM
438
439Wc++11-compat
765189ff 440C++ ObjC++ Var(warn_cxx11_compat) Warning LangEnabledBy(C++ ObjC++,Wall) Init(0) CPP(cpp_warn_cxx11_compat) CppReason(CPP_W_CXX11_COMPAT)
a7b2e184 441Warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++ 2011.
b7e20b53 442
20b06add
JM
443Wc++14-compat
444C++ ObjC++ Var(warn_cxx14_compat) Warning LangEnabledBy(C++ ObjC++,Wall)
a7b2e184 445Warn about C++ constructs whose meaning differs between ISO C++ 2011 and ISO C++ 2014.
20b06add 446
51dc6603 447Wc++1z-compat
7b936140 448C++ ObjC++ Warning Alias(Wc++17-compat) Undocumented
51dc6603
JM
449
450Wc++17-compat
7b936140
JJ
451C++ ObjC++ Var(warn_cxx17_compat) Warning LangEnabledBy(C++ ObjC++,Wall)
452Warn about C++ constructs whose meaning differs between ISO C++ 2014 and ISO C++ 2017.
51dc6603 453
4742dbe7
MP
454Wc++2a-compat
455C++ ObjC++ Warning Alias(Wc++20-compat) Undocumented
456
457Wc++20-compat
60468d6c 458C++ ObjC++ Var(warn_cxx20_compat) Warning LangEnabledBy(C++ ObjC++,Wall) Init(0) CPP(cpp_warn_cxx20_compat) CppReason(CPP_W_CXX20_COMPAT)
4742dbe7
MP
459Warn about C++ constructs whose meaning differs between ISO C++ 2017 and ISO C++ 2020.
460
ee336ecb 461Wc++11-extensions
0087f360 462C++ ObjC++ Var(warn_cxx11_extensions) Warning Init(1)
ee336ecb
JW
463Warn about C++11 constructs in code compiled with an older standard.
464
465Wc++14-extensions
0087f360 466C++ ObjC++ Var(warn_cxx14_extensions) Warning Init(1)
ee336ecb
JW
467Warn about C++14 constructs in code compiled with an older standard.
468
469Wc++17-extensions
0087f360 470C++ ObjC++ Var(warn_cxx17_extensions) Warning Init(1)
ee336ecb
JW
471Warn about C++17 constructs in code compiled with an older standard.
472
473Wc++20-extensions
0087f360 474C++ ObjC++ Var(warn_cxx20_extensions) Warning Init(1)
ee336ecb
JW
475Warn about C++20 constructs in code compiled with an older standard.
476
477Wc++23-extensions
0087f360 478C++ ObjC++ Var(warn_cxx23_extensions) Warning Init(1)
ee336ecb
JW
479Warn about C++23 constructs in code compiled with an older standard.
480
c65e18d3
BE
481Wcast-function-type
482C ObjC C++ ObjC++ Var(warn_cast_function_type) Warning EnabledBy(Wextra)
483Warn about casts between incompatible function types.
484
fef3106c 485Wcast-qual
c662432e 486C ObjC C++ ObjC++ Var(warn_cast_qual) Warning
a7b2e184 487Warn about casts which discard qualifiers.
fef3106c 488
3fa4634c
VR
489Wcatch-value
490C++ ObjC++ Warning Alias(Wcatch-value=, 1, 0)
491Warn about catch handlers of non-reference type.
492
63dbcd13 493Wcatch-value=
b22dbd03 494C++ ObjC++ Var(warn_catch_value) Warning Joined RejectNegative UInteger LangEnabledBy(C++ ObjC++,Wall, 1, 0) IntegerRange(0, 3)
63dbcd13
VR
495Warn about catch handlers of non-reference type.
496
fef3106c 497Wchar-subscripts
4a0ae68e 498C ObjC C++ ObjC++ Var(warn_char_subscripts) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 499Warn about subscripts whose type is \"char\".
fef3106c 500
d5e254e1 501Wchkp
68a57628 502C ObjC C++ ObjC++ Warning WarnRemoved
f48ef52e 503Removed in GCC 9. This switch has no effect.
d5e254e1 504
2b001724 505Wclobbered
95744782 506C ObjC C++ ObjC++ Var(warn_clobbered) Warning EnabledBy(Wextra)
a7b2e184 507Warn about variables that might be changed by \"longjmp\" or \"vfork\".
2b001724 508
ab574db6
MP
509Wcomma-subscript
510C++ ObjC++ Var(warn_comma_subscript) Warning
511Warn about uses of a comma operator within a subscripting expression.
512
fef3106c 513Wcomment
b559c810 514C ObjC C++ ObjC++ CPP(warn_comments) CppReason(CPP_W_COMMENTS) Var(cpp_warn_comment) Init(0) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 515Warn about possibly nested block comments, and C++ comments spanning more than one physical line.
fef3106c
NB
516
517Wcomments
5de8299c 518C ObjC C++ ObjC++ Warning Alias(Wcomment)
a7b2e184 519Synonym for -Wcomment.
fef3106c 520
dfeadaa0
PC
521Wconditionally-supported
522C++ ObjC++ Var(warn_conditionally_supported) Warning
a7b2e184 523Warn for conditionally-supported constructs.
dfeadaa0 524
fef3106c 525Wconversion
c662432e 526C ObjC C++ ObjC++ Var(warn_conversion) Warning
a7b2e184 527Warn for implicit type conversions that may change a value.
fef3106c 528
17251338
MLI
529Wconversion-null
530C++ ObjC++ Var(warn_conversion_null) Init(1) Warning
a7b2e184 531Warn for converting NULL from/to a non-pointer type.
17251338 532
b559c810
MLI
533Wcpp
534C ObjC C++ ObjC++ CppReason(CPP_W_WARNING_DIRECTIVE)
535; Documented in common.opt
536
7029dfa3
MP
537Wctad-maybe-unsupported
538C++ ObjC++ Var(warn_ctad_maybe_unsupported) Warning
539Warn when performing class template argument deduction on a type with no
540deduction guides.
541
fef3106c 542Wctor-dtor-privacy
c662432e 543C++ ObjC++ Var(warn_ctor_dtor_privacy) Warning
a7b2e184 544Warn when all constructors and destructors are private.
deef7113
MP
545
546Wdangling-else
547C ObjC C++ ObjC++ Var(warn_dangling_else) Warning LangEnabledBy(C ObjC C++ ObjC++,Wparentheses)
548Warn about dangling else.
fef3106c 549
9d6a0f38
MS
550Wdangling-pointer
551C ObjC C++ LTO ObjC++ Alias(Wdangling-pointer=, 2, 0) Warning
552Warn for uses of pointers to auto variables whose lifetime has ended.
553
554Wdangling-pointer=
555C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_dangling_pointer) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 2, 0) IntegerRange(0, 2)
556Warn for uses of pointers to auto variables whose lifetime has ended.
557
d2249cd9
MP
558Wdangling-reference
559C++ ObjC++ Var(warn_dangling_reference) Warning LangEnabledBy(C++ ObjC++, Wall)
560Warn when a reference is bound to a temporary whose lifetime has ended.
561
b559c810
MLI
562Wdate-time
563C ObjC C++ ObjC++ CPP(warn_date_time) CppReason(CPP_W_DATE_TIME) Var(cpp_warn_date_time) Init(0) Warning
a7b2e184 564Warn about __TIME__, __DATE__ and __TIMESTAMP__ usage.
b559c810 565
85617eba 566Wdeclaration-after-statement
177cce46 567C ObjC Var(warn_declaration_after_statement) Init(-1) Warning
a7b2e184 568Warn when a declaration is found after a statement.
85617eba 569
c9b0866a
PC
570Wdelete-incomplete
571C++ ObjC++ Var(warn_delete_incomplete) Init(1) Warning
a7b2e184 572Warn when deleting a pointer to incomplete type.
c9b0866a 573
014ab419 574Wdelete-non-virtual-dtor
27e51192 575C++ ObjC++ Var(warn_delnonvdtor) Warning LangEnabledBy(C++ ObjC++,Wall || Weffc++)
a7b2e184 576Warn about deleting polymorphic objects with non-virtual destructors.
014ab419 577
fef3106c 578Wdeprecated
99063eee
RS
579C C++ ObjC ObjC++ CPP(cpp_warn_deprecated) CppReason(CPP_W_DEPRECATED)
580; Documented in common.opt
fef3106c 581
b46b715d 582Wdeprecated-copy
5c8b3702
JM
583C++ ObjC++ Var(warn_deprecated_copy) Warning LangEnabledBy(C++ ObjC++, Wextra)
584Mark implicitly-declared copy operations as deprecated if the class has a
585user-provided copy operation.
586
587Wdeprecated-copy-dtor
588C++ ObjC++ Var(warn_deprecated_copy, 2) Warning
b46b715d
JM
589Mark implicitly-declared copy operations as deprecated if the class has a
590user-provided copy operation or destructor.
591
455ade18
MP
592Wdeprecated-enum-enum-conversion
593C++ ObjC++ Var(warn_deprecated_enum_enum_conv) Warning
594Warn about deprecated arithmetic conversions on operands of enumeration types.
595
596Wdeprecated-enum-float-conversion
597C++ ObjC++ Var(warn_deprecated_enum_float_conv) Warning
598Warn about deprecated arithmetic conversions on operands where one is of enumeration
599type and the other is of a floating-point type.
600
976d5a22
TT
601Wdesignated-init
602C ObjC Var(warn_designated_init) Init(1) Warning
a7b2e184 603Warn about positional initialization of structs requiring designated initializers.
976d5a22 604
768952be
MU
605Wdiscarded-array-qualifiers
606C ObjC Var(warn_discarded_array_qualifiers) Init(1) Warning
a7b2e184 607Warn if qualifiers on arrays which are pointer targets are discarded.
768952be 608
d00887e8
MP
609Wdiscarded-qualifiers
610C ObjC Var(warn_discarded_qualifiers) Init(1) Warning
a7b2e184 611Warn if type qualifiers on pointers are discarded.
d00887e8 612
fef3106c 613Wdiv-by-zero
2cbac420 614C ObjC C++ ObjC++ Var(warn_div_by_zero) Init(1) Warning
a7b2e184 615Warn about compile-time integer division by zero.
fef3106c 616
2ebd93e1
MP
617Wduplicated-branches
618C ObjC C++ ObjC++ Var(warn_duplicated_branches) Init(0) Warning
619Warn about duplicated branches in if-else statements.
620
3e3b8d63 621Wduplicated-cond
12651878 622C ObjC C++ ObjC++ Var(warn_duplicated_cond) Init(0) Warning
a7b2e184 623Warn about duplicated conditions in an if-else-if chain.
3e3b8d63 624
fef3106c 625Weffc++
c662432e 626C++ ObjC++ Var(warn_ecpp) Warning
a7b2e184 627Warn about violations of Effective C++ style rules.
fef3106c 628
b3b433c5 629Wempty-body
95744782 630C ObjC C++ ObjC++ Var(warn_empty_body) Warning EnabledBy(Wextra)
a7b2e184 631Warn about an empty body in an if or else statement.
b3b433c5 632
fef3106c 633Wendif-labels
b559c810 634C 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 635Warn about stray tokens after #else and #endif.
fef3106c 636
a3299096 637Wenum-compare
27e51192 638C ObjC C++ ObjC++ Var(warn_enum_compare) Init(-1) Warning LangEnabledBy(C ObjC,Wall || Wc++-compat)
a7b2e184 639Warn about comparison of different enum types.
a3299096 640
68e2c199 641Wenum-conversion
455ade18 642C ObjC C++ ObjC++ Var(warn_enum_conversion) Init(0) Warning LangEnabledBy(C ObjC,Wextra)
68e2c199
PK
643Warn about implicit conversion of enum types.
644
7da9a089
MP
645Wenum-int-mismatch
646C ObjC Var(warn_enum_int_mismatch) Warning LangEnabledBy(C ObjC,Wall || Wc++-compat)
647Warn about enum/integer type mismatches.
648
fef3106c
NB
649Werror
650C ObjC C++ ObjC++
72de27ea 651; Documented in common.opt
fef3106c
NB
652
653Werror-implicit-function-declaration
5de8299c 654C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration)
a7b2e184 655This switch is deprecated; use -Werror=implicit-function-declaration instead.
fef3106c 656
1d87302a 657Wexceptions
40a2f888 658C++ ObjC++ Var(warn_exceptions) Init(1) Warning
1d87302a
MP
659Warn when an exception handler is shadowed by another handler.
660
70f6d5e1
JJ
661Wextra
662C ObjC C++ ObjC++ Warning
663; in common.opt
664
c3cbcd45
VR
665Wextra-semi
666C++ ObjC++ Var(warn_extra_semi) Warning
667Warn about semicolon after in-class function definition.
668
49b0aa18 669Wfloat-conversion
63bbf46d 670C ObjC C++ ObjC++ Var(warn_float_conversion) Warning LangEnabledBy(C ObjC C++ ObjC++,Wconversion)
a7b2e184 671Warn for implicit type conversions that cause loss of floating point precision.
49b0aa18 672
fef3106c 673Wfloat-equal
c662432e 674C ObjC C++ ObjC++ Var(warn_float_equal) Warning
a7b2e184 675Warn if testing floating point numbers for equality.
fef3106c
NB
676
677Wformat
7332899a 678C ObjC C++ ObjC++ Warning Alias(Wformat=, 1, 0)
a7b2e184 679Warn about printf/scanf/strftime/strfmon format string anomalies.
fef3106c 680
7332899a
MLI
681Wformat-contains-nul
682C ObjC C++ ObjC++ Var(warn_format_contains_nul) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 1, 0)
a7b2e184 683Warn about format strings that contain NUL bytes.
7332899a 684
a9c697b8
MS
685Wformat-diag
686C ObjC C++ ObjC++ Var(warn_format_diag) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 1, 0)
36b34127 687Warn about GCC format strings with strings unsuitable for diagnostics.
a9c697b8 688
fef3106c 689Wformat-extra-args
7332899a 690C ObjC C++ ObjC++ Var(warn_format_extra_args) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 1, 0)
a7b2e184 691Warn if passing too many arguments to a function for its format string.
fef3106c
NB
692
693Wformat-nonliteral
7332899a 694C ObjC C++ ObjC++ Var(warn_format_nonliteral) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
a7b2e184 695Warn about format strings that are not literals.
fef3106c 696
bce6f760 697Wformat-overflow
63010089 698C ObjC C++ LTO ObjC++ Warning Alias(Wformat-overflow=, 1, 0) IntegerRange(0, 2)
bce6f760
MS
699Warn about function calls with format strings that write past the end
700of the destination region. Same as -Wformat-overflow=1.
701
fef3106c 702Wformat-security
7332899a 703C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
a7b2e184 704Warn about possible security problems with format functions.
fef3106c 705
cbbd2b1c 706Wformat-signedness
7631f0e2 707C ObjC C++ ObjC++ Var(warn_format_signedness) Warning
a7b2e184 708Warn about sign differences with format functions.
cbbd2b1c 709
efcc8d38 710Wformat-truncation
bf5fbf46 711C ObjC C++ LTO ObjC++ Warning Alias(Wformat-truncation=, 1, 0)
efcc8d38
MS
712Warn about calls to snprintf and similar functions that truncate output.
713Same as -Wformat-truncation=1.
714
fef3106c 715Wformat-y2k
7332899a 716C ObjC C++ ObjC++ Var(warn_format_y2k) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=,warn_format >= 2, 0)
a7b2e184 717Warn about strftime formats yielding 2-digit years.
fef3106c
NB
718
719Wformat-zero-length
7332899a 720C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=,warn_format >= 1, 0)
a7b2e184 721Warn about zero-length formats.
fef3106c
NB
722
723Wformat=
63010089 724C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 2)
a7b2e184 725Warn about printf/scanf/strftime/strfmon format string anomalies.
fef3106c 726
bce6f760 727Wformat-overflow=
cea71f0a 728C 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
729Warn about function calls with format strings that write past the end
730of the destination region.
731
efcc8d38 732Wformat-truncation=
cea71f0a 733C 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
734Warn about calls to snprintf and similar functions that truncate output.
735
00aa1fa2
L
736Wif-not-aligned
737C ObjC C++ ObjC++ Var(warn_if_not_aligned) Init(1) Warning
738Warn when the field in a struct is not aligned.
739
5db2e9ca 740Wignored-qualifiers
95744782 741C C++ Var(warn_ignored_qualifiers) Warning EnabledBy(Wextra)
5db2e9ca
DK
742Warn whenever type qualifiers are ignored.
743
fbdb6baf
MP
744Wignored-attributes
745C C++ Var(warn_ignored_attributes) Init(1) Warning
746Warn whenever attributes are ignored.
747
d3786ebb
MB
748Winaccessible-base
749C++ ObjC++ Var(warn_inaccessible_base) Init(1) Warning
750Warn when a base is inaccessible in derived due to ambiguity.
751
d5c3d343
MP
752Wincompatible-pointer-types
753C ObjC Var(warn_incompatible_pointer_types) Init(1) Warning
a7b2e184 754Warn when there is a conversion between pointers that have incompatible types.
d5c3d343 755
30ba058f
MS
756Winfinite-recursion
757C ObjC C++ LTO ObjC++ Var(warn_infinite_recursion) Warning LangEnabledBy(C ObjC C++ LTO ObjC++, Wall)
758Warn for infinitely recursive calls.
759
da77eace
L
760Waddress-of-packed-member
761C ObjC C++ ObjC++ Var(warn_address_of_packed_member) Init(1) Warning
762Warn when the address of packed member of struct or union is taken.
763
3390f9c9 764Winit-self
0ccb505d 765C ObjC C++ ObjC++ Var(warn_init_self) Warning LangEnabledBy(C++ ObjC++,Wall)
a7b2e184 766Warn about variables which are initialized to themselves.
3390f9c9 767
04eb9c55
JM
768Winit-list-lifetime
769C++ ObjC++ Var(warn_init_list) Warning Init(1)
770Warn about uses of std::initializer_list that can result in dangling pointers.
771
76b75018
JM
772Winterference-size
773C++ ObjC++ Var(warn_interference_size) Warning Init(1)
774Warn about nonsensical values of --param destructive-interference-size or
775constructive-interference-size.
776
fef3106c 777Wimplicit
4a0ae68e 778C ObjC Var(warn_implicit) Warning LangEnabledBy(C ObjC,Wall)
a7b2e184 779Warn about implicit declarations.
fef3106c 780
70f6d5e1
JJ
781Wimplicit-fallthrough=
782LangEnabledBy(C ObjC C++ ObjC++,Wextra,3,0)
783; in common.opt
784
0a0b3574
MM
785Wdouble-promotion
786C ObjC C++ ObjC++ Var(warn_double_promotion) Warning
a7b2e184 787Warn about implicit conversions from \"float\" to \"double\".
0a0b3574 788
fb2675cb
PB
789Wexpansion-to-defined
790C 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)
791Warn if \"defined\" is used outside #if.
792
fef3106c 793Wimplicit-function-declaration
4a0ae68e 794C ObjC Var(warn_implicit_function_declaration) Init(-1) Warning LangEnabledBy(C ObjC,Wimplicit)
a7b2e184 795Warn about implicit function declarations.
fef3106c
NB
796
797Wimplicit-int
92574c7c 798C ObjC Var(warn_implicit_int) Init(-1) Warning LangEnabledBy(C ObjC,Wimplicit)
a7b2e184 799Warn when a declaration does not specify a type.
fef3106c
NB
800
801Wimport
2d2bd949 802C ObjC C++ ObjC++ Undocumented Ignore
fef3106c 803
4514a96b
JM
804Winherited-variadic-ctor
805C++ ObjC++ Var(warn_inh_var_ctor) Init(1) Warning
a7b2e184 806Warn about C++11 inheriting constructors when the base has a variadic constructor.
4514a96b 807
52ec0ea3
MP
808Wint-conversion
809C ObjC Var(warn_int_conversion) Init(1) Warning
a7b2e184 810Warn about incompatible integer to pointer and pointer to integer conversions.
52ec0ea3 811
144a96e4
BE
812Wint-in-bool-context
813C ObjC C++ ObjC++ Var(warn_int_in_bool_context) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
814Warn for suspicious integer expressions in boolean context.
815
53a2494e 816Wint-to-pointer-cast
dc8d2739 817C ObjC C++ ObjC++ Var(warn_int_to_pointer_cast) Init(1) Warning
a7b2e184 818Warn when there is a cast to a pointer from an integer of a different size.
53a2494e 819
c85f8dbb
MP
820Winvalid-constexpr
821C++ ObjC++ Var(warn_invalid_constexpr) Init(-1) Warning
822Warn when a function never produces a constant expression.
823
fef3106c 824Winvalid-offsetof
c662432e 825C++ ObjC++ Var(warn_invalid_offsetof) Init(1) Warning
a7b2e184 826Warn about invalid uses of the \"offsetof\" macro.
fef3106c
NB
827
828Winvalid-pch
b559c810 829C ObjC C++ ObjC++ CPP(warn_invalid_pch) CppReason(CPP_W_INVALID_PCH) Var(cpp_warn_invalid_pch) Init(0) Warning
a7b2e184 830Warn about PCH files that are found but not used.
fef3106c 831
0b8c57ed 832Winvalid-utf8
572f5e1b
JJ
833C ObjC C++ ObjC++ CPP(cpp_warn_invalid_utf8) CppReason(CPP_W_INVALID_UTF8) Var(warn_invalid_utf8) Init(0) Warning
834Warn about invalid UTF-8 characters.
0b8c57ed 835
e1b7793c 836Wjump-misses-init
f2bc201f 837C ObjC Var(warn_jump_misses_init) Warning LangEnabledby(C ObjC,Wc++-compat)
a7b2e184 838Warn when a jump misses a variable initialization.
e1b7793c 839
7f5f5f98 840Wliteral-suffix
b559c810 841C++ ObjC++ CPP(warn_literal_suffix) CppReason(CPP_W_LITERAL_SUFFIX) Var(cpp_warn_literal_suffix) Init(1) Warning
7f5f5f98
OW
842Warn when a string or character literal is followed by a ud-suffix which does not begin with an underscore.
843
ca409efd 844Wlogical-op
a7b2e184
MS
845C ObjC C++ ObjC++ Var(warn_logical_op) Init(0) Warning
846Warn when a logical operator is suspiciously always evaluating to true or false.
ca409efd 847
742938c9 848Wlogical-not-parentheses
d2e4feca 849C ObjC C++ ObjC++ Var(warn_logical_not_paren) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 850Warn when logical not is used on the left hand side operand of a comparison.
742938c9 851
fef3106c 852Wlong-long
b559c810 853C 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 854Do not warn about using \"long long\" when -pedantic.
fef3106c
NB
855
856Wmain
34a180a6 857C ObjC C++ ObjC++ Var(warn_main) Init(-1) Warning LangEnabledBy(C ObjC,Wall, 2, 0)
a7b2e184 858Warn about suspicious declarations of \"main\".
fef3106c 859
34a180a6
MLI
860Wmain
861LangEnabledBy(C ObjC C++ ObjC++,Wpedantic, 2, 0)
862;
863
b108f48f
JJ
864Wmemset-transposed-args
865C ObjC C++ ObjC++ Var(warn_memset_transposed_args) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 866Warn about suspicious calls to memset where the third argument is constant literal zero and the second is not.
b108f48f 867
c1e1f433
BS
868Wmemset-elt-size
869C ObjC C++ ObjC++ Var(warn_memset_elt_size) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
870Warn about suspicious calls to memset where the third argument contains the number of elements not multiplied by the element size.
871
c3388e62 872Wmisleading-indentation
f6069ccc 873C C++ Common Var(warn_misleading_indentation) Warning LangEnabledBy(C C++,Wall)
a7b2e184 874Warn when the indentation of the code does not reflect the block structure.
c3388e62 875
dce6c58d
MS
876Wmismatched-dealloc
877C ObjC C++ ObjC++ Var(warn_mismatched_alloc) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
878Warn for deallocation calls with arguments returned from mismatched allocation
879functions.
880
881Wmismatched-new-delete
882C++ ObjC++ Var(warn_mismatched_new_delete) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
d6cc745c 883Warn for mismatches between calls to operator new or delete and the corresponding
dce6c58d
MS
884call to the allocation or deallocation function.
885
e8f1ade2
MS
886Wmismatched-tags
887C++ ObjC++ Var(warn_mismatched_tags) Warning
888Warn when a class is redeclared or referenced using a mismatched class-key.
889
fef3106c 890Wmissing-braces
4f7f7aca 891C ObjC C++ ObjC++ Var(warn_missing_braces) Warning LangEnabledBy(C ObjC,Wall)
a7b2e184 892Warn about possibly missing braces around initializers.
fef3106c
NB
893
894Wmissing-declarations
c662432e 895C ObjC C++ ObjC++ Var(warn_missing_declarations) Warning
a7b2e184 896Warn about global functions without previous declarations.
fef3106c 897
eaac4679 898Wmissing-field-initializers
95744782 899C ObjC C++ ObjC++ Var(warn_missing_field_initializers) Warning EnabledBy(Wextra)
a7b2e184 900Warn about missing fields in struct initializers.
eaac4679 901
e18e56c7
JM
902Wmissing-requires
903C++ ObjC++ Var(warn_missing_requires) Init(1) Warning
904Warn about likely missing requires keyword.
905
b8ffa71e
AS
906Wmissing-template-keyword
907C++ ObjC++ Var(warn_missing_template_keyword) Init(1) Warning
908Warn when the template keyword is missing after a member access token in a dependent member access expression if that member is a template.
909
3e2becc4
MP
910Wmultistatement-macros
911C ObjC C++ ObjC++ Var(warn_multistatement_macros) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
912Warn about unsafe macros expanding to multiple statements used as a body of a clause such as if, else, while, switch, or for.
913
6b333269
NS
914Wmultiple-inheritance
915C++ ObjC++ Var(warn_multiple_inheritance) Warning
a7b2e184 916Warn on direct multiple inheritance.
6b333269
NS
917
918Wnamespaces
919C++ ObjC++ Var(warn_namespaces) Warning
a7b2e184 920Warn on namespace definition.
6b333269 921
00aa1fa2
L
922Wpacked-not-aligned
923C ObjC C++ ObjC++ Var(warn_packed_not_aligned) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
924Warn when fields in a struct with the packed attribute are misaligned.
925
969baf03
MP
926Wrange-loop-construct
927C++ ObjC++ Var(warn_range_loop_construct) Warning LangEnabledBy(C++ ObjC++,Wall)
928Warn when a range-based for-loop is creating unnecessary copies.
929
e8f1ade2
MS
930Wredundant-tags
931C++ ObjC++ Var(warn_redundant_tags) Warning
932Warn when a class or enumerated type is referenced using a redundant class-key.
933
20b06add
JM
934Wsized-deallocation
935C++ ObjC++ Var(warn_sized_deallocation) Warning EnabledBy(Wextra)
a7b2e184 936Warn about missing sized deallocation functions.
20b06add 937
40ffd95f
BE
938Wsizeof-pointer-div
939C ObjC C++ ObjC++ Var(warn_sizeof_pointer_div) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
940Warn about suspicious divisions of two sizeof expressions that don't work correctly with pointers.
941
83f83ddf
MP
942Wsizeof-array-div
943C ObjC C++ ObjC++ Var(warn_sizeof_array_div) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
944Warn about divisions of two sizeof operators when the first one is applied
945to an array and the divisor does not equal the size of the array element.
946
1a4049e7 947Wsizeof-pointer-memaccess
4a0ae68e 948C ObjC C++ ObjC++ Var(warn_sizeof_pointer_memaccess) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 949Warn about suspicious length parameters to certain string functions if the argument uses sizeof.
1a4049e7 950
773ec47f
MP
951Wsizeof-array-argument
952C ObjC C++ ObjC++ Var(warn_sizeof_array_argument) Warning Init(1)
a7b2e184 953Warn when sizeof is applied on a parameter declared as an array.
773ec47f 954
a7160771
MS
955Wstring-compare
956C ObjC C++ LTO ObjC++ Warning Var(warn_string_compare) Warning LangEnabledBy(C ObjC C++ ObjC++, Wextra)
957Warn about calls to strcmp and strncmp used in equality expressions that
958are necessarily true or false due to the length of one and size of the other
959argument.
960
ee92e7ba 961Wstringop-overflow
cea71f0a 962C ObjC C++ LTO ObjC++ Warning Alias(Wstringop-overflow=, 2, 0)
ee92e7ba
MS
963Warn about buffer overflow in string manipulation functions like memcpy
964and strcpy.
965
966Wstringop-overflow=
cea71f0a 967C 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
968Under the control of Object Size type, warn about buffer overflow in string
969manipulation functions like memcpy and strcpy.
970
d14c547a
MS
971Wstringop-overread
972C ObjC C++ LTO ObjC++ Var(warn_stringop_overread) Init(1) Warning LangEnabledBy(C ObjC C++ LTO ObjC++, Wall)
973Warn about reading past the end of a source array in string manipulation functions like memchr and memcpy.
974
025d57f0 975Wstringop-truncation
cea71f0a 976C ObjC C++ LTO ObjC++ Var(warn_stringop_truncation) Warning Init (1) LangEnabledBy(C ObjC C++ LTO ObjC++, Wall)
025d57f0
MS
977Warn about truncation in string manipulation functions like strncat and strncpy.
978
2a27ae32
QZ
979Wstrict-flex-arrays
980C C++ Var(warn_strict_flex_arrays) Warning
981Warn about inproper usages of flexible array members
982according to the level of -fstrict-flex-arrays.
983
90137d8f
MLI
984Wsuggest-attribute=format
985C ObjC C++ ObjC++ Var(warn_suggest_attribute_format) Warning
a7b2e184 986Warn about functions which might be candidates for format attributes.
fef3106c 987
2f42e5de
TS
988Wsuggest-override
989C++ ObjC++ Var(warn_override) Warning
990Suggest that the override keyword be used when the declaration of a virtual
991function overrides another.
992
34a180a6
MLI
993Wswitch
994C ObjC C++ ObjC++ Var(warn_switch) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 995Warn about enumerated switches, with no default, missing a case.
34a180a6
MLI
996
997Wswitch-default
998C ObjC C++ ObjC++ Var(warn_switch_default) Warning
a7b2e184 999Warn about enumerated switches missing a \"default:\" statement.
34a180a6
MLI
1000
1001Wswitch-enum
1002C ObjC C++ ObjC++ Var(warn_switch_enum) Warning
a7b2e184 1003Warn about all enumerated switches missing a specific case.
34a180a6 1004
fedfecef 1005Wswitch-bool
5c3d09f7 1006C ObjC C++ ObjC++ Var(warn_switch_bool) Warning Init(1)
a7b2e184 1007Warn about switches with boolean controlling expression.
fedfecef 1008
da9e9b57
MB
1009Wswitch-outside-range
1010C ObjC C++ ObjC++ Var(warn_switch_outside_range) Warning Init(1)
1011Warn about switch values that are outside of the switch's type range.
1012
6b333269
NS
1013Wtemplates
1014C++ ObjC++ Var(warn_templates) Warning
a7b2e184 1015Warn on primary template declaration.
6b333269 1016
d4cfd486
MS
1017Wmissing-attributes
1018C ObjC C++ ObjC++ Var(warn_missing_attributes) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
1019Warn about declarations of entities that may be missing attributes
d3a02ae5 1020that related entities have been declared with.
d4cfd486 1021
90137d8f 1022Wmissing-format-attribute
54d62f51 1023C ObjC C++ ObjC++ Warning Alias(Wsuggest-attribute=format)
90137d8f
MLI
1024;
1025
b02398bd 1026Wmissing-include-dirs
b559c810 1027C ObjC C++ ObjC++ CPP(warn_missing_include_dirs) CppReason(CPP_W_MISSING_INCLUDE_DIRS) Var(cpp_warn_missing_include_dirs) Init(0) Warning
a7b2e184 1028Warn about user-specified include directories that do not exist.
b02398bd 1029
cb4af25a 1030Wmissing-parameter-type
95744782 1031C ObjC Var(warn_missing_parameter_type) Warning EnabledBy(Wextra)
a7b2e184 1032Warn about function parameters declared without a type specifier in K&R-style functions.
cb4af25a 1033
fef3106c 1034Wmissing-prototypes
c662432e 1035C ObjC Var(warn_missing_prototypes) Warning
a7b2e184 1036Warn about global functions without prototypes.
fef3106c 1037
5720c0dc 1038Wmudflap
68a57628 1039C ObjC C++ ObjC++ WarnRemoved
5720c0dc 1040
fef3106c 1041Wmultichar
b559c810 1042C ObjC C++ ObjC++ CPP(warn_multichar) CppReason(CPP_W_MULTICHAR) Var(cpp_warn_multichar) Init(0) Warning
a7b2e184 1043Warn about use of multi-character character constants.
fef3106c 1044
76f86d00 1045Wnarrowing
765189ff 1046C ObjC C++ ObjC++ Warning Var(warn_narrowing) Init(-1) LangEnabledBy(C++ ObjC++,Wall || Wc++11-compat)
a7b2e184 1047Warn about narrowing conversions within { } that are ill-formed in C++11.
76f86d00 1048
fef3106c 1049Wnested-externs
c662432e 1050C ObjC Var(warn_nested_externs) Warning
a7b2e184 1051Warn about \"extern\" declarations not at file scope.
fef3106c 1052
59f9c2ed
JM
1053Wnoexcept
1054C++ ObjC++ Var(warn_noexcept) Warning
a7b2e184 1055Warn when a noexcept expression evaluates to false even though the expression can't actually throw.
59f9c2ed 1056
108154ff 1057Wnoexcept-type
7b936140
JJ
1058C++ ObjC++ Warning Var(warn_noexcept_type) LangEnabledBy(C++ ObjC++,Wabi || Wc++17-compat)
1059Warn if C++17 noexcept function type will change the mangled name of a symbol.
108154ff 1060
fef3106c 1061Wnon-template-friend
c662432e 1062C++ ObjC++ Var(warn_nontemplate_friend) Init(1) Warning
a7b2e184 1063Warn when non-templatized friend functions are declared within a template.
fef3106c 1064
a599af84
MP
1065Wclass-conversion
1066C++ ObjC++ Var(warn_class_conversion) Init(1) Warning
1067Warn when a conversion function will never be called due to the type it converts to.
1068
c3684b7b
MS
1069Wclass-memaccess
1070C++ ObjC++ Var(warn_class_memaccess) Warning LangEnabledBy(C++ ObjC++, Wall)
1071Warn for unsafe raw memory writes to objects of class types.
1072
fef3106c 1073Wnon-virtual-dtor
880a467b 1074C++ ObjC++ Var(warn_nonvdtor) Warning LangEnabledBy(C++ ObjC++,Weffc++)
a7b2e184 1075Warn about non-virtual destructors.
fef3106c
NB
1076
1077Wnonnull
cea71f0a 1078C ObjC C++ LTO ObjC++ Var(warn_nonnull) Warning LangEnabledBy(C ObjC C++ LTO ObjC++,Wformat=,warn_format >= 1,0)
a7b2e184 1079Warn about NULL being passed to argument slots marked as requiring non-NULL.
fef3106c 1080
7332899a 1081Wnonnull
cea71f0a 1082C ObjC C++ LTO ObjC++ LangEnabledBy(C ObjC C++ LTO ObjC++,Wall)
7332899a
MLI
1083;
1084
bf14eba2
JJ
1085Wnonnull-compare
1086C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall)
1087;
1088
1ef33fd4 1089Wnormalized
54d62f51 1090C ObjC C++ ObjC++ Warning Alias(Wnormalized=,nfc,none)
1ef33fd4
MLI
1091;
1092
50668cf6 1093Wnormalized=
b559c810 1094C 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 1095-Wnormalized=[none|id|nfc|nfkc] Warn about non-normalized Unicode strings.
1ef33fd4
MLI
1096
1097; Required for these enum values.
1098SourceInclude
1099cpplib.h
1100
1101Enum
1102Name(cpp_normalize_level) Type(int) UnknownError(argument %qs to %<-Wnormalized%> not recognized)
1103
1104EnumValue
1105Enum(cpp_normalize_level) String(none) Value(normalized_none)
1106
1107EnumValue
1108Enum(cpp_normalize_level) String(nfkc) Value(normalized_KC)
1109
1110EnumValue
1111Enum(cpp_normalize_level) String(id) Value(normalized_identifier_C)
1112
1113EnumValue
1114Enum(cpp_normalize_level) String(nfc) Value(normalized_C)
50668cf6 1115
3fe07cde
IS
1116Wobjc-root-class
1117ObjC ObjC++ Var(warn_objc_root_class) Warning Init(1)
1118Warn if a class interface has no superclass. Root classes may use an attribute
1119to suppress this warning.
1120
fef3106c 1121Wold-style-cast
c662432e 1122C++ ObjC++ Var(warn_old_style_cast) Warning
a7b2e184 1123Warn if a C-style cast is used in a program.
fef3106c 1124
b1ed4cb4 1125Wold-style-declaration
95744782 1126C ObjC Var(warn_old_style_declaration) Warning EnabledBy(Wextra)
a7b2e184 1127Warn for obsolescent usage in a declaration.
b1ed4cb4 1128
c034f121 1129Wold-style-definition
017c6491 1130C ObjC Var(warn_old_style_definition) Init(-1) Warning
a7b2e184 1131Warn if an old-style parameter definition is used.
c034f121 1132
22cff118
TS
1133Wopenacc-parallelism
1134C C++ Var(warn_openacc_parallelism) Warning
1135Warn about potentially suboptimal choices related to OpenACC parallelism.
1136
8b5e1202
SO
1137Wopenmp-simd
1138C C++ Var(warn_openmp_simd) Warning LangEnabledBy(C C++,Wall)
a7b2e184 1139Warn if a simd directive is overridden by the vectorizer cost model.
8b5e1202 1140
89a42ac8 1141Woverlength-strings
34a180a6 1142C ObjC C++ ObjC++ Var(warn_overlength_strings) Warning LangEnabledBy(C ObjC C++ ObjC++,Wpedantic)
a7b2e184 1143Warn if a string is longer than the maximum portable length specified by the standard.
89a42ac8 1144
fef3106c 1145Woverloaded-virtual
113844d6
JM
1146C++ ObjC++ Warning Alias(Woverloaded-virtual=,2,0)
1147Warn about overloaded virtual function names.
1148
1149Woverloaded-virtual=
1150C++ ObjC++ Joined UInteger IntegerRange(0,2) Var(warn_overloaded_virtual) Warning LangEnabledBy(C++ ObjC++,Wall,1,0)
a7b2e184 1151Warn about overloaded virtual function names.
fef3106c 1152
7ed322d7 1153Woverride-init
95744782 1154C ObjC Var(warn_override_init) Warning EnabledBy(Wextra)
a7b2e184 1155Warn about overriding initializers without side effects.
7ed322d7 1156
755e528f
MP
1157Woverride-init-side-effects
1158C ObjC Var(warn_override_init_side_effects) Init(1) Warning
a7b2e184 1159Warn about overriding initializers with side effects.
755e528f 1160
2cd36c22 1161Wpacked-bitfield-compat
bee6fa6d 1162C ObjC C++ ObjC++ Var(warn_packed_bitfield_compat) Init(-1) Warning
a7b2e184 1163Warn about packed bit-fields whose offset changed in GCC 4.4.
2cd36c22 1164
fef3106c 1165Wparentheses
4a0ae68e 1166C ObjC C++ ObjC++ Var(warn_parentheses) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 1167Warn about possibly missing parentheses.
fef3106c 1168
c1771a20 1169Wpedantic
b559c810 1170C ObjC C++ ObjC++ CPP(cpp_pedantic) CppReason(CPP_W_PEDANTIC) Warning
c1771a20
MLI
1171; Documented in common.opt
1172
79ca9c35
MP
1173Wpessimizing-move
1174C++ ObjC++ Var(warn_pessimizing_move) Warning LangEnabledBy(C++ ObjC++, Wall)
1175Warn about calling std::move on a local object in a return statement preventing copy elision.
1176
fef3106c 1177Wpmf-conversions
c662432e 1178C++ ObjC++ Var(warn_pmf2ptr) Init(1) Warning
a7b2e184 1179Warn when converting the type of pointers to member functions.
fef3106c
NB
1180
1181Wpointer-arith
44d90fe1 1182C ObjC C++ ObjC++ Var(warn_pointer_arith) Warning LangEnabledBy(C ObjC C++ ObjC++,Wpedantic)
a7b2e184 1183Warn about function pointer arithmetic.
fef3106c 1184
4a0ae68e 1185Wpointer-sign
27e51192 1186C ObjC Var(warn_pointer_sign) Warning LangEnabledBy(C ObjC,Wall || Wpedantic)
a7b2e184 1187Warn when a pointer differs in signedness in an assignment.
4a0ae68e 1188
a9342885
MP
1189Wpointer-compare
1190C ObjC C++ ObjC++ Var(warn_pointer_compare) Init(1) Warning
1191Warn when a pointer is compared with a zero character constant.
1192
53a2494e 1193Wpointer-to-int-cast
c662432e 1194C ObjC Var(warn_pointer_to_int_cast) Init(1) Warning
a7b2e184 1195Warn when a pointer is cast to an integer of a different size.
53a2494e 1196
b9b8dde3 1197Wpragmas
c662432e 1198C ObjC C++ ObjC++ Var(warn_pragmas) Init(1) Warning
a7b2e184 1199Warn about misuses of pragmas.
b9b8dde3 1200
8cff0652
VK
1201Wprio-ctor-dtor
1202C ObjC C++ ObjC++ Var(warn_prio_ctor_dtor) Init(1) Warning
1203Warn if constructor or destructors with priorities from 0 to 100 are used.
1204
9a179d01
NP
1205Wproperty-assign-default
1206ObjC ObjC++ Var(warn_property_assign_default) Init(1) Warning
a7b2e184 1207Warn if a property for an Objective-C object has no assign semantics specified.
9a179d01 1208
fef3106c 1209Wprotocol
c662432e 1210ObjC ObjC++ Var(warn_protocol) Init(1) Warning
a7b2e184 1211Warn if inherited methods are unimplemented.
fef3106c 1212
e2f5cc96 1213Wplacement-new
46cb9332
MS
1214C++ Warning Alias(Wplacement-new=, 1, 0)
1215Warn for placement new expressions with undefined behavior.
1216
1217Wplacement-new=
63010089 1218C++ Joined RejectNegative UInteger Var(warn_placement_new) Init(-1) Warning IntegerRange(0, 2)
eb11eb15 1219Warn for placement new expressions with undefined behavior.
e2f5cc96 1220
fef3106c 1221Wredundant-decls
c662432e 1222C ObjC C++ ObjC++ Var(warn_redundant_decls) Warning
a7b2e184 1223Warn about multiple declarations of the same object.
fef3106c 1224
b5be6d0c
MP
1225Wredundant-move
1226C++ ObjC++ Var(warn_redundant_move) Warning LangEnabledBy(C++ ObjC++,Wextra)
1227Warn about redundant calls to std::move.
1228
a2c6e7f2
JJ
1229Wregister
1230C++ ObjC++ Var(warn_register) Warning
1231Warn about uses of register storage specifier.
1232
fef3106c 1233Wreorder
f2bc201f 1234C++ ObjC++ Var(warn_reorder) Warning LangEnabledBy(C++ ObjC++,Wall)
a7b2e184 1235Warn when the compiler reorders code.
fef3106c
NB
1236
1237Wreturn-type
1b6fa695 1238C ObjC C++ ObjC++ Var(warn_return_type) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) Init(-1)
a7b2e184 1239Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++).
fef3106c 1240
ee45a32d 1241Wscalar-storage-order
b541b871 1242C ObjC C++ ObjC++ Var(warn_scalar_storage_order) Init(1) Warning
ee45a32d
EB
1243Warn on suspicious constructs involving reverse scalar storage order.
1244
fef3106c 1245Wselector
c662432e 1246ObjC ObjC++ Var(warn_selector) Warning
a7b2e184 1247Warn if a selector has multiple methods.
fef3106c 1248
0abb78dd
MP
1249Wself-move
1250C++ ObjC++ Var(warn_self_move) Warning LangEnabledBy(C++ ObjC++, Wall)
1251Warn when a value is moved to itself with std::move.
1252
13c21655
PC
1253Wsequence-point
1254C ObjC C++ ObjC++ Var(warn_sequence_point) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 1255Warn about possible violations of sequence point rules.
13c21655 1256
dcaaa5a0 1257Wshadow-ivar
dff8943f 1258ObjC ObjC++ Var(warn_shadow_ivar) EnabledBy(Wshadow) Init(1) Warning
a7b2e184 1259Warn if a local declaration hides an instance variable.
dcaaa5a0 1260
451b5e48
MP
1261Wshift-overflow
1262C ObjC C++ ObjC++ Warning Alias(Wshift-overflow=, 1, 0)
a7b2e184 1263Warn if left shift of a signed value overflows.
451b5e48
MP
1264
1265Wshift-overflow=
63010089 1266C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_shift_overflow) Init(-1) Warning IntegerRange(0, 2)
a7b2e184 1267Warn if left shift of a signed value overflows.
451b5e48 1268
13c21655
PC
1269Wshift-count-negative
1270C ObjC C++ ObjC++ Var(warn_shift_count_negative) Init(1) Warning
a7b2e184 1271Warn if shift count is negative.
13c21655
PC
1272
1273Wshift-count-overflow
1274C ObjC C++ ObjC++ Var(warn_shift_count_overflow) Init(1) Warning
a7b2e184 1275Warn if shift count >= width of type.
fef3106c 1276
0173bd2a
MP
1277Wshift-negative-value
1278C ObjC C++ ObjC++ Var(warn_shift_negative_value) Init(-1) Warning
a7b2e184 1279Warn if left shifting a negative value.
0173bd2a 1280
c77074d0
JM
1281Warith-conversion
1282C ObjC C++ ObjC++ Var(warn_arith_conv) Warning
1283Warn if conversion of the result of arithmetic might change the value even though converting the operands cannot.
1284
fef3106c 1285Wsign-compare
4a0ae68e 1286C ObjC C++ ObjC++ Var(warn_sign_compare) Warning LangEnabledBy(C++ ObjC++,Wall)
a7b2e184 1287Warn about signed-unsigned comparisons.
fef3106c 1288
4a0ae68e
MLI
1289Wsign-compare
1290C ObjC C++ ObjC++ EnabledBy(Wextra)
1291;
1292
1293Wsign-conversion
63bbf46d 1294C ObjC C++ ObjC++ Var(warn_sign_conversion) Warning LangEnabledBy(C ObjC,Wconversion)
a7b2e184 1295Warn for implicit type conversions between signed and unsigned integers.
4a0ae68e 1296
fef3106c 1297Wsign-promo
c662432e 1298C++ ObjC++ Var(warn_sign_promo) Warning
a7b2e184 1299Warn when overload promotes from unsigned to signed.
fef3106c 1300
b2f97e4a 1301Wstrict-null-sentinel
5498f011 1302C++ ObjC++ Warning Var(warn_strict_null_sentinel)
a7b2e184 1303Warn about uncasted NULL used as sentinel.
b2f97e4a 1304
fef3106c 1305Wstrict-prototypes
c662432e 1306C ObjC Var(warn_strict_prototypes) Warning
a7b2e184 1307Warn about unprototyped function declarations.
fef3106c 1308
65d4f2cd 1309Wstrict-aliasing=
63010089 1310C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall, 3, 0) IntegerRange(0, 3)
65d4f2cd
MLI
1311;
1312
1313Wstrict-overflow=
63010089 1314C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) IntegerRange(0, 5)
65d4f2cd
MLI
1315;
1316
6e955430 1317Wstrict-selector-match
c662432e 1318ObjC ObjC++ Var(warn_strict_selector_match) Warning
a7b2e184 1319Warn if type signatures of candidate methods do not match exactly.
6e955430 1320
23462d4d
UB
1321Wsync-nand
1322C C++ Var(warn_sync_nand) Init(1) Warning
a7b2e184 1323Warn when __sync_fetch_and_nand and __sync_nand_and_fetch built-in functions are used.
23462d4d 1324
fef3106c 1325Wsynth
c662432e 1326C++ ObjC++ Var(warn_synth) Warning
a7b2e184 1327Deprecated. This switch has no effect.
fef3106c
NB
1328
1329Wsystem-headers
c662432e 1330C ObjC C++ ObjC++ Warning
9a0f3e86 1331; Documented in common.opt
fef3106c 1332
05b28fd6
MP
1333Wtautological-compare
1334C ObjC C++ ObjC++ Var(warn_tautological_compare) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 1335Warn if a comparison always evaluates to true or false.
05b28fd6 1336
8243e2a9
JM
1337Wterminate
1338C++ ObjC++ Warning Var(warn_terminate) Init(1)
a7b2e184 1339Warn if a throw expression will always result in a call to terminate().
8243e2a9 1340
fef3106c 1341Wtraditional
b559c810 1342C ObjC CPP(cpp_warn_traditional) CppReason(CPP_W_TRADITIONAL) Var(warn_traditional) Init(0) Warning
a7b2e184 1343Warn about features not present in traditional C.
fef3106c 1344
05170031 1345Wtraditional-conversion
c662432e 1346C ObjC Var(warn_traditional_conversion) Warning
a7b2e184 1347Warn of prototypes causing type conversions different from what would happen in the absence of prototype.
05170031 1348
fef3106c 1349Wtrigraphs
b559c810 1350C ObjC C++ ObjC++ CPP(warn_trigraphs) CppReason(CPP_W_TRIGRAPHS) Var(cpp_warn_trigraphs) Init(2) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 1351Warn if trigraphs are encountered that might affect the meaning of the program.
fef3106c
NB
1352
1353Wundeclared-selector
c662432e 1354ObjC ObjC++ Var(warn_undeclared_selector) Warning
a7b2e184 1355Warn about @selector()s without previously declared methods.
fef3106c
NB
1356
1357Wundef
b559c810 1358C ObjC C++ ObjC++ CPP(warn_undef) CppReason(CPP_W_UNDEF) Var(cpp_warn_undef) Init(0) Warning
a7b2e184 1359Warn if an undefined macro is used in an #if directive.
fef3106c 1360
572f5e1b
JJ
1361Wunicode
1362C ObjC C++ ObjC++ CPP(cpp_warn_unicode) CppReason(CPP_W_UNICODE) Var(warn_unicode) Init(1) Warning
1363Warn about invalid forms of delimited or named escape sequences.
1364
4a0ae68e 1365Wuninitialized
cea71f0a 1366C ObjC C++ ObjC++ LTO LangEnabledBy(C ObjC C++ ObjC++ LTO,Wall)
4a0ae68e
MLI
1367;
1368
1369Wmaybe-uninitialized
cea71f0a 1370C ObjC C++ ObjC++ LTO LangEnabledBy(C ObjC C++ ObjC++ LTO,Wall)
4a0ae68e
MLI
1371;
1372
fef3106c 1373Wunknown-pragmas
34a180a6 1374C ObjC C++ ObjC++ Warning Var(warn_unknown_pragmas) LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0)
a7b2e184 1375Warn about unrecognized pragmas.
fef3106c 1376
6ec637a4
JJ
1377Wunsuffixed-float-constants
1378C ObjC Var(warn_unsuffixed_float_constants) Warning
a7b2e184 1379Warn about unsuffixed float constants.
6ec637a4 1380
4a0ae68e
MLI
1381Wunused
1382C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall)
1383; documented in common.opt
1384
3797cb21 1385Wunused-local-typedefs
650dc14a 1386C ObjC C++ ObjC++ Var(warn_unused_local_typedefs) Warning EnabledBy(Wunused)
a7b2e184 1387Warn when typedefs locally defined in a function are not used.
3797cb21 1388
fef3106c 1389Wunused-macros
b559c810 1390C ObjC C++ ObjC++ CppReason(CPP_W_UNUSED_MACROS) Var(cpp_warn_unused_macros) Warning
a7b2e184 1391Warn about macros defined in the main file that are not used.
fef3106c 1392
156f545a
MLI
1393Wunused-result
1394C ObjC C++ ObjC++ Var(warn_unused_result) Init(1) Warning
a7b2e184 1395Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value.
156f545a 1396
0f876f22
MW
1397Wunused-variable
1398C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wunused)
1399; documented in common.opt
1400
1401Wunused-const-variable
4246c8da
MW
1402C ObjC C++ ObjC++ Warning Alias(Wunused-const-variable=, 2, 0)
1403Warn when a const variable is unused.
1404
1405Wunused-const-variable=
63010089 1406C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_unused_const_variable) Warning LangEnabledBy(C ObjC,Wunused-variable, 1, 0) IntegerRange(0, 2)
a7b2e184 1407Warn when a const variable is unused.
0f876f22 1408
4319304f 1409; Defining this option here in addition to common.opt is necessary
43911ddd
TS
1410; in order for the default -Wall setting of -Wuse-after-free=2 to take
1411; effect.
671a2836 1412
671a2836
MS
1413Wuse-after-free=
1414LangEnabledBy(C ObjC C++ LTO ObjC++, Wall,2,0)
1415; in common.opt
1416
e5b79219 1417Wvariadic-macros
27e51192 1418C 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 1419Warn about using variadic macros.
e5b79219 1420
b9c8da34
DS
1421Wvarargs
1422C ObjC C++ ObjC++ Warning Var(warn_varargs) Init(1)
a7b2e184 1423Warn about questionable usage of the macros used to retrieve variable arguments.
b9c8da34 1424
5b200310
MP
1425Wvexing-parse
1426C++ ObjC++ Warning Var(warn_vexing_parse) Init(1)
1427Warn about the most vexing parse syntactic ambiguity.
1428
50d50fc7
SP
1429Wvla
1430C ObjC C++ ObjC++ Var(warn_vla) Init(-1) Warning
a7b2e184 1431Warn if a variable length array is used.
50d50fc7 1432
adc577c5 1433Wvla-larger-than=
00abf86c
MS
1434C ObjC C++ LTO ObjC++ Var(warn_vla_limit) Warning Joined Host_Wide_Int ByteSize Init(HOST_WIDE_INT_MAX)
1435-Wvla-larger-than=<number> Warn on unbounded uses of variable-length
1436arrays, and on bounded uses of variable-length arrays whose bound can be
adc577c5 1437larger than <number> bytes.
00abf86c
MS
1438
1439Wno-vla-larger-than
1440C ObjC C++ LTO ObjC++ Alias(Wvla-larger-than=,18446744073709551615EiB,none) Warning
b408e010 1441Disable Wvla-larger-than= warning. Equivalent to Wvla-larger-than=<SIZE_MAX> or larger.
adc577c5 1442
6450f073
MS
1443Wvla-parameter
1444C ObjC C++ ObjC++ Var(warn_vla_parameter) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
1445Warn about mismatched declarations of VLA parameters.
1446
8a902edb
MP
1447Wvolatile
1448C++ ObjC++ Var(warn_volatile) Warning
1449Warn about deprecated uses of volatile qualifier.
1450
16302daf 1451Wvolatile-register-var
4a0ae68e 1452C ObjC C++ ObjC++ Var(warn_volatile_register_var) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall)
a7b2e184 1453Warn when a register variable is declared volatile.
16302daf 1454
6b333269
NS
1455Wvirtual-inheritance
1456C++ ObjC++ Var(warn_virtual_inheritance) Warning
a7b2e184 1457Warn on direct virtual inheritance.
6b333269 1458
f14edc1a
JM
1459Wvirtual-move-assign
1460C++ ObjC++ Var(warn_virtual_move_assign) Warning Init(1)
a7b2e184 1461Warn if a virtual base has a non-trivial move assignment operator.
f14edc1a 1462
fef3106c 1463Wwrite-strings
c662432e 1464C ObjC C++ ObjC++ Var(warn_write_strings) Warning
d8a07487 1465In 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 1466
bedfca64
DM
1467Wxor-used-as-pow
1468C ObjC C++ ObjC++ Var(warn_xor_used_as_pow) Warning Init(1)
1469Warn about xor operators where it appears the user meant exponentiation.
1470
89401152
PC
1471Wzero-as-null-pointer-constant
1472C++ ObjC++ Var(warn_zero_as_null_pointer_constant) Warning
a7b2e184 1473Warn when a literal '0' is used as null pointer.
89401152 1474
04398fa8
PC
1475Wuseless-cast
1476C++ ObjC++ Var(warn_useless_cast) Warning
a7b2e184 1477Warn about useless casts.
04398fa8 1478
273aa49e
PC
1479Wsubobject-linkage
1480C++ ObjC++ Var(warn_subobject_linkage) Warning Init(1)
a7b2e184 1481Warn 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 1482
d6e83a8d
MM
1483Wduplicate-decl-specifier
1484C ObjC Var(warn_duplicate_decl_specifier) Warning LangEnabledBy(C ObjC,Wall)
1485Warn when a declaration has duplicate const, volatile, restrict or _Atomic specifier.
1486
975672f3 1487Wrestrict
cc8bea0a 1488C ObjC C++ ObjC++ Var(warn_restrict) Warning LangEnabledBy(C ObjC C++ ObjC++, Wall)
975672f3
PK
1489Warn when an argument passed to a restrict-qualified parameter aliases with
1490another argument.
1491
fef3106c
NB
1492ansi
1493C ObjC C++ ObjC++
a7b2e184 1494A synonym for -std=c89 (for C) or -std=c++98 (for C++).
fef3106c
NB
1495
1496d
1497C ObjC C++ ObjC++ Joined
72de27ea 1498; Documented in common.opt. FIXME - what about -dI, -dD, -dN and -dD?
fef3106c 1499
62984918
JM
1500fabi-compat-version=
1501C++ ObjC++ Joined RejectNegative UInteger Var(flag_abi_compat_version) Init(-1)
a7b2e184 1502The version of the C++ ABI used for -Wabi warnings and link compatibility aliases.
62984918 1503
fef3106c 1504faccess-control
5498f011 1505C++ ObjC++ Var(flag_access_control) Init(1)
a7b2e184 1506Enforce class member access control semantics.
fef3106c 1507
da5182be
TQ
1508fada-spec-parent=
1509C ObjC C++ ObjC++ RejectNegative Joined Var(ada_specs_parent)
b408e010 1510-fada-spec-parent=unit Dump Ada specs as child units of given parent.
da5182be 1511
af63ba4b
JM
1512faligned-new
1513C++ ObjC++ Alias(faligned-new=,1,0)
1514Support C++17 allocation of over-aligned types.
1515
1516faligned-new=
2e1c20b1 1517C++ ObjC++ Joined RejectNegative Var(aligned_new_threshold) UInteger Init(-1)
b408e010 1518-faligned-new=<N> Use C++17 over-aligned type allocation for alignments greater than N.
af63ba4b 1519
fef3106c 1520fall-virtual
68a57628 1521C++ ObjC++ WarnRemoved
fef3106c 1522
6637388f 1523fallow-parameterless-variadic-functions
4fe34cdc
JM
1524C ObjC Ignore
1525Does nothing. Preserved for backward compatibility.
6637388f 1526
fef3106c 1527falt-external-templates
68a57628 1528C++ ObjC++ WarnRemoved
a7b2e184 1529No longer supported.
fef3106c
NB
1530
1531fasm
5498f011 1532C ObjC C++ ObjC++ Var(flag_no_asm, 0)
a7b2e184 1533Recognize the \"asm\" keyword.
fef3106c 1534
10e48e39
RO
1535; Define extra predefined macros for use in libgcc.
1536fbuilding-libgcc
1537C ObjC C++ ObjC++ Undocumented Var(flag_building_libgcc)
1538
fef3106c 1539fbuiltin
5498f011 1540C ObjC C++ ObjC++ Var(flag_no_builtin, 0)
a7b2e184 1541Recognize built-in functions.
fef3106c
NB
1542
1543fbuiltin-
1544C ObjC C++ ObjC++ Joined
1545
5dc99c46
SB
1546fcanonical-system-headers
1547C ObjC C++ ObjC++
1548Where shorter, use canonicalized paths to systems headers.
1549
2d91f79d
TH
1550fchar8_t
1551C++ ObjC++ Var(flag_char8_t) Init(-1)
1552Enable the char8_t fundamental type and use it as the type for UTF-8 string
1553and character literals.
1554
d5e254e1 1555fcheck-pointer-bounds
68a57628 1556C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1557Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1558
1559fchkp-check-incomplete-type
68a57628 1560C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1561Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1562
1563fchkp-zero-input-bounds-for-main
68a57628 1564C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1565Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1566
1567fchkp-first-field-has-own-bounds
68a57628 1568C ObjC C++ ObjC++ LTO WarnRemoved RejectNegative
f48ef52e 1569Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1570
1571fchkp-narrow-bounds
68a57628 1572C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1573Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1574
1575fchkp-narrow-to-innermost-array
68a57628 1576C ObjC C++ ObjC++ LTO WarnRemoved RejectNegative
f48ef52e 1577Removed in GCC 9. This switch has no effect.
8ba4f506
AI
1578
1579fchkp-flexible-struct-trailing-arrays
68a57628 1580C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1581Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1582
1583fchkp-optimize
68a57628 1584C ObjC C++ ObjC++ LTO WarnRemoved
d5e254e1
IE
1585
1586fchkp-use-fast-string-functions
68a57628 1587C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1588Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1589
1590fchkp-use-nochk-string-functions
68a57628 1591C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1592Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1593
1594fchkp-use-static-bounds
68a57628 1595C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1596Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1597
1598fchkp-use-static-const-bounds
68a57628 1599C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1600Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1601
1602fchkp-treat-zero-dynamic-size-as-infinite
68a57628 1603C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1604Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1605
1606fchkp-check-read
68a57628 1607C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1608Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1609
1610fchkp-check-write
68a57628 1611C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1612Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1613
1614fchkp-store-bounds
68a57628 1615C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1616Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1617
1618fchkp-instrument-calls
68a57628 1619C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1620Removed in GCC 9. This switch has no effect.
d5e254e1
IE
1621
1622fchkp-instrument-marked-only
68a57628 1623C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1624Removed in GCC 9. This switch has no effect.
d5e254e1 1625
226d62d2 1626fchkp-use-wrappers
68a57628 1627C ObjC C++ ObjC++ LTO WarnRemoved
f48ef52e 1628Removed in GCC 9. This switch has no effect.
226d62d2 1629
5373cd33 1630static-libmpx
68a57628 1631Driver WarnRemoved
f48ef52e 1632Removed in GCC 9. This switch has no effect.
5373cd33 1633
d2d7e672 1634static-libmpxwrappers
68a57628 1635Driver WarnRemoved
f48ef52e 1636Removed in GCC 9. This switch has no effect.
d2d7e672 1637
c0c12356
ML
1638fcilkplus
1639C ObjC C++ ObjC++ LTO Undocumented Ignore
f48ef52e 1640Removed in GCC 8. This switch has no effect.
36536d79 1641
971e17ff
AS
1642fconcepts
1643C++ ObjC++ Var(flag_concepts)
a7b2e184 1644Enable support for C++ concepts.
971e17ff 1645
cb57504a
JM
1646fconcepts-ts
1647C++ ObjC++ Var(flag_concepts_ts) Init(0)
1648Enable certain features present in the Concepts TS.
1649
75defde9
PP
1650fconcepts-diagnostics-depth=
1651C++ ObjC++ Joined RejectNegative UInteger Var(concepts_diagnostics_max_depth) Init(1)
1652Specify maximum error replay depth during recursive diagnosis of a constraint satisfaction failure.
1653
fef3106c
NB
1654fcond-mismatch
1655C ObjC C++ ObjC++
a7b2e184 1656Allow the arguments of the '?' operator to have different types.
fef3106c
NB
1657
1658fconserve-space
c0c12356 1659C++ ObjC++ Ignore
6f07a821 1660Does nothing. Preserved for backward compatibility.
fef3106c 1661
fef3106c 1662fconstant-string-class=
61ff2bdc 1663ObjC ObjC++ Joined MissingArgError(no class name specified with %qs)
a7b2e184 1664-fconst-string-class=<name> Use class <name> for constant strings.
fef3106c 1665
17bc631c 1666fconstexpr-depth=
49a000c3 1667C++ ObjC++ Joined RejectNegative UInteger Var(max_constexpr_depth) Init(512)
a7b2e184 1668-fconstexpr-depth=<number> Specify maximum constexpr recursion depth.
17bc631c 1669
7ffc7de5
JM
1670fconstexpr-cache-depth=
1671C++ ObjC++ Joined RejectNegative UInteger Var(constexpr_cache_depth) Init(8)
1672-fconstexpr-cache-depth=<number> Specify maximum constexpr recursion cache depth.
1673
53caa472
JM
1674fconstexpr-fp-except
1675C++ ObjC++ Var(flag_constexpr_fp_except) Init(0)
1676Allow IEC559 floating point exceptions in constant expressions.
1677
5ec2cd9f
JM
1678fconstexpr-loop-limit=
1679C++ ObjC++ Joined RejectNegative UInteger Var(constexpr_loop_limit) Init(262144)
1680-fconstexpr-loop-limit=<number> Specify maximum constexpr loop iteration count.
1681
a15ffa22
JJ
1682fconstexpr-ops-limit=
1683C++ ObjC++ Joined RejectNegative Host_Wide_Int Var(constexpr_ops_limit) Init(33554432)
1684-fconstexpr-ops-limit=<number> Specify maximum number of constexpr operations during a single constexpr evaluation.
1685
2efb237f
JCI
1686fcontracts
1687C++ ObjC++ Var(flag_contracts) Init(0)
1688Enable certain features present drafts of C++ Contracts.
1689
1690Enum
1691Name(on_off) Type(int) UnknownError(argument %qs must be either %<on%> or %<off%>)
1692
1693EnumValue
1694Enum(on_off) String(off) Value(0)
1695
1696EnumValue
1697Enum(on_off) String(on) Value(1)
1698
1699fcontract-assumption-mode=
e1b503d7 1700C++ Joined RejectNegative
2efb237f
JCI
1701-fcontract-assumption-mode=[on|off] Enable or disable treating axiom level contracts as assumptions (default on).
1702
1703fcontract-build-level=
1704C++ Joined RejectNegative
e1b503d7 1705-fcontract-build-level=[off|default|audit] Specify max contract level to generate runtime checks for.
2efb237f
JCI
1706
1707fcontract-strict-declarations=
1708C++ Var(flag_contract_strict_declarations) Enum(on_off) Joined Init(0) RejectNegative
1709-fcontract-strict-declarations=[on|off] Enable or disable warnings on generalized redeclaration of functions with contracts (default off).
1710
1711fcontract-mode=
1712C++ Var(flag_contract_mode) Enum(on_off) Joined Init(1) RejectNegative
1713-fcontract-mode=[on|off] Enable or disable all contract facilities (default on).
1714
1715fcontract-continuation-mode=
e1b503d7 1716C++ Joined RejectNegative
2efb237f
JCI
1717-fcontract-continuation-mode=[on|off] Enable or disable contract continuation mode (default off).
1718
1719fcontract-role=
e1b503d7 1720C++ Joined RejectNegative
138ee8f7 1721-fcontract-role=<name>:<semantics> Specify the semantics for all levels in a role (default, review), or a custom contract role with given semantics (ex: opt:assume,assume,assume).
2efb237f
JCI
1722
1723fcontract-semantic=
e1b503d7 1724C++ Joined RejectNegative
138ee8f7 1725-fcontract-semantic=<level>:<semantic> Specify the concrete semantics for level.
2efb237f 1726
49789fd0
IS
1727fcoroutines
1728C++ LTO Var(flag_coroutines)
1729Enable C++ coroutines (experimental).
1730
847e697a
TT
1731fdebug-cpp
1732C ObjC C++ ObjC++
a7b2e184 1733Emit debug annotations during preprocessing.
847e697a 1734
5f5babf1 1735fdeduce-init-list
db9d2274
MP
1736C++ ObjC++ Ignore
1737Does nothing. Preserved for backward compatibility.
5f5babf1 1738
1f26ac87
JM
1739fdeclone-ctor-dtor
1740C++ ObjC++ Var(flag_declone_ctor_dtor) Init(-1)
a7b2e184 1741Factor complex constructors and destructors to favor space over speed.
1f26ac87 1742
fef3106c 1743fdefault-inline
2d2bd949 1744C++ ObjC++ Ignore
5498f011 1745Does nothing. Preserved for backward compatibility.
fef3106c 1746
f012c8ef
DM
1747fdiagnostics-show-template-tree
1748C++ ObjC++ Var(flag_diagnostics_show_template_tree) Init(0)
1749Print hierarchical comparisons when template types are mismatched.
1750
ccfc4c91
OW
1751fdirectives-only
1752C ObjC C++ ObjC++
1753Preprocess directives only.
1754
fef3106c
NB
1755fdollars-in-identifiers
1756C ObjC C++ ObjC++
a7b2e184 1757Permit '$' as an identifier character.
fef3106c 1758
7365279f
BK
1759fmacro-prefix-map=
1760C ObjC C++ ObjC++ Joined RejectNegative
b408e010 1761-fmacro-prefix-map=<old>=<new> Map one directory name to another in __FILE__, __BASE_FILE__, and __builtin_FILE().
7365279f 1762
3b78de56
AC
1763fdump-ada-spec
1764C ObjC C++ ObjC++ RejectNegative Var(flag_dump_ada_spec)
a7b2e184 1765Write all declarations as Ada code transitively.
3b78de56
AC
1766
1767fdump-ada-spec-slim
1768C ObjC C++ ObjC++ RejectNegative Var(flag_dump_ada_spec_slim)
a7b2e184 1769Write all declarations as Ada code for the given file only.
3b78de56 1770
fef3106c 1771felide-constructors
5498f011 1772C++ ObjC++ Var(flag_elide_constructors) Init(1)
fef3106c 1773
f012c8ef
DM
1774felide-type
1775C++ ObjC++ Var(flag_elide_type) Init(1)
b408e010 1776Do not elide common elements in template comparisons.
f012c8ef 1777
fef3106c 1778fenforce-eh-specs
5498f011 1779C++ ObjC++ Var(flag_enforce_eh_specs) Init(1)
a7b2e184 1780Generate code to check exception specifications.
fef3106c
NB
1781
1782fenum-int-equiv
68a57628 1783C++ ObjC++ WarnRemoved
fef3106c 1784
e6cc3a24
ZW
1785fexec-charset=
1786C ObjC C++ ObjC++ Joined RejectNegative
a7b2e184 1787-fexec-charset=<cset> Convert all strings and character constants to character set <cset>.
e6cc3a24 1788
af15a2fe
JM
1789fextended-identifiers
1790C ObjC C++ ObjC++
a7b2e184 1791Permit universal character names (\\u and \\U) in identifiers.
af15a2fe 1792
16dd5cfe
EC
1793finput-charset=
1794C ObjC C++ ObjC++ Joined RejectNegative
a7b2e184 1795-finput-charset=<cset> Specify the default character set for source files.
16dd5cfe 1796
5af057d8
JM
1797fextern-tls-init
1798C++ ObjC++ Var(flag_extern_tls_init) Init(-1)
a7b2e184 1799Support dynamic initialization of thread-local variables in a different translation unit.
16dd5cfe 1800
fef3106c 1801fexternal-templates
68a57628 1802C++ ObjC++ WarnRemoved
fef3106c 1803
e55c5e24
PP
1804ffold-simple-inlines
1805C++ ObjC++ Optimization Var(flag_fold_simple_inlines)
1806Fold calls to simple inline functions.
1807
fef3106c 1808ffor-scope
68a57628 1809C++ ObjC++ WarnRemoved
fef3106c
NB
1810
1811ffreestanding
820b51ae 1812C ObjC C++ ObjC++
a7b2e184 1813Do not assume that standard C libraries and \"main\" exist.
fef3106c
NB
1814
1815fgnu-keywords
5498f011 1816C++ ObjC++ Var(flag_no_gnu_keywords, 0)
a7b2e184 1817Recognize GNU-defined keywords.
fef3106c
NB
1818
1819fgnu-runtime
eece52b5 1820ObjC ObjC++ LTO RejectNegative Var(flag_next_runtime,0) Init(NEXT_OBJC_RUNTIME)
a7b2e184 1821Generate code for GNU runtime environment.
fef3106c 1822
da1c7394 1823fgnu89-inline
2cbac420 1824C ObjC Var(flag_gnu89_inline) Init(-1)
a7b2e184 1825Use traditional GNU semantics for inline functions.
da1c7394 1826
fef3106c 1827fguiding-decls
68a57628 1828C++ ObjC++ WarnRemoved
fef3106c
NB
1829
1830fhandle-exceptions
63b8a166 1831C++ ObjC++ Optimization Alias(fexceptions) Warn({%<-fhandle-exceptions%> has been renamed %<-fexceptions%> (and is now on by default)})
fef3106c
NB
1832
1833fhonor-std
68a57628 1834C++ ObjC++ WarnRemoved
fef3106c
NB
1835
1836fhosted
1837C ObjC
a7b2e184 1838Assume normal C execution environment.
fef3106c
NB
1839
1840fhuge-objects
68a57628 1841C++ ObjC++ WarnRemoved
a7b2e184 1842No longer supported.
fef3106c
NB
1843
1844fimplement-inlines
5498f011 1845C++ ObjC++ Var(flag_implement_inlines) Init(1)
a7b2e184 1846Export functions even if they can be inlined.
fef3106c 1847
87c2080b
JM
1848fimplicit-constexpr
1849C++ ObjC++ Var(flag_implicit_constexpr)
1850Make inline functions constexpr by default.
1851
fef3106c 1852fimplicit-inline-templates
5498f011 1853C++ ObjC++ Var(flag_implicit_inline_templates) Init(1)
a7b2e184 1854Emit implicit instantiations of inline templates.
fef3106c
NB
1855
1856fimplicit-templates
5498f011 1857C++ ObjC++ Var(flag_implicit_templates) Init(1)
a7b2e184 1858Emit implicit instantiations of templates.
fef3106c 1859
31f7f784
JM
1860fnew-inheriting-ctors
1861C++ ObjC++ Var(flag_new_inheriting_ctors) Init(1)
1862Implement C++17 inheriting constructor semantics.
1863
d63d5d0c 1864ffriend-injection
68a57628 1865C++ ObjC++ WarnRemoved
d63d5d0c 1866
47ea1edf 1867fkeep-inline-dllexport
eece52b5 1868C C++ ObjC ObjC++ Var(flag_keep_inline_dllexport) Init(1) Condition(TARGET_DLLIMPORT_DECL_ATTRIBUTES)
a7b2e184 1869Don't emit dllexported inline functions unless needed.
47ea1edf 1870
fef3106c 1871flabels-ok
68a57628 1872C++ ObjC++ WarnRemoved
fef3106c 1873
00c8e9f6 1874flax-vector-conversions
5498f011 1875C ObjC C++ ObjC++ Var(flag_lax_vector_conversions)
00c8e9f6
MS
1876Allow implicit conversions between vectors with differing numbers of subparts and/or differing element types.
1877
10ee6da6
NS
1878fmodules-ts
1879C++ ObjC++ Var(flag_modules) Integer Init(0)
1880Enable C++ modules-ts (experimental).
1881
1882fno-modules
1883C++ ObjC++ Undocumented RejectNegative Var(flag_modules,0) Integer
1884;; undocumented
1885
1886fmodule-header
1887C++ ObjC RejectNegative Var(flag_header_unit,0) Integer
1888Enable C++ header module (experimental).
1889
1890fmodule-header=
1891C++ ObjC++ Joined RejectNegative Undocumented
1892
1893fmodule-implicit-inline
1894C++ ObjC++ Var(flag_module_implicit_inline,0) Integer
1895Member functions defined within their class are inline in module purview.
1896
1897fmodule-only
1898C++ ObjC RejectNegative Var(flag_module_only) Integer
1899Only emit Compiled Module Interface.
1900
1901fmodule-mapper=
1902C++ ObjC++ Joined RejectNegative MissingArgError(missing mapper)
1903Mapper for module to CMI files.
1904
1905fmodule-lazy
1906C++ ObjC++ Var(flag_module_lazy) Init(1)
1907Enable lazy module importing.
1908
1909fmodule-version-ignore
1910C++ ObjC Var(flag_module_version_ignore) Integer
1911; undocumented, Very dangerous, but occasionally useful
1912
1913Winvalid-imported-macros
40a2f888 1914C++ ObjC++ Var(warn_imported_macros) Warning
10ee6da6
NS
1915Warn about macros that have conflicting header units definitions.
1916
1917flang-info-include-translate
1918C++ Var(note_include_translate_yes)
1919Note #include directives translated to import declarations.
1920
1921flang-info-include-translate-not
1922C++ Var(note_include_translate_no)
1923Note #include directives not translated to import declarations, and not known to be textual.
1924
1925flang-info-include-translate=
1926C++ Joined RejectNegative MissingArgError(missing header name)
1927Note a #include translation of a specific header.
1928
9592deab
NS
1929flang-info-module-cmi
1930C++ Var(note_module_cmi_yes)
bfe83ae3
NS
1931Note Compiled Module Interface pathnames.
1932
9592deab 1933flang-info-module-cmi=
bfe83ae3
NS
1934C++ Joined RejectNegative MissingArgError(missing module name)
1935Note Compiled Module Interface pathname of a specific module or header-unit.
1936
1c6ffbab
QZ
1937fmax-include-depth=
1938C ObjC C++ ObjC++ Joined RejectNegative UInteger
1939fmax-include-depth=<number> Set the maximum depth of the nested #include.
1940
fef3106c 1941fms-extensions
5498f011 1942C ObjC C++ ObjC++ Var(flag_ms_extensions)
a7b2e184 1943Don't warn about uses of Microsoft extensions.
fef3106c 1944
5720c0dc 1945fmudflap
68a57628 1946C ObjC C++ ObjC++ WarnRemoved
5720c0dc
RG
1947
1948fmudflapth
68a57628 1949C ObjC C++ ObjC++ WarnRemoved
5720c0dc
RG
1950
1951fmudflapir
68a57628 1952C ObjC C++ ObjC++ WarnRemoved
5720c0dc 1953
fef3106c 1954fname-mangling-version-
68a57628 1955C++ ObjC++ Joined WarnRemoved
fef3106c
NB
1956
1957fnew-abi
68a57628 1958C++ ObjC++ WarnRemoved
fef3106c 1959
31bfc9b9
JM
1960fnew-ttp-matching
1961C++ ObjC++ Var(flag_new_ttp)
1962Implement resolution of DR 150 for matching of template template arguments.
1963
fef3106c 1964fnext-runtime
eece52b5 1965ObjC ObjC++ LTO RejectNegative Var(flag_next_runtime)
a7b2e184 1966Generate code for NeXT (Apple Mac OS X) runtime environment.
264fa2db
ZL
1967
1968fnil-receivers
5498f011 1969ObjC ObjC++ Var(flag_nil_receivers) Init(1)
a7b2e184 1970Assume that receivers of Objective-C messages may be nil.
fef3106c 1971
dcaaa5a0
DP
1972flocal-ivars
1973ObjC ObjC++ Var(flag_local_ivars) Init(1)
1974Allow access to instance variables as if they were local declarations within instance method implementations.
1975
1976fivar-visibility=
1977ObjC ObjC++ Joined RejectNegative Enum(ivar_visibility) Var(default_ivar_visibility) Init(IVAR_VISIBILITY_PROTECTED)
a7b2e184 1978-fvisibility=[private|protected|public|package] Set the default symbol visibility.
dcaaa5a0
DP
1979
1980Enum
1981Name(ivar_visibility) Type(enum ivar_visibility) UnknownError(unrecognized ivar visibility value %qs)
1982
1983EnumValue
1984Enum(ivar_visibility) String(private) Value(IVAR_VISIBILITY_PRIVATE)
1985
1986EnumValue
1987Enum(ivar_visibility) String(protected) Value(IVAR_VISIBILITY_PROTECTED)
1988
1989EnumValue
1990Enum(ivar_visibility) String(public) Value(IVAR_VISIBILITY_PUBLIC)
1991
1992EnumValue
1993Enum(ivar_visibility) String(package) Value(IVAR_VISIBILITY_PACKAGE)
1994
fef3106c 1995fnonansi-builtins
5498f011 1996C++ ObjC++ Var(flag_no_nonansi_builtin, 0)
fef3106c
NB
1997
1998fnonnull-objects
68a57628 1999C++ ObjC++ WarnRemoved
fef3106c 2000
9feb3d6a
JM
2001fnothrow-opt
2002C++ ObjC++ Optimization Var(flag_nothrow_opt)
a7b2e184 2003Treat a throw() exception specification as noexcept to improve code size.
9feb3d6a 2004
0a256240 2005fobjc-abi-version=
eece52b5 2006ObjC ObjC++ LTO Joined RejectNegative UInteger Var(flag_objc_abi)
0a256240
NP
2007Specify which ABI to use for Objective-C family code and meta-data generation.
2008
6e955430
ZL
2009; Generate special '- .cxx_construct' and '- .cxx_destruct' methods
2010; to initialize any non-POD ivars in Objective-C++ classes.
2011fobjc-call-cxx-cdtors
2012ObjC++ Var(flag_objc_call_cxx_cdtors)
a7b2e184 2013Generate special Objective-C methods to initialize/destroy non-POD C++ ivars, if needed.
6e955430
ZL
2014
2015fobjc-direct-dispatch
2016ObjC ObjC++ Var(flag_objc_direct_dispatch)
a7b2e184 2017Allow fast jumps to the message dispatcher.
6e955430
ZL
2018
2019; Nonzero means that we will allow new ObjC exception syntax (@throw,
2020; @try, etc.) in source code.
264fa2db 2021fobjc-exceptions
6e955430 2022ObjC ObjC++ Var(flag_objc_exceptions)
a7b2e184 2023Enable Objective-C exception and synchronization syntax.
264fa2db 2024
6e955430 2025fobjc-gc
fb5610fb 2026ObjC ObjC++ LTO Var(flag_objc_gc)
a7b2e184 2027Enable garbage collection (GC) in Objective-C/Objective-C++ programs.
6e955430 2028
0a256240
NP
2029fobjc-nilcheck
2030ObjC ObjC++ Var(flag_objc_nilcheck,1)
2031Enable inline checks for nil receivers with the NeXT runtime and ABI version 2.
2032
6e955430 2033; Nonzero means that we generate NeXT setjmp based exceptions.
093c7153 2034fobjc-sjlj-exceptions
6e955430 2035ObjC ObjC++ Var(flag_objc_sjlj_exceptions) Init(-1)
a7b2e184 2036Enable Objective-C setjmp exception handling runtime.
093c7153 2037
22d8d616
NP
2038fobjc-std=objc1
2039ObjC ObjC++ Var(flag_objc1_only)
a7b2e184 2040Conform to the Objective-C 1.0 language as implemented in GCC 4.0.
22d8d616 2041
41dbbb37 2042fopenacc
a0c88d06 2043C ObjC C++ ObjC++ LTO Var(flag_openacc)
a7b2e184 2044Enable OpenACC.
41dbbb37 2045
b6adbb9f
NS
2046fopenacc-dim=
2047C ObjC C++ ObjC++ LTO Joined Var(flag_openacc_dims)
2048Specify default OpenACC compute dimensions.
2049
953ff289 2050fopenmp
1506ae0e 2051C ObjC C++ ObjC++ LTO Var(flag_openmp)
a7b2e184 2052Enable OpenMP (implies -frecursive in Fortran).
953ff289 2053
6d7f7e0a
TB
2054fopenmp-simd
2055C ObjC C++ ObjC++ Var(flag_openmp_simd)
a7b2e184 2056Enable OpenMP's SIMD directives.
6d7f7e0a 2057
fef3106c
NB
2058foperator-names
2059C++ ObjC++
a7b2e184 2060Recognize C++ keywords like \"compl\" and \"xor\".
fef3106c
NB
2061
2062foptional-diags
2d2bd949 2063C++ ObjC++ Ignore
5498f011 2064Does nothing. Preserved for backward compatibility.
fef3106c
NB
2065
2066fpch-deps
2067C ObjC C++ ObjC++
2068
c0d578e6
GK
2069fpch-preprocess
2070C ObjC C++ ObjC++
a7b2e184 2071Look for and use PCH files even when preprocessing.
c0d578e6 2072
fef3106c 2073fpermissive
0c3641b0 2074C++ ObjC++ Var(flag_permissive)
a7b2e184 2075Downgrade conformance errors to warnings.
fef3106c 2076
478a1c5b
ILT
2077fplan9-extensions
2078C ObjC Var(flag_plan9_extensions)
a7b2e184 2079Enable Plan 9 language extensions.
478a1c5b 2080
fef3106c
NB
2081fpreprocessed
2082C ObjC C++ ObjC++
a7b2e184 2083Treat the input file as already preprocessed.
fef3106c 2084
92582b75
TT
2085ftrack-macro-expansion
2086C ObjC C++ ObjC++ JoinedOrMissing RejectNegative UInteger
2087; converted into ftrack-macro-expansion=
2088
2089ftrack-macro-expansion=
2090C ObjC C++ ObjC++ JoinedOrMissing RejectNegative UInteger
b408e010 2091-ftrack-macro-expansion=<0|1|2> Track locations of tokens coming from macro expansion and display them in error messages.
92582b75 2092
6ea2bd47 2093fpretty-templates
5498f011 2094C++ ObjC++ Var(flag_pretty_templates) Init(1)
b408e010 2095Do not pretty-print template specializations as the template signature followed by the arguments.
6ea2bd47 2096
88d0c3f0 2097fprintf-return-value
89990732 2098C ObjC C++ ObjC++ LTO Optimization Var(flag_printf_return_value) Init(1)
88d0c3f0
MS
2099Treat known sprintf return values as constants.
2100
264fa2db 2101freplace-objc-classes
fb5610fb 2102ObjC ObjC++ LTO Var(flag_replace_objc_classes)
a7b2e184 2103Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime.
264fa2db 2104
fef3106c 2105frepo
68a57628 2106C++ ObjC++ WarnRemoved
f48ef52e 2107Removed in GCC 10. This switch has no effect.
fef3106c
NB
2108
2109frtti
5498f011 2110C++ ObjC++ Optimization Var(flag_rtti) Init(1)
a7b2e184 2111Generate run time type descriptor information.
fef3106c 2112
fef3106c 2113fshort-enums
dd6fe7d4 2114C ObjC C++ ObjC++ LTO Optimization Var(flag_short_enums)
a7b2e184 2115Use the narrowest integer type possible for enumeration types.
fef3106c
NB
2116
2117fshort-wchar
dd6fe7d4 2118C ObjC C++ ObjC++ LTO Optimization Var(flag_short_wchar)
a7b2e184 2119Force the underlying type for \"wchar_t\" to be \"unsigned short\".
fef3106c 2120
fef3106c 2121fsigned-bitfields
5498f011 2122C ObjC C++ ObjC++ Var(flag_signed_bitfields) Init(1)
a7b2e184 2123When \"signed\" or \"unsigned\" is not given make the bitfield signed.
fef3106c
NB
2124
2125fsigned-char
5498f011 2126C ObjC C++ ObjC++ LTO Var(flag_signed_char)
a7b2e184 2127Make \"char\" signed by default.
fef3106c 2128
20b06add
JM
2129fsized-deallocation
2130C++ ObjC++ Var(flag_sized_deallocation) Init(-1)
a7b2e184 2131Enable C++14 sized deallocation support.
20b06add 2132
1879e48f
QZ
2133fstrict-flex-arrays
2134C C++ Common Alias(fstrict-flex-arrays=,3,0)
2135
2136fstrict-flex-arrays=
2137C C++ Common Joined RejectNegative UInteger Var(flag_strict_flex_arrays) Init(0) IntegerRange(0,3)
2138-fstrict-flex-arrays=<level> Control when to treat the trailing array of a structure as a flexible array member for the purposes of accessing the elements of such an array. The default is treating all trailing arrays of structures as flexible array members.
2139
fef3106c 2140fsquangle
68a57628 2141C++ ObjC++ WarnRemoved
fef3106c 2142
ee45a32d 2143fsso-struct=
fc73e60c 2144C ObjC Joined RejectNegative Enum(sso_struct) Var(default_sso) Init(SSO_NATIVE)
4e89adf9 2145-fsso-struct=[big-endian|little-endian|native] Set the default scalar storage order.
ee45a32d
EB
2146
2147Enum
2148Name(sso_struct) Type(enum scalar_storage_order_kind) UnknownError(unrecognized scalar storage order value %qs)
2149
2150EnumValue
2151Enum(sso_struct) String(big-endian) Value(SSO_BIG_ENDIAN)
2152
2153EnumValue
2154Enum(sso_struct) String(little-endian) Value(SSO_LITTLE_ENDIAN)
2155
4e89adf9
EB
2156EnumValue
2157Enum(sso_struct) String(native) Value(SSO_NATIVE)
2158
fef3106c 2159fstats
5498f011 2160C++ ObjC++ Var(flag_detailed_statistics)
a7b2e184 2161Display statistics accumulated during compilation.
fef3106c 2162
cbb4feb3
JM
2163fstrict-enums
2164C++ ObjC++ Optimization Var(flag_strict_enums)
a7b2e184 2165Assume that values of enumeration type are always within the minimum range of that type.
cbb4feb3 2166
fef3106c 2167fstrict-prototype
68a57628 2168C++ ObjC++ WarnRemoved
fef3106c 2169
d0cf395a
JM
2170fstrong-eval-order
2171C++ ObjC++ Common Alias(fstrong-eval-order=, all, none)
2172Follow the C++17 evaluation order requirements for assignment expressions,
2173shift, member function calls, etc.
2174
2175fstrong-eval-order=
d4a6c0ea 2176C++ ObjC++ Common Var(flag_strong_eval_order) Joined Enum(strong_eval_order) RejectNegative Init(-1)
d0cf395a
JM
2177Follow the C++17 evaluation order requirements for assignment expressions,
2178shift, member function calls, etc.
2179
2180Enum
2181Name(strong_eval_order) Type(int)
2182
2183EnumValue
2184Enum(strong_eval_order) String(none) Value(0)
2185
2186EnumValue
2187Enum(strong_eval_order) String(some) Value(1)
2188
2189EnumValue
2190Enum(strong_eval_order) String(all) Value(2)
2191
a12bf402
MLI
2192ftemplate-backtrace-limit=
2193C++ ObjC++ Joined RejectNegative UInteger Var(template_backtrace_limit) Init(10)
a7b2e184 2194Set the maximum number of template instantiation notes for a single warning or error.
a12bf402 2195
fef3106c 2196ftemplate-depth-
5de8299c 2197C++ ObjC++ Joined RejectNegative Undocumented Alias(ftemplate-depth=)
124e0d27
MLI
2198
2199ftemplate-depth=
c22cacf3 2200C++ ObjC++ Joined RejectNegative UInteger
a7b2e184 2201-ftemplate-depth=<number> Specify maximum template instantiation depth.
fef3106c
NB
2202
2203fthis-is-variable
68a57628 2204C++ ObjC++ WarnRemoved
fef3106c 2205
40aac948 2206fthreadsafe-statics
5498f011 2207C++ ObjC++ Optimization Var(flag_threadsafe_statics) Init(1)
a7b2e184 2208-fno-threadsafe-statics Do not generate thread-safe code for initializing local statics.
40aac948 2209
fef3106c 2210funsigned-bitfields
f0036cca 2211C ObjC C++ ObjC++ Var(flag_signed_bitfields, 0)
a7b2e184 2212When \"signed\" or \"unsigned\" is not given make the bitfield unsigned.
fef3106c
NB
2213
2214funsigned-char
f0036cca 2215C ObjC C++ ObjC++ LTO Var(flag_signed_char, 0)
a7b2e184 2216Make \"char\" unsigned by default.
fef3106c
NB
2217
2218fuse-cxa-atexit
5498f011 2219C++ ObjC++ Var(flag_use_cxa_atexit) Init(DEFAULT_USE_CXA_ATEXIT)
a7b2e184 2220Use __cxa_atexit to register destructors.
fef3106c 2221
c7b5e395 2222fuse-cxa-get-exception-ptr
5498f011 2223C++ ObjC++ Var(flag_use_cxa_get_exception_ptr) Init(2)
a7b2e184 2224Use __cxa_get_exception_ptr in exception handling.
c7b5e395 2225
d7afec4b 2226fvisibility-inlines-hidden
d0b07283 2227C++ ObjC++
a7b2e184 2228Marks all inlined functions and methods as having hidden visibility.
d7afec4b 2229
ddbfd28d
GK
2230fvisibility-ms-compat
2231C++ ObjC++ Var(flag_visibility_ms_compat)
a7b2e184 2232Changes visibility to match Microsoft Visual Studio by default.
ddbfd28d 2233
fef3106c 2234fvtable-gc
68a57628 2235C++ ObjC++ WarnRemoved
a7b2e184 2236No longer supported.
fef3106c
NB
2237
2238fvtable-thunks
68a57628 2239C++ ObjC++ WarnRemoved
a7b2e184 2240No longer supported.
fef3106c
NB
2241
2242fweak
5498f011 2243C++ ObjC++ Var(flag_weak) Init(1)
a7b2e184 2244Emit common-like symbols as weak symbols.
fef3106c 2245
e6cc3a24
ZW
2246fwide-exec-charset=
2247C ObjC C++ ObjC++ Joined RejectNegative
a7b2e184 2248-fwide-exec-charset=<cset> Convert all wide strings and character constants to character set <cset>.
e6cc3a24 2249
b20d9f0c 2250fworking-directory
5498f011 2251C ObjC C++ ObjC++ Var(flag_working_directory) Init(-1)
a7b2e184 2252Generate a #line directive pointing at the current working directory.
b20d9f0c 2253
fef3106c 2254fxref
68a57628 2255C++ ObjC++ WarnRemoved
a7b2e184 2256No longer supported.
fef3106c 2257
264fa2db 2258fzero-link
5498f011 2259ObjC ObjC++ Var(flag_zero_link)
a7b2e184 2260Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode.
264fa2db 2261
fef3106c 2262gen-decls
9ed32e27 2263ObjC ObjC++ Driver Var(flag_gen_declaration) RejectNegative
a7b2e184 2264Dump declarations to a .decl file.
fef3106c 2265
39ef6592
LC
2266femit-struct-debug-baseonly
2267C ObjC C++ ObjC++
a7b2e184 2268-femit-struct-debug-baseonly Aggressive reduced debug info for structs.
39ef6592
LC
2269
2270femit-struct-debug-reduced
2271C ObjC C++ ObjC++
a7b2e184 2272-femit-struct-debug-reduced Conservative reduced debug info for structs.
39ef6592
LC
2273
2274femit-struct-debug-detailed=
2275C ObjC C++ ObjC++ Joined
a7b2e184 2276-femit-struct-debug-detailed=<spec-list> Detailed reduced debug info for structs.
39ef6592 2277
a4a0016d 2278fext-numeric-literals
dcb466ec 2279C++ ObjC++ Var(flag_ext_numeric_literals) Init(1)
a4a0016d
ESR
2280Interpret imaginary, fixed-point, or other gnu number suffix as the corresponding
2281number literal rather than a user-defined number literal.
2282
fef3106c 2283idirafter
61ff2bdc 2284C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
a7b2e184 2285-idirafter <dir> Add <dir> to the end of the system include path.
fef3106c
NB
2286
2287imacros
61ff2bdc 2288C ObjC C++ ObjC++ Joined Separate MissingArgError(missing filename after %qs)
a7b2e184 2289-imacros <file> Accept definition of macros in <file>.
fef3106c 2290
2b6dd222
JM
2291imultilib
2292C ObjC C++ ObjC++ Joined Separate
a7b2e184 2293-imultilib <dir> Set <dir> to be the multilib include subdirectory.
2b6dd222 2294
fef3106c 2295include
61ff2bdc 2296C ObjC C++ ObjC++ Joined Separate MissingArgError(missing filename after %qs)
a7b2e184 2297-include <file> Include the contents of <file> before other files.
fef3106c
NB
2298
2299iprefix
2300C ObjC C++ ObjC++ Joined Separate
a7b2e184 2301-iprefix <path> Specify <path> as a prefix for next two options.
fef3106c
NB
2302
2303isysroot
61ff2bdc 2304C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
a7b2e184 2305-isysroot <dir> Set <dir> to be the system root directory.
fef3106c
NB
2306
2307isystem
61ff2bdc 2308C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
a7b2e184 2309-isystem <dir> Add <dir> to the start of the system include path.
fef3106c 2310
4bed3787 2311iquote
61ff2bdc 2312C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
a7b2e184 2313-iquote <dir> Add <dir> to the end of the quote include path.
4bed3787 2314
fef3106c
NB
2315iwithprefix
2316C ObjC C++ ObjC++ Joined Separate
a7b2e184 2317-iwithprefix <dir> Add <dir> to the end of the system include path.
fef3106c
NB
2318
2319iwithprefixbefore
2320C ObjC C++ ObjC++ Joined Separate
a7b2e184 2321-iwithprefixbefore <dir> Add <dir> to the end of the main include path.
fef3106c
NB
2322
2323lang-asm
603349bf 2324C Undocumented RejectDriver
fef3106c 2325
e200444e
JM
2326no-integrated-cpp
2327Driver
2328
fef3106c
NB
2329nostdinc
2330C ObjC C++ ObjC++
a7b2e184 2331Do not search standard system include directories (those specified with -isystem will still be used).
fef3106c
NB
2332
2333nostdinc++
72de27ea 2334C++ ObjC++
a7b2e184 2335Do not search standard system include directories for C++.
fef3106c
NB
2336
2337o
2338C ObjC C++ ObjC++ Joined Separate
72de27ea 2339; Documented in common.opt
fef3106c
NB
2340
2341pedantic
c1771a20 2342C ObjC C++ ObjC++ Alias(Wpedantic)
72de27ea 2343; Documented in common.opt
fef3106c 2344
fef3106c
NB
2345print-objc-runtime-info
2346ObjC ObjC++
a7b2e184 2347Generate C header of platform-specific features.
fef3106c
NB
2348
2349remap
2350C ObjC C++ ObjC++
a7b2e184 2351Remap file names when including files.
fef3106c
NB
2352
2353std=c++98
2354C++ ObjC++
a7b2e184 2355Conform to the ISO 1998 C++ standard revised by the 2003 technical corrigendum.
c7dc8804
JM
2356
2357std=c++03
2358C++ ObjC++ Alias(std=c++98)
a7b2e184 2359Conform to the ISO 1998 C++ standard revised by the 2003 technical corrigendum.
fef3106c 2360
97e3ad20 2361std=c++11
966541e3 2362C++ ObjC++
a7b2e184 2363Conform to the ISO 2011 C++ standard.
97e3ad20
JM
2364
2365std=c++0x
70e24808 2366C++ ObjC++ Alias(std=c++11) Undocumented
a7b2e184 2367Deprecated in favor of -std=c++11.
966541e3 2368
552b8185 2369std=c++1y
028aee17 2370C++ ObjC++ Alias(std=c++14) Undocumented
a7b2e184 2371Deprecated in favor of -std=c++14.
70e24808
JM
2372
2373std=c++14
381bf11e 2374C++ ObjC++
a7b2e184 2375Conform to the ISO 2014 C++ standard.
552b8185 2376
da73100b 2377std=c++1z
7b936140
JJ
2378C++ ObjC++ Alias(std=c++17) Undocumented
2379Deprecated in favor of -std=c++17.
da73100b
JM
2380
2381std=c++17
7b936140
JJ
2382C++ ObjC++
2383Conform to the ISO 2017 C++ standard.
da73100b 2384
026a79f7 2385std=c++2a
b04445d4 2386C++ ObjC++ Alias(std=c++20) Undocumented
c392d040 2387Conform to the ISO 2020 C++ standard (experimental and incomplete support).
fb260504
JM
2388
2389std=c++20
b04445d4 2390C++ ObjC++
c392d040 2391Conform to the ISO 2020 C++ standard (experimental and incomplete support).
026a79f7 2392
78739c2d
PF
2393std=c++2b
2394C++ ObjC++ Alias(std=c++23)
c392d040 2395Conform to the ISO 2023 C++ draft standard (experimental and incomplete support).
78739c2d
PF
2396
2397std=c++23
2398C++ ObjC++ Undocumented
2399Conform to the ISO 2023 C++ draft standard (experimental and incomplete support).
2400
48b0b196 2401std=c11
2778d766 2402C ObjC
a7b2e184 2403Conform to the ISO 2011 C standard.
48b0b196
JM
2404
2405std=c1x
2406C ObjC Alias(std=c11)
a7b2e184 2407Deprecated in favor of -std=c11.
2778d766 2408
c76dc9c3
JM
2409std=c17
2410C ObjC
7a8a92c4 2411Conform to the ISO 2017 C standard (published in 2018).
1e39313a
JM
2412
2413std=c18
2414C ObjC Alias(std=c17)
7a8a92c4 2415Conform to the ISO 2017 C standard (published in 2018).
c76dc9c3 2416
9f936c86
JM
2417std=c2x
2418C ObjC
2419Conform to the ISO 202X C standard draft (experimental and incomplete support).
2420
fef3106c 2421std=c89
5de8299c 2422C ObjC Alias(std=c90)
a7b2e184 2423Conform to the ISO 1990 C standard.
fef3106c 2424
7e1542b9
MLI
2425std=c90
2426C ObjC
a7b2e184 2427Conform to the ISO 1990 C standard.
7e1542b9 2428
fef3106c
NB
2429std=c99
2430C ObjC
a7b2e184 2431Conform to the ISO 1999 C standard.
fef3106c
NB
2432
2433std=c9x
5de8299c 2434C ObjC Alias(std=c99)
a7b2e184 2435Deprecated in favor of -std=c99.
fef3106c
NB
2436
2437std=gnu++98
2438C++ ObjC++
97e3ad20 2439Conform to the ISO 1998 C++ standard revised by the 2003 technical
a7b2e184 2440corrigendum with GNU extensions.
fef3106c 2441
97e3ad20
JM
2442std=gnu++03
2443C++ ObjC++ Alias(std=gnu++98)
2444Conform to the ISO 1998 C++ standard revised by the 2003 technical
a7b2e184 2445corrigendum with GNU extensions.
97e3ad20
JM
2446
2447std=gnu++11
966541e3 2448C++ ObjC++
a7b2e184 2449Conform to the ISO 2011 C++ standard with GNU extensions.
97e3ad20
JM
2450
2451std=gnu++0x
381bf11e 2452C++ ObjC++ Alias(std=gnu++11) Undocumented
a7b2e184 2453Deprecated in favor of -std=gnu++11.
966541e3 2454
552b8185 2455std=gnu++1y
028aee17 2456C++ ObjC++ Alias(std=gnu++14) Undocumented
a7b2e184 2457Deprecated in favor of -std=gnu++14.
552b8185 2458
a07f6ed2 2459std=gnu++14
028aee17 2460C++ ObjC++
a7b2e184 2461Conform to the ISO 2014 C++ standard with GNU extensions.
a07f6ed2 2462
da73100b 2463std=gnu++1z
7b936140
JJ
2464C++ ObjC++ Alias(std=gnu++17) Undocumented
2465Deprecated in favor of -std=gnu++17.
da73100b
JM
2466
2467std=gnu++17
7b936140
JJ
2468C++ ObjC++
2469Conform to the ISO 2017 C++ standard with GNU extensions.
da73100b 2470
026a79f7 2471std=gnu++2a
78739c2d 2472C++ ObjC++ Alias(std=gnu++20) Undocumented
c392d040 2473Conform to the ISO 2020 C++ standard with GNU extensions (experimental and incomplete support).
e78e50d5
MP
2474
2475std=gnu++20
b04445d4 2476C++ ObjC++
c392d040 2477Conform to the ISO 2020 C++ standard with GNU extensions (experimental and incomplete support).
026a79f7 2478
78739c2d
PF
2479std=gnu++2b
2480C++ ObjC++ Alias(std=gnu++23)
2481Conform to the ISO 2023 C++ draft standard with GNU extensions (experimental and incomplete support).
2482
2483std=gnu++23
2484C++ ObjC++ Undocumented
2485Conform to the ISO 2023 C++ draft standard with GNU extensions (experimental and incomplete support).
2486
48b0b196 2487std=gnu11
2778d766 2488C ObjC
a7b2e184 2489Conform to the ISO 2011 C standard with GNU extensions.
48b0b196
JM
2490
2491std=gnu1x
2492C ObjC Alias(std=gnu11)
a7b2e184 2493Deprecated in favor of -std=gnu11.
2778d766 2494
c76dc9c3
JM
2495std=gnu17
2496C ObjC
7a8a92c4 2497Conform to the ISO 2017 C standard (published in 2018) with GNU extensions.
1e39313a
JM
2498
2499std=gnu18
2500C ObjC Alias(std=gnu17)
7a8a92c4 2501Conform to the ISO 2017 C standard (published in 2018) with GNU extensions.
c76dc9c3 2502
9f936c86
JM
2503std=gnu2x
2504C ObjC
2505Conform to the ISO 202X C standard draft with GNU extensions (experimental and incomplete support).
2506
fef3106c 2507std=gnu89
5de8299c 2508C ObjC Alias(std=gnu90)
a7b2e184 2509Conform to the ISO 1990 C standard with GNU extensions.
fef3106c 2510
7e1542b9
MLI
2511std=gnu90
2512C ObjC
a7b2e184 2513Conform to the ISO 1990 C standard with GNU extensions.
7e1542b9 2514
fef3106c
NB
2515std=gnu99
2516C ObjC
a7b2e184 2517Conform to the ISO 1999 C standard with GNU extensions.
fef3106c
NB
2518
2519std=gnu9x
5de8299c 2520C ObjC Alias(std=gnu99)
a7b2e184 2521Deprecated in favor of -std=gnu99.
fef3106c
NB
2522
2523std=iso9899:1990
5de8299c 2524C ObjC Alias(std=c90)
a7b2e184 2525Conform to the ISO 1990 C standard.
fef3106c
NB
2526
2527std=iso9899:199409
2528C ObjC
a7b2e184 2529Conform to the ISO 1990 C standard as amended in 1994.
fef3106c
NB
2530
2531std=iso9899:1999
5de8299c 2532C ObjC Alias(std=c99)
a7b2e184 2533Conform to the ISO 1999 C standard.
fef3106c
NB
2534
2535std=iso9899:199x
5de8299c 2536C ObjC Alias(std=c99)
a7b2e184 2537Deprecated in favor of -std=iso9899:1999.
fef3106c 2538
48b0b196
JM
2539std=iso9899:2011
2540C ObjC Alias(std=c11)
a7b2e184 2541Conform to the ISO 2011 C standard.
48b0b196 2542
c76dc9c3
JM
2543std=iso9899:2017
2544C ObjC Alias(std=c17)
7a8a92c4 2545Conform to the ISO 2017 C standard (published in 2018).
1e39313a
JM
2546
2547std=iso9899:2018
2548C ObjC Alias(std=c17)
7a8a92c4 2549Conform to the ISO 2017 C standard (published in 2018).
c76dc9c3 2550
662b9c55
IS
2551stdlib=
2552Driver C++ ObjC++ Common Condition(ENABLE_STDLIB_OPTION) Var(flag_stdlib_kind) Joined Enum(stdlib_kind) RejectNegative Init(1)
2553-stdlib=[libstdc++|libc++] The standard library to be used for C++ headers
2554and runtime.
2555
2556Enum
2557Name(stdlib_kind) Type(int)
2558
2559EnumValue
2560Enum(stdlib_kind) String(libstdc++) Value(1)
2561
2562EnumValue
2563Enum(stdlib_kind) String(libc++) Value(2)
2564
e200444e
JM
2565traditional
2566Driver
2567
fef3106c
NB
2568traditional-cpp
2569C ObjC C++ ObjC++
a7b2e184 2570Enable traditional preprocessing.
fef3106c
NB
2571
2572trigraphs
2573C ObjC C++ ObjC++
a7b2e184 2574-trigraphs Support ISO C trigraphs.
fef3106c
NB
2575
2576undef
5498f011 2577C ObjC C++ ObjC++ Var(flag_undef)
a7b2e184 2578Do not predefine system-specific and GCC-specific macros.
fef3106c
NB
2579
2580v
d5478783
JM
2581C ObjC C++ ObjC++
2582; Documented in common.opt
fef3106c
NB
2583
2584w
2585C ObjC C++ ObjC++
72de27ea 2586; Documented in common.opt
e11a4ae5
NB
2587
2588; This comment is to ensure we retain the blank line above.