1 ; Options for the C, ObjC, C++ and ObjC++ front ends.
2 ; Copyright (C) 2003, 2004 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-format-attribute
298 C ObjC C++ ObjC++ Var(warn_missing_format_attribute)
299 Warn about functions which might be candidates for format attributes
301 Wmissing-include-dirs
303 Warn about user-specified include directories that do not exist
306 C ObjC Var(warn_missing_prototypes)
307 Warn about global functions without prototypes
311 Warn about use of multi-character character constants
314 C ObjC Var(warn_nested_externs)
315 Warn about \"extern\" declarations not at file scope
318 C++ ObjC++ Var(warn_nontemplate_friend) Init(1)
319 Warn when non-templatized friend functions are declared within a template
322 C++ ObjC++ Var(warn_nonvdtor)
323 Warn about non-virtual destructors
326 C ObjC Var(warn_nonnull)
327 Warn about NULL being passed to argument slots marked as requiring non-NULL
330 C++ ObjC++ Var(warn_old_style_cast)
331 Warn if a C-style cast is used in a program
333 Wold-style-definition
334 C ObjC Var(warn_old_style_definition)
335 Warn if an old-style parameter definition is used
338 C++ ObjC++ Var(warn_overloaded_virtual)
339 Warn about overloaded virtual function names
342 C ObjC C++ ObjC++ Var(warn_parentheses)
343 Warn about possibly missing parentheses
346 C++ ObjC++ Var(warn_pmf2ptr) Init(1)
347 Warn when converting the type of pointers to member functions
350 C ObjC C++ ObjC++ Var(warn_pointer_arith)
351 Warn about function pointer arithmetic
354 ObjC ObjC++ Var(warn_protocol) Init(1)
355 Warn if inherited methods are unimplemented
358 C ObjC C++ ObjC++ Var(warn_redundant_decls)
359 Warn about multiple declarations of the same object
362 C++ ObjC++ Var(warn_reorder)
363 Warn when the compiler reorders code
367 Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++)
370 ObjC ObjC++ Var(warn_selector)
371 Warn if a selector has multiple methods
374 C ObjC C++ ObjC++ Var(warn_sequence_point)
375 Warn about possible violations of sequence point rules
378 C ObjC C++ ObjC++ Var(warn_sign_compare) Init(-1)
379 Warn about signed-unsigned comparisons
382 C++ ObjC++ Var(warn_sign_promo)
383 Warn when overload promotes from unsigned to signed
386 C ObjC Var(warn_strict_prototypes)
387 Warn about unprototyped function declarations
390 C++ ObjC++ Var(warn_synth)
391 Warn when synthesis behavior differs from Cfront
395 Do not suppress warnings from system headers
398 C ObjC Var(warn_traditional)
399 Warn about features not present in traditional C
403 Warn if trigraphs are encountered that might affect the meaning of the program
406 ObjC ObjC++ Var(warn_undeclared_selector)
407 Warn about @selector()s without previously declared methods
411 Warn if an undefined macro is used in an #if directive
415 Warn about unrecognized pragmas
419 Warn about macros defined in the main file that are not used
423 Do not warn about using variadic macros when -pedantic
427 Give strings the type \"array of char\"
431 A synonym for -std=c89. In a future version of GCC it will become synonymous with -std=c99 instead
434 C ObjC C++ ObjC++ Joined
435 ; Documented in common.opt. FIXME - what about -dI, -dD, -dN and -dD?
439 Enforce class member access control semantics
444 falt-external-templates
446 Change when template instances are emitted
450 Recognize the \"asm\" keyword
454 Recognize built-in functions
457 C ObjC C++ ObjC++ Joined
461 Check the return value of new
465 Allow the arguments of the '?' operator to have different types
469 Reduce the size of object files
473 Make string literals \"const char[]\" not \"char[]\"
475 fconstant-string-class=
477 -fconst-string-class=<name> Use class <name> for constant strings
481 Inline member functions by default
483 fdollars-in-identifiers
485 Permit '$' as an identifier character
492 Generate code to check exception specifications
498 C ObjC C++ ObjC++ Joined RejectNegative
499 -fexec-charset=<cset> Convert all strings and character constants to character set <cset>
502 C ObjC C++ ObjC++ Joined RejectNegative
503 -finput-charset=<cset> Specify the default character set for source files.
517 Scope of for-init-statement variables is local to the loop
521 Do not assume that standard C libraries and \"main\" exist
525 Recognize GNU-defined keywords
529 Generate code for GNU runtime environment
542 Assume normal C execution environment
546 Enable support for huge objects
550 Export functions even if they can be inlined
552 fimplicit-inline-templates
554 Emit implicit instantiations of inline templates
558 Emit implicit instantiations of templates
565 Don't warn about uses of Microsoft extensions
567 fname-mangling-version-
575 Generate code for NeXT (Apple Mac OS X) runtime environment
579 Assume that receivers of Objective-C messages may be nil
589 Enable Objective-C exception and synchronization syntax
591 fobjc-sjlj-exceptions
593 Enable Objective-C setjmp exception handling runtime
597 Recognize C++ kewords like \"compl\" and \"xor\"
601 Enable optional diagnostics
608 Look for and use PCH files even when preprocessing
612 Downgrade conformance errors to warnings
616 Treat the input file as already preprocessed
618 freplace-objc-classes
620 Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime
624 Enable automatic template instantiation
628 Generate run time type descriptor information
632 Use the same size for double as for float
636 Use the narrowest integer type possible for enumeration types
640 Force the underlying type for \"wchar_t\" to be \"unsigned short\"
647 When \"signed\" or \"unsigned\" is not given make the bitfield signed
651 Make \"char\" signed by default
658 Display statistics accumulated during compilation
664 C ObjC C++ ObjC++ Joined RejectNegative UInteger
665 -ftabstop=<number> Distance between tab stops for column reporting
668 C++ ObjC++ Joined RejectNegative UInteger
669 -ftemplate-depth-<number> Specify maximum template instantiation depth
676 When \"signed\" or \"unsigned\" is not given make the bitfield unsigned
680 Make \"char\" unsigned by default
684 Use __cxa_atexit to register destructors
688 Discard unused virtual functions
692 Implement vtables using thunks
696 Emit common-like symbols as weak symbols
699 C ObjC C++ ObjC++ Joined RejectNegative
700 -fwide-exec-charset=<cset> Convert all wide strings and character constants to character set <cset>
704 Generate a #line directive pointing at the current working directory
708 Emit cross referencing information
712 Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode
716 Dump declarations to a .decl file
719 C ObjC C++ ObjC++ Joined Separate
720 -idirafter <dir> Add <dir> to the end of the system include path
723 C ObjC C++ ObjC++ Joined Separate
724 -imacros <file> Accept definition of macros in <file>
727 C ObjC C++ ObjC++ Joined Separate
728 -include <file> Include the contents of <file> before other files
731 C ObjC C++ ObjC++ Joined Separate
732 -iprefix <path> Specify <path> as a prefix for next two options
735 C ObjC C++ ObjC++ Joined Separate
736 -isysroot <dir> Set <dir> to be the system root directory
739 C ObjC C++ ObjC++ Joined Separate
740 -isystem <dir> Add <dir> to the start of the system include path
743 C ObjC C++ ObjC++ Joined Separate
744 -iquote <dir> Add <dir> to the end of the quote include path
747 C ObjC C++ ObjC++ Joined Separate
748 -iwithprefix <dir> Add <dir> to the end of the system include path
751 C ObjC C++ ObjC++ Joined Separate
752 -iwithprefixbefore <dir> Add <dir> to the end of the main include path
758 C ObjC C++ ObjC++ Undocumented
762 Do not search standard system include directories (those specified with -isystem will still be used)
766 Do not search standard system include directories for C++
769 C ObjC C++ ObjC++ Joined Separate
770 ; Documented in common.opt
774 ; Documented in common.opt
778 ; Documented in common.opt
780 print-objc-runtime-info
782 Generate C header of platform-specific features
786 Remap file names when including files
790 Conform to the ISO 1998 C++ standard
794 Conform to the ISO 1990 C standard
798 Conform to the ISO 1999 C standard
802 Deprecated in favor of -std=c99
806 Conform to the ISO 1998 C++ standard with GNU extensions
810 Conform to the ISO 1990 C standard with GNU extensions
814 Conform to the ISO 1999 C standard with GNU extensions
818 Deprecated in favor of -std=gnu99
822 Deprecated in favor of -std=c89
826 Conform to the ISO 1990 C standard as amended in 1994
830 Deprecated in favor of -std=c99
834 Deprecated in favor of -std=c99
838 Enable traditional preprocessing
842 -trigraphs Support ISO C trigraphs
846 Do not predefine system-specific and GCC-specific macros
850 Enable verbose output
854 ; Documented in common.opt
856 ; This comment is to ensure we retain the blank line above.