1 ; Options for the C, ObjC, C++ and ObjC++ front ends.
2 ; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
4 ; This file is part of GCC.
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 2, or (at your option) any later
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
16 ; You should have received a copy of the GNU General Public License
17 ; along with GCC; see the file COPYING. If not, write to the Free
18 ; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 ; This file is processed by the script opts.sh. It is a database of
23 ; command line options, with each record separated by a blank line,
24 ; and each field appearing on its own line. The first field is the
25 ; command-line switch with the leading "-" removed. All options
26 ; beginning with "f" or "W" are implicitly assumed to take a "no-"
27 ; form; this form should not be listed. If you do not want this
28 ; negative form and you want it to be automatically rejected, add
29 ; RejectNegative to the second field.
31 ; The second field is a space-separated list of which parts of the
32 ; compiler recognize the switch, as declared by "Language" entries.
33 ; If the switch takes an argument, then you should also specify
34 ; "Joined" and/or "Separate" to indicate where the argument can
35 ; appear. If a Joined argument can legitimately be omitted, specify
36 ; "JoinedOrMissing" instead of "Joined". If the argument to a switch
37 ; is a non-negative integer, you can specify "UInteger" and the switch
38 ; decoder will convert the argument for you, or complain to the user
39 ; if the argument is invalid. "Var(name,set)" creates an integer
40 ; variable "name". The variable is declared and initialized to value
41 ; given by "Init(value)" (or zero if this property is not defined).
42 ; When the option is passed to compiler, this variable is set to "set"
43 ; if value passed through the flag is nonzero, !"set" if value is zero,
44 ; or to value if "set" is omitted. If "VarExists" is specified, the
45 ; declaration for the variable is not created. If "Report" is specified,
46 ; the flag is output with -fverbose-asm.
48 ; The third field is the help text to output with --help. This is
49 ; automatically line-wrapped on output. Normally the switch is output
50 ; automatically, with the help text on the right hand side of the
51 ; output. However, if the help text contains a tab character, the
52 ; text to the left of the tab is output instead of the switch, and the
53 ; text to its right forms the help. This is useful for elaborating on
54 ; what type of argument a switch takes, for example. If the second
55 ; field contains "Undocumented" then nothing is output with --help.
56 ; Only do this with good reason like the switch being internal between
57 ; the driver and the front end - it is not an excuse to leave a switch
60 ; Comments can appear on their own line anwhere in the file, preceded
61 ; by a semicolon. Whitespace is permitted before the semicolon.
63 ; For each switch XXX below, an enumeration constant is created by the
64 ; script opts.sh spelt OPT_XXX, but with all non-alphanumeric
65 ; characters replaced with an underscore.
67 ; Please try to keep this file in ASCII collating order.
82 C ObjC C++ ObjC++ Joined Separate
85 C ObjC C++ ObjC++ Joined Separate
86 -A<question>=<answer> Assert the <answer> to <question>. Putting '-' before <question> disables the <answer> to <question>
90 Do not discard comments
94 Do not discard comments in macro expansions
97 C ObjC C++ ObjC++ Joined Separate
98 -D<macro>[=<val>] Define a <macro> with <val> as its value. If just <macro> is given, <val> is taken to be 1
101 C ObjC C++ ObjC++ Undocumented
104 C ObjC C++ ObjC++ Joined Separate
105 -F <dir> Add <dir> to the end of the main framework include path
109 Print the name of header files as they are used
112 C ObjC C++ ObjC++ Joined Separate
113 -I <dir> Add <dir> to the end of the main include path
117 Generate make dependencies
120 C ObjC C++ ObjC++ Separate
121 Generate make dependencies and compile
124 C ObjC C++ ObjC++ Joined Separate
125 -MF <file> Write dependency output to the given file
129 Treat missing header files as generated files
133 Like -M but ignore system header files
136 C ObjC C++ ObjC++ Separate
137 Like -MD but ignore system header files
141 Generate phony targets for all headers
144 C ObjC C++ ObjC++ Joined Separate
145 -MQ <target> Add a MAKE-quoted target
148 C ObjC C++ ObjC++ Joined Separate
149 -MT <target> Add an unquoted target
153 Do not generate #line directives
156 C ObjC C++ ObjC++ Joined Separate
157 -U<macro> Undefine <macro>
160 C++ ObjC++ Var(warn_abi)
161 Warn about things that will change when compiling with an ABI-compliant compiler
165 Enable most warning messages
168 C ObjC Var(warn_bad_function_cast)
169 Warn about casting functions to incompatible types
172 C ObjC C++ ObjC++ Var(warn_cast_qual)
173 Warn about casts which discard qualifiers
176 C ObjC C++ ObjC++ Var(warn_char_subscripts)
177 Warn about subscripts whose type is \"char\"
181 Warn about possibly nested block comments, and C++ comments spanning more than one physical line
185 Synonym for -Wcomment
188 C ObjC C++ ObjC++ Var(warn_conversion)
189 Warn about possibly confusing type conversions
192 C++ ObjC++ Var(warn_ctor_dtor_privacy)
193 Warn when all constructors and destructors are private
195 Wdeclaration-after-statement
196 C ObjC Var(warn_declaration_after_statement)
197 Warn when a declaration is found after a statement
200 C++ ObjC++ Var(warn_deprecated) Init(1)
201 Warn about deprecated compiler features
204 C ObjC Var(warn_div_by_zero) Init(1)
205 Warn about compile-time integer division by zero
208 C++ ObjC++ Var(warn_ecpp)
209 Warn about violations of Effective C++ style rules
213 Warn about stray tokens after #elif and #endif
217 ; Documented in common.opt
219 Werror-implicit-function-declaration
220 C ObjC RejectNegative
221 Make implicit function declarations an error
224 C ObjC C++ ObjC++ Var(warn_float_equal)
225 Warn if testing floating point numbers for equality
229 Warn about printf/scanf/strftime/strfmon format string anomalies
232 C ObjC C++ ObjC++ Var(warn_format_extra_args)
233 Warn if passing too many arguments to a function for its format string
236 C ObjC C++ ObjC++ Var(warn_format_nonliteral)
237 Warn about format strings that are not literals
240 C ObjC C++ ObjC++ Var(warn_format_security)
241 Warn about possible security problems with format functions
244 C ObjC C++ ObjC++ Var(warn_format_y2k)
245 Warn about strftime formats yielding 2-digit years
248 C ObjC Var(warn_format_zero_length)
249 Warn about zero-length formats
252 C ObjC C++ ObjC++ Joined
255 C ObjC C++ ObjC++ Var(warn_init_self)
256 Warn about variables which are initialized to themselves.
261 Wimplicit-function-declaration
262 C ObjC Var(mesg_implicit_function_declaration) Init(-1)
263 Warn about implicit function declarations
266 C ObjC Var(warn_implicit_int)
267 Warn when a declaration does not specify a type
271 Deprecated. This switch has no effect.
274 C++ ObjC++ Var(warn_invalid_offsetof) Init(1)
275 Warn about invalid uses of the \"offsetof\" macro
279 Warn about PCH files that are found but not used
282 C ObjC C++ ObjC++ Var(warn_long_long) Init(1)
283 Do not warn about using \"long long\" when -pedantic
287 Warn about suspicious declarations of \"main\"
290 C ObjC C++ ObjC++ Var(warn_missing_braces)
291 Warn about possibly missing braces around initializers
293 Wmissing-declarations
294 C ObjC Var(warn_missing_declarations)
295 Warn about global functions without previous declarations
297 Wmissing-field-initializers
298 C ObjC C++ ObjC++ Var(warn_missing_field_initializers) Init(-1)
299 Warn about missing fields in struct initializers
301 Wmissing-format-attribute
302 C ObjC C++ ObjC++ Var(warn_missing_format_attribute)
303 Warn about functions which might be candidates for format attributes
305 Wmissing-include-dirs
307 Warn about user-specified include directories that do not exist
310 C ObjC Var(warn_missing_prototypes)
311 Warn about global functions without prototypes
315 Warn about use of multi-character character constants
318 C ObjC Var(warn_nested_externs)
319 Warn about \"extern\" declarations not at file scope
322 C++ ObjC++ Var(warn_nontemplate_friend) Init(1)
323 Warn when non-templatized friend functions are declared within a template
326 C++ ObjC++ Var(warn_nonvdtor)
327 Warn about non-virtual destructors
330 C ObjC Var(warn_nonnull)
331 Warn about NULL being passed to argument slots marked as requiring non-NULL
334 C++ ObjC++ Var(warn_old_style_cast)
335 Warn if a C-style cast is used in a program
337 Wold-style-definition
338 C ObjC Var(warn_old_style_definition)
339 Warn if an old-style parameter definition is used
342 C++ ObjC++ Var(warn_overloaded_virtual)
343 Warn about overloaded virtual function names
346 C ObjC C++ ObjC++ Var(warn_parentheses)
347 Warn about possibly missing parentheses
350 C++ ObjC++ Var(warn_pmf2ptr) Init(1)
351 Warn when converting the type of pointers to member functions
354 C ObjC C++ ObjC++ Var(warn_pointer_arith)
355 Warn about function pointer arithmetic
358 ObjC ObjC++ Var(warn_protocol) Init(1)
359 Warn if inherited methods are unimplemented
362 C ObjC C++ ObjC++ Var(warn_redundant_decls)
363 Warn about multiple declarations of the same object
366 C++ ObjC++ Var(warn_reorder)
367 Warn when the compiler reorders code
371 Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++)
374 ObjC ObjC++ Var(warn_selector)
375 Warn if a selector has multiple methods
378 C ObjC C++ ObjC++ Var(warn_sequence_point)
379 Warn about possible violations of sequence point rules
382 C ObjC C++ ObjC++ Var(warn_sign_compare) Init(-1)
383 Warn about signed-unsigned comparisons
386 C++ ObjC++ Var(warn_sign_promo)
387 Warn when overload promotes from unsigned to signed
390 C ObjC Var(warn_strict_prototypes)
391 Warn about unprototyped function declarations
394 C++ ObjC++ Var(warn_synth)
395 Warn when synthesis behavior differs from Cfront
399 Do not suppress warnings from system headers
402 C ObjC Var(warn_traditional)
403 Warn about features not present in traditional C
407 Warn if trigraphs are encountered that might affect the meaning of the program
410 ObjC ObjC++ Var(warn_undeclared_selector)
411 Warn about @selector()s without previously declared methods
415 Warn if an undefined macro is used in an #if directive
419 Warn about unrecognized pragmas
423 Warn about macros defined in the main file that are not used
427 Do not warn about using variadic macros when -pedantic
431 Give strings the type \"array of char\"
434 C ObjC Var(warn_pointer_sign) Init(1)
435 Warn when a pointer differs in signedness in an assignment.
439 A synonym for -std=c89. In a future version of GCC it will become synonymous with -std=c99 instead
442 C ObjC C++ ObjC++ Joined
443 ; Documented in common.opt. FIXME - what about -dI, -dD, -dN and -dD?
447 Enforce class member access control semantics
452 falt-external-templates
454 Change when template instances are emitted
458 Recognize the \"asm\" keyword
462 Recognize built-in functions
465 C ObjC C++ ObjC++ Joined
469 Check the return value of new
473 Allow the arguments of the '?' operator to have different types
477 Reduce the size of object files
481 Make string literals \"const char[]\" not \"char[]\"
483 fconstant-string-class=
485 -fconst-string-class=<name> Use class <name> for constant strings
489 Inline member functions by default
491 fdollars-in-identifiers
493 Permit '$' as an identifier character
500 Generate code to check exception specifications
506 C ObjC C++ ObjC++ Joined RejectNegative
507 -fexec-charset=<cset> Convert all strings and character constants to character set <cset>
510 C ObjC C++ ObjC++ Joined RejectNegative
511 -finput-charset=<cset> Specify the default character set for source files.
525 Scope of for-init-statement variables is local to the loop
529 Do not assume that standard C libraries and \"main\" exist
533 Recognize GNU-defined keywords
537 Generate code for GNU runtime environment
550 Assume normal C execution environment
554 Enable support for huge objects
558 Export functions even if they can be inlined
560 fimplicit-inline-templates
562 Emit implicit instantiations of inline templates
566 Emit implicit instantiations of templates
573 Don't warn about uses of Microsoft extensions
575 fname-mangling-version-
583 Generate code for NeXT (Apple Mac OS X) runtime environment
587 Assume that receivers of Objective-C messages may be nil
597 Enable Objective-C exception and synchronization syntax
599 fobjc-sjlj-exceptions
601 Enable Objective-C setjmp exception handling runtime
605 Recognize C++ kewords like \"compl\" and \"xor\"
609 Enable optional diagnostics
616 Look for and use PCH files even when preprocessing
620 Downgrade conformance errors to warnings
624 Treat the input file as already preprocessed
626 freplace-objc-classes
628 Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime
632 Enable automatic template instantiation
636 Generate run time type descriptor information
640 Use the same size for double as for float
644 Use the narrowest integer type possible for enumeration types
648 Force the underlying type for \"wchar_t\" to be \"unsigned short\"
655 When \"signed\" or \"unsigned\" is not given make the bitfield signed
659 Make \"char\" signed by default
666 Display statistics accumulated during compilation
672 C ObjC C++ ObjC++ Joined RejectNegative UInteger
673 -ftabstop=<number> Distance between tab stops for column reporting
676 C++ ObjC++ Joined RejectNegative UInteger
677 -ftemplate-depth-<number> Specify maximum template instantiation depth
684 -fno-threadsafe-statics Do not generate thread-safe code for initializing local statics.
688 When \"signed\" or \"unsigned\" is not given make the bitfield unsigned
692 Make \"char\" unsigned by default
696 Use __cxa_atexit to register destructors
698 fvisibility-inlines-hidden
700 Marks all inlined methods as having hidden visibility
704 Discard unused virtual functions
708 Implement vtables using thunks
712 Emit common-like symbols as weak symbols
715 C ObjC C++ ObjC++ Joined RejectNegative
716 -fwide-exec-charset=<cset> Convert all wide strings and character constants to character set <cset>
720 Generate a #line directive pointing at the current working directory
724 Emit cross referencing information
728 Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode
732 Dump declarations to a .decl file
735 C ObjC C++ ObjC++ Joined Separate
736 -idirafter <dir> Add <dir> to the end of the system include path
739 C ObjC C++ ObjC++ Joined Separate
740 -imacros <file> Accept definition of macros in <file>
743 C ObjC C++ ObjC++ Joined Separate
744 -include <file> Include the contents of <file> before other files
747 C ObjC C++ ObjC++ Joined Separate
748 -iprefix <path> Specify <path> as a prefix for next two options
751 C ObjC C++ ObjC++ Joined Separate
752 -isysroot <dir> Set <dir> to be the system root directory
755 C ObjC C++ ObjC++ Joined Separate
756 -isystem <dir> Add <dir> to the start of the system include path
759 C ObjC C++ ObjC++ Joined Separate
760 -iquote <dir> Add <dir> to the end of the quote include path
763 C ObjC C++ ObjC++ Joined Separate
764 -iwithprefix <dir> Add <dir> to the end of the system include path
767 C ObjC C++ ObjC++ Joined Separate
768 -iwithprefixbefore <dir> Add <dir> to the end of the main include path
774 C ObjC C++ ObjC++ Undocumented
778 Do not search standard system include directories (those specified with -isystem will still be used)
782 Do not search standard system include directories for C++
785 C ObjC C++ ObjC++ Joined Separate
786 ; Documented in common.opt
790 ; Documented in common.opt
794 ; Documented in common.opt
796 print-objc-runtime-info
798 Generate C header of platform-specific features
802 Remap file names when including files
806 Conform to the ISO 1998 C++ standard
810 Conform to the ISO 1990 C standard
814 Conform to the ISO 1999 C standard
818 Deprecated in favor of -std=c99
822 Conform to the ISO 1998 C++ standard with GNU extensions
826 Conform to the ISO 1990 C standard with GNU extensions
830 Conform to the ISO 1999 C standard with GNU extensions
834 Deprecated in favor of -std=gnu99
838 Deprecated in favor of -std=c89
842 Conform to the ISO 1990 C standard as amended in 1994
846 Deprecated in favor of -std=c99
850 Deprecated in favor of -std=c99
854 Enable traditional preprocessing
858 -trigraphs Support ISO C trigraphs
862 Do not predefine system-specific and GCC-specific macros
866 Enable verbose output
870 ; Documented in common.opt
872 ; This comment is to ensure we retain the blank line above.