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