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
389 Wstrict-null-sentinel
391 Warn about uncasted NULL used as sentinel
394 C ObjC Var(warn_strict_prototypes)
395 Warn about unprototyped function declarations
398 C++ ObjC++ Var(warn_synth)
399 Warn when synthesis behavior differs from Cfront
403 Do not suppress warnings from system headers
406 C ObjC Var(warn_traditional)
407 Warn about features not present in traditional C
411 Warn if trigraphs are encountered that might affect the meaning of the program
414 ObjC ObjC++ Var(warn_undeclared_selector)
415 Warn about @selector()s without previously declared methods
419 Warn if an undefined macro is used in an #if directive
423 Warn about unrecognized pragmas
427 Warn about macros defined in the main file that are not used
431 Do not warn about using variadic macros when -pedantic
435 Give strings the type \"array of char\"
438 C ObjC Var(warn_pointer_sign) Init(1)
439 Warn when a pointer differs in signedness in an assignment.
443 A synonym for -std=c89 (for C) or -std=c++98 (for C++).
446 C ObjC C++ ObjC++ Joined
447 ; Documented in common.opt. FIXME - what about -dI, -dD, -dN and -dD?
451 Enforce class member access control semantics
456 falt-external-templates
458 Change when template instances are emitted
462 Recognize the \"asm\" keyword
466 Recognize built-in functions
469 C ObjC C++ ObjC++ Joined
473 Check the return value of new
477 Allow the arguments of the '?' operator to have different types
481 Reduce the size of object files
485 Make string literals \"const char[]\" not \"char[]\"
487 fconstant-string-class=
489 -fconst-string-class=<name> Use class <name> for constant strings
493 Inline member functions by default
495 fdollars-in-identifiers
497 Permit '$' as an identifier character
504 Generate code to check exception specifications
510 C ObjC C++ ObjC++ Joined RejectNegative
511 -fexec-charset=<cset> Convert all strings and character constants to character set <cset>
514 C ObjC C++ ObjC++ Joined RejectNegative
515 -finput-charset=<cset> Specify the default character set for source files.
529 Scope of for-init-statement variables is local to the loop
533 Do not assume that standard C libraries and \"main\" exist
537 Recognize GNU-defined keywords
541 Generate code for GNU runtime environment
554 Assume normal C execution environment
558 Enable support for huge objects
562 Export functions even if they can be inlined
564 fimplicit-inline-templates
566 Emit implicit instantiations of inline templates
570 Emit implicit instantiations of templates
577 Don't warn about uses of Microsoft extensions
579 fname-mangling-version-
587 Generate code for NeXT (Apple Mac OS X) runtime environment
591 Assume that receivers of Objective-C messages may be nil
601 Enable Objective-C exception and synchronization syntax
603 fobjc-sjlj-exceptions
605 Enable Objective-C setjmp exception handling runtime
609 Recognize C++ kewords like \"compl\" and \"xor\"
613 Enable optional diagnostics
620 Look for and use PCH files even when preprocessing
624 Downgrade conformance errors to warnings
628 Treat the input file as already preprocessed
630 freplace-objc-classes
632 Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime
636 Enable automatic template instantiation
640 Generate run time type descriptor information
644 Use the same size for double as for float
648 Use the narrowest integer type possible for enumeration types
652 Force the underlying type for \"wchar_t\" to be \"unsigned short\"
659 When \"signed\" or \"unsigned\" is not given make the bitfield signed
663 Make \"char\" signed by default
670 Display statistics accumulated during compilation
676 C ObjC C++ ObjC++ Joined RejectNegative UInteger
677 -ftabstop=<number> Distance between tab stops for column reporting
680 C++ ObjC++ Joined RejectNegative UInteger
681 -ftemplate-depth-<number> Specify maximum template instantiation depth
688 -fno-threadsafe-statics Do not generate thread-safe code for initializing local statics.
692 When \"signed\" or \"unsigned\" is not given make the bitfield unsigned
696 Make \"char\" unsigned by default
700 Use __cxa_atexit to register destructors
702 fvisibility-inlines-hidden
704 Marks all inlined methods as having hidden visibility
708 Discard unused virtual functions
712 Implement vtables using thunks
716 Emit common-like symbols as weak symbols
719 C ObjC C++ ObjC++ Joined RejectNegative
720 -fwide-exec-charset=<cset> Convert all wide strings and character constants to character set <cset>
724 Generate a #line directive pointing at the current working directory
728 Emit cross referencing information
732 Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode
736 Dump declarations to a .decl file
739 C ObjC C++ ObjC++ Joined Separate
740 -idirafter <dir> Add <dir> to the end of the system include path
743 C ObjC C++ ObjC++ Joined Separate
744 -imacros <file> Accept definition of macros in <file>
747 C ObjC C++ ObjC++ Joined Separate
748 -include <file> Include the contents of <file> before other files
751 C ObjC C++ ObjC++ Joined Separate
752 -iprefix <path> Specify <path> as a prefix for next two options
755 C ObjC C++ ObjC++ Joined Separate
756 -isysroot <dir> Set <dir> to be the system root directory
759 C ObjC C++ ObjC++ Joined Separate
760 -isystem <dir> Add <dir> to the start of the system include path
763 C ObjC C++ ObjC++ Joined Separate
764 -iquote <dir> Add <dir> to the end of the quote include path
767 C ObjC C++ ObjC++ Joined Separate
768 -iwithprefix <dir> Add <dir> to the end of the system include path
771 C ObjC C++ ObjC++ Joined Separate
772 -iwithprefixbefore <dir> Add <dir> to the end of the main include path
778 C ObjC C++ ObjC++ Undocumented
782 Do not search standard system include directories (those specified with -isystem will still be used)
786 Do not search standard system include directories for C++
789 C ObjC C++ ObjC++ Joined Separate
790 ; Documented in common.opt
794 ; Documented in common.opt
798 ; Documented in common.opt
800 print-objc-runtime-info
802 Generate C header of platform-specific features
806 Remap file names when including files
810 Conform to the ISO 1998 C++ standard
814 Conform to the ISO 1990 C standard
818 Conform to the ISO 1999 C standard
822 Deprecated in favor of -std=c99
826 Conform to the ISO 1998 C++ standard with GNU extensions
830 Conform to the ISO 1990 C standard with GNU extensions
834 Conform to the ISO 1999 C standard with GNU extensions
838 Deprecated in favor of -std=gnu99
842 Conform to the ISO 1990 C standard
846 Conform to the ISO 1990 C standard as amended in 1994
850 Conform to the ISO 1999 C standard
854 Deprecated in favor of -std=iso9899:1999
858 Enable traditional preprocessing
862 -trigraphs Support ISO C trigraphs
866 Do not predefine system-specific and GCC-specific macros
870 Enable verbose output
874 ; Documented in common.opt
876 ; This comment is to ensure we retain the blank line above.