1 ; Options for the C, ObjC, C++ and ObjC++ front ends.
2 ; Copyright (C) 2003, 2004, 2005, 2006, 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA
21 ; See the GCC internals manual for a description of this file's format.
23 ; Please try to keep this file in ASCII collating order.
38 C ObjC C++ ObjC++ Joined Separate
41 C ObjC C++ ObjC++ Joined Separate
42 -A<question>=<answer> Assert the <answer> to <question>. Putting '-' before <question> disables the <answer> to <question>
46 Do not discard comments
50 Do not discard comments in macro expansions
53 C ObjC C++ ObjC++ Joined Separate
54 -D<macro>[=<val>] Define a <macro> with <val> as its value. If just <macro> is given, <val> is taken to be 1
57 C ObjC C++ ObjC++ Undocumented
60 C ObjC C++ ObjC++ Joined Separate
61 -F <dir> Add <dir> to the end of the main framework include path
65 Print the name of header files as they are used
68 C ObjC C++ ObjC++ Joined Separate
69 -I <dir> Add <dir> to the end of the main include path
73 Generate make dependencies
76 C ObjC C++ ObjC++ Separate
77 Generate make dependencies and compile
80 C ObjC C++ ObjC++ Joined Separate
81 -MF <file> Write dependency output to the given file
85 Treat missing header files as generated files
89 Like -M but ignore system header files
92 C ObjC C++ ObjC++ Separate
93 Like -MD but ignore system header files
97 Generate phony targets for all headers
100 C ObjC C++ ObjC++ Joined Separate
101 -MQ <target> Add a MAKE-quoted target
104 C ObjC C++ ObjC++ Joined Separate
105 -MT <target> Add an unquoted target
109 Do not generate #line directives
112 C ObjC C++ ObjC++ Joined Separate
113 -U<macro> Undefine <macro>
116 C++ ObjC++ Var(warn_abi) Warning
117 Warn about things that will change when compiling with an ABI-compliant compiler
120 C ObjC C++ ObjC++ Var(warn_address) Warning
121 Warn about suspicious uses of memory addresses
124 C ObjC C++ ObjC++ Warning
125 Enable most warning messages
128 C ObjC C++ ObjC++ Var(warn_type_limits) Init(-1) Warning
129 Warn if a comparison is always true or always false due to the limited range of the data type
132 ObjC ObjC++ Var(warn_assign_intercept) Warning
133 Warn whenever an Objective-C assignment is being intercepted by the garbage collector
136 C ObjC Var(warn_bad_function_cast) Warning
137 Warn about casting functions to incompatible types
140 C ObjC Var(warn_cxx_compat) Warning
141 Warn about C constructs that are not in the common subset of C and C++
144 C++ ObjC++ Var(warn_cxx0x_compat) Warning
145 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++ 200x
148 C ObjC C++ ObjC++ Var(warn_cast_qual) Warning
149 Warn about casts which discard qualifiers
152 C ObjC C++ ObjC++ Var(warn_char_subscripts) Warning
153 Warn about subscripts whose type is \"char\"
156 C ObjC C++ ObjC++ Var(warn_clobbered) Init(-1) Warning
157 Warn about variables that might be changed by \"longjmp\" or \"vfork\"
160 C ObjC C++ ObjC++ Warning
161 Warn about possibly nested block comments, and C++ comments spanning more than one physical line
164 C ObjC C++ ObjC++ Warning
165 Synonym for -Wcomment
168 C ObjC C++ ObjC++ Var(warn_conversion) Warning
169 Warn for implicit type conversions that may change a value
172 C ObjC C++ ObjC++ Var(warn_sign_conversion) Init(-1)
173 Warn for implicit type conversions between signed and unsigned integers
176 C++ ObjC++ Var(warn_ctor_dtor_privacy) Warning
177 Warn when all constructors and destructors are private
179 Wdeclaration-after-statement
180 C ObjC Var(warn_declaration_after_statement) Warning
181 Warn when a declaration is found after a statement
184 C++ ObjC++ Var(warn_deprecated) Init(1) Warning
185 Warn about deprecated compiler features
188 C ObjC C++ ObjC++ Var(warn_div_by_zero) Init(1) Warning
189 Warn about compile-time integer division by zero
192 C++ ObjC++ Var(warn_ecpp) Warning
193 Warn about violations of Effective C++ style rules
196 C ObjC C++ ObjC++ Var(warn_empty_body) Init(-1) Warning
197 Warn about an empty body in an if or else statement
200 C ObjC C++ ObjC++ Warning
201 Warn about stray tokens after #elif and #endif
205 ; Documented in common.opt
207 Werror-implicit-function-declaration
208 C ObjC RejectNegative Warning
209 This switch is deprecated; use -Werror=implicit-function-declaration instead
212 C ObjC C++ ObjC++ Var(warn_float_equal) Warning
213 Warn if testing floating point numbers for equality
216 C ObjC C++ ObjC++ Warning
217 Warn about printf/scanf/strftime/strfmon format string anomalies
220 C ObjC C++ ObjC++ Var(warn_format_extra_args) Warning
221 Warn if passing too many arguments to a function for its format string
224 C ObjC C++ ObjC++ Var(warn_format_nonliteral) Warning
225 Warn about format strings that are not literals
228 C ObjC C++ ObjC++ Var(warn_format_contains_nul) Warning
229 Warn about format strings that contain NUL bytes
232 C ObjC C++ ObjC++ Var(warn_format_security) Warning
233 Warn about possible security problems with format functions
236 C ObjC C++ ObjC++ Var(warn_format_y2k) Warning
237 Warn about strftime formats yielding 2-digit years
240 C ObjC Var(warn_format_zero_length) Warning
241 Warn about zero-length formats
244 C ObjC C++ ObjC++ Joined Warning
247 C ObjC C++ ObjC++ Var(warn_init_self) Warning
248 Warn about variables which are initialized to themselves
251 C ObjC C++ ObjC++ Warning
253 Wimplicit-function-declaration
254 C ObjC Var(warn_implicit_function_declaration) Init(-1) Warning
255 Warn about implicit function declarations
258 C ObjC Var(warn_implicit_int) Warning
259 Warn when a declaration does not specify a type
263 Deprecated. This switch has no effect
266 C ObjC Var(warn_int_to_pointer_cast) Init(1) Warning
267 Warn when there is a cast to a pointer from an integer of a different size
270 C++ ObjC++ Var(warn_invalid_offsetof) Init(1) Warning
271 Warn about invalid uses of the \"offsetof\" macro
274 C ObjC C++ ObjC++ Warning
275 Warn about PCH files that are found but not used
278 C ObjC C++ ObjC++ Var(warn_long_long) Init(1) Warning
279 Do not warn about using \"long long\" when -pedantic
282 C ObjC C++ ObjC++ Warning
283 Warn about suspicious declarations of \"main\"
286 C ObjC C++ ObjC++ Var(warn_missing_braces) Warning
287 Warn about possibly missing braces around initializers
289 Wmissing-declarations
290 C ObjC C++ ObjC++ Var(warn_missing_declarations) Warning
291 Warn about global functions without previous declarations
293 Wmissing-field-initializers
294 C ObjC C++ ObjC++ Var(warn_missing_field_initializers) Init(-1) Warning
295 Warn about missing fields in struct initializers
297 Wmissing-format-attribute
298 C ObjC C++ ObjC++ Var(warn_missing_format_attribute) Warning
299 Warn about functions which might be candidates for format attributes
301 Wmissing-include-dirs
302 C ObjC C++ ObjC++ Warning
303 Warn about user-specified include directories that do not exist
305 Wmissing-parameter-type
306 C ObjC Var(warn_missing_parameter_type) Init(-1) Warning
307 Warn about function parameters declared without a type specifier in K&R-style functions
310 C ObjC Var(warn_missing_prototypes) Warning
311 Warn about global functions without prototypes
314 C ObjC C++ ObjC++ Warning
315 Warn about use of multi-character character constants
318 C ObjC Var(warn_nested_externs) Warning
319 Warn about \"extern\" declarations not at file scope
322 C++ ObjC++ Var(warn_nontemplate_friend) Init(1) Warning
323 Warn when non-templatized friend functions are declared within a template
326 C++ ObjC++ Var(warn_nonvdtor) Warning
327 Warn about non-virtual destructors
330 C ObjC Var(warn_nonnull) Warning
331 Warn about NULL being passed to argument slots marked as requiring non-NULL
334 C ObjC C++ ObjC++ Joined Warning
335 -Wnormalized=<id|nfc|nfkc> Warn about non-normalised Unicode strings
338 C++ ObjC++ Var(warn_old_style_cast) Warning
339 Warn if a C-style cast is used in a program
341 Wold-style-declaration
342 C ObjC Var(warn_old_style_declaration) Init(-1) Warning
343 Warn for obsolescent usage in a declaration
345 Wold-style-definition
346 C ObjC Var(warn_old_style_definition) Warning
347 Warn if an old-style parameter definition is used
350 C ObjC C++ ObjC++ Var(warn_overlength_strings) Init(-1) Warning
351 Warn if a string is longer than the maximum portable length specified by the standard
354 C++ ObjC++ Var(warn_overloaded_virtual) Warning
355 Warn about overloaded virtual function names
358 C ObjC Var(warn_override_init) Init(-1) Warning
359 Warn about overriding initializers without side effects
362 C ObjC C++ ObjC++ Var(warn_parentheses) Warning
363 Warn about possibly missing parentheses
366 C++ ObjC++ Var(warn_pmf2ptr) Init(1) Warning
367 Warn when converting the type of pointers to member functions
370 C ObjC C++ ObjC++ Var(warn_pointer_arith) Warning
371 Warn about function pointer arithmetic
374 C ObjC Var(warn_pointer_to_int_cast) Init(1) Warning
375 Warn when a pointer is cast to an integer of a different size
378 C ObjC C++ ObjC++ Var(warn_pragmas) Init(1) Warning
379 Warn about misuses of pragmas
382 ObjC ObjC++ Var(warn_protocol) Init(1) Warning
383 Warn if inherited methods are unimplemented
386 C ObjC C++ ObjC++ Var(warn_redundant_decls) Warning
387 Warn about multiple declarations of the same object
390 C++ ObjC++ Var(warn_reorder) Warning
391 Warn when the compiler reorders code
394 C ObjC C++ ObjC++ Var(warn_return_type) Warning
395 Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++)
398 ObjC ObjC++ Var(warn_selector) Warning
399 Warn if a selector has multiple methods
402 C ObjC C++ ObjC++ Var(warn_sequence_point) Warning
403 Warn about possible violations of sequence point rules
406 C ObjC C++ ObjC++ Var(warn_sign_compare) Init(-1) Warning
407 Warn about signed-unsigned comparisons
410 C++ ObjC++ Var(warn_sign_promo) Warning
411 Warn when overload promotes from unsigned to signed
413 Wstrict-null-sentinel
415 Warn about uncasted NULL used as sentinel
418 C ObjC Var(warn_strict_prototypes) Warning
419 Warn about unprototyped function declarations
421 Wstrict-selector-match
422 ObjC ObjC++ Var(warn_strict_selector_match) Warning
423 Warn if type signatures of candidate methods do not match exactly
426 C++ ObjC++ Var(warn_synth) Warning
427 Warn when synthesis behavior differs from Cfront
430 C ObjC C++ ObjC++ Warning
431 Do not suppress warnings from system headers
434 C ObjC Var(warn_traditional) Warning
435 Warn about features not present in traditional C
437 Wtraditional-conversion
438 C ObjC Var(warn_traditional_conversion) Warning
439 Warn of prototypes causing type conversions different from what would happen in the absence of prototype
442 C ObjC C++ ObjC++ Warning
443 Warn if trigraphs are encountered that might affect the meaning of the program
446 ObjC ObjC++ Var(warn_undeclared_selector) Warning
447 Warn about @selector()s without previously declared methods
450 C ObjC C++ ObjC++ Warning
451 Warn if an undefined macro is used in an #if directive
454 C ObjC C++ ObjC++ Warning
455 Warn about unrecognized pragmas
458 C ObjC C++ ObjC++ Warning
459 Warn about macros defined in the main file that are not used
462 C ObjC C++ ObjC++ Warning
463 Do not warn about using variadic macros when -pedantic
466 C ObjC C++ ObjC++ Var(warn_vla) Init(-1) Warning
467 Warn if a variable length array is used
470 C ObjC C++ ObjC++ Var(warn_write_strings) Warning
471 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.
474 C ObjC Var(warn_pointer_sign) Init(-1) Warning
475 Warn when a pointer differs in signedness in an assignment
479 A synonym for -std=c89 (for C) or -std=c++98 (for C++)
482 C ObjC C++ ObjC++ Joined
483 ; Documented in common.opt. FIXME - what about -dI, -dD, -dN and -dD?
487 Enforce class member access control semantics
492 falt-external-templates
494 Change when template instances are emitted
498 Recognize the \"asm\" keyword
502 Recognize built-in functions
505 C ObjC C++ ObjC++ Joined
509 Check the return value of new
513 Allow the arguments of the '?' operator to have different types
517 Reduce the size of object files
519 fconstant-string-class=
521 -fconst-string-class=<name> Use class <name> for constant strings
525 Inline member functions by default
527 fdollars-in-identifiers
529 Permit '$' as an identifier character
536 Generate code to check exception specifications
542 C ObjC C++ ObjC++ Joined RejectNegative
543 -fexec-charset=<cset> Convert all strings and character constants to character set <cset>
545 fextended-identifiers
547 Permit universal character names (\\u and \\U) in identifiers
550 C ObjC C++ ObjC++ Joined RejectNegative
551 -finput-charset=<cset> Specify the default character set for source files
559 Scope of for-init-statement variables is local to the loop
563 Do not assume that standard C libraries and \"main\" exist
567 Recognize GNU-defined keywords
571 Generate code for GNU runtime environment
574 C ObjC Var(flag_gnu89_inline) Init(-1)
575 Use traditional GNU semantics for inline functions
581 C++ ObjC++ Optimization
588 Assume normal C execution environment
592 Enable support for huge objects
596 Export functions even if they can be inlined
598 fimplicit-inline-templates
600 Emit implicit instantiations of inline templates
604 Emit implicit instantiations of templates
607 C++ ObjC++ Var(flag_friend_injection)
608 Inject friend functions into enclosing namespace
613 flax-vector-conversions
615 Allow implicit conversions between vectors with differing numbers of subparts and/or differing element types.
619 Don't warn about uses of Microsoft extensions
621 fname-mangling-version-
629 Generate code for NeXT (Apple Mac OS X) runtime environment
633 Assume that receivers of Objective-C messages may be nil
641 ; Generate special '- .cxx_construct' and '- .cxx_destruct' methods
642 ; to initialize any non-POD ivars in Objective-C++ classes.
643 fobjc-call-cxx-cdtors
644 ObjC++ Var(flag_objc_call_cxx_cdtors)
645 Generate special Objective-C methods to initialize/destroy non-POD C++ ivars, if needed
647 fobjc-direct-dispatch
648 ObjC ObjC++ Var(flag_objc_direct_dispatch)
649 Allow fast jumps to the message dispatcher
651 ; Nonzero means that we will allow new ObjC exception syntax (@throw,
652 ; @try, etc.) in source code.
654 ObjC ObjC++ Var(flag_objc_exceptions)
655 Enable Objective-C exception and synchronization syntax
658 ObjC ObjC++ Var(flag_objc_gc)
659 Enable garbage collection (GC) in Objective-C/Objective-C++ programs
661 ; Nonzero means that we generate NeXT setjmp based exceptions.
662 fobjc-sjlj-exceptions
663 ObjC ObjC++ Var(flag_objc_sjlj_exceptions) Init(-1)
664 Enable Objective-C setjmp exception handling runtime
667 C ObjC C++ ObjC++ Var(flag_openmp)
672 Recognize C++ kewords like \"compl\" and \"xor\"
676 Enable optional diagnostics
683 Look for and use PCH files even when preprocessing
687 Downgrade conformance errors to warnings
691 Treat the input file as already preprocessed
693 freplace-objc-classes
695 Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime
699 Enable automatic template instantiation
702 C++ ObjC++ Optimization
703 Generate run time type descriptor information
706 C ObjC C++ ObjC++ Optimization
707 Use the same size for double as for float
710 C ObjC C++ ObjC++ Optimization
711 Use the narrowest integer type possible for enumeration types
714 C ObjC C++ ObjC++ Optimization
715 Force the underlying type for \"wchar_t\" to be \"unsigned short\"
719 When \"signed\" or \"unsigned\" is not given make the bitfield signed
723 Make \"char\" signed by default
730 Display statistics accumulated during compilation
736 C ObjC C++ ObjC++ Joined RejectNegative UInteger
737 -ftabstop=<number> Distance between tab stops for column reporting
740 C++ ObjC++ Joined RejectNegative UInteger
741 -ftemplate-depth-<number> Specify maximum template instantiation depth
747 C++ ObjC++ Optimization
748 -fno-threadsafe-statics Do not generate thread-safe code for initializing local statics
752 When \"signed\" or \"unsigned\" is not given make the bitfield unsigned
756 Make \"char\" unsigned by default
760 Use __cxa_atexit to register destructors
762 fuse-cxa-get-exception-ptr
764 Use __cxa_get_exception_ptr in exception handling
766 fvisibility-inlines-hidden
768 Marks all inlined methods as having hidden visibility
770 fvisibility-ms-compat
771 C++ ObjC++ Var(flag_visibility_ms_compat)
772 Changes visibility to match Microsoft Visual Studio by default
776 Discard unused virtual functions
780 Implement vtables using thunks
784 Emit common-like symbols as weak symbols
787 C ObjC C++ ObjC++ Joined RejectNegative
788 -fwide-exec-charset=<cset> Convert all wide strings and character constants to character set <cset>
792 Generate a #line directive pointing at the current working directory
796 Emit cross referencing information
800 Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode
804 Dump declarations to a .decl file
806 femit-struct-debug-baseonly
808 -femit-struct-debug-baseonly Aggressive reduced debug info for structs
810 femit-struct-debug-reduced
812 -femit-struct-debug-reduced Conservative reduced debug info for structs
814 femit-struct-debug-detailed=
815 C ObjC C++ ObjC++ Joined
816 -femit-struct-debug-detailed=<spec-list> Detailed reduced debug info for structs
819 C ObjC C++ ObjC++ Joined Separate
820 -idirafter <dir> Add <dir> to the end of the system include path
823 C ObjC C++ ObjC++ Joined Separate
824 -imacros <file> Accept definition of macros in <file>
827 C ObjC C++ ObjC++ Joined Separate
828 -imultilib <dir> Set <dir> to be the multilib include subdirectory
831 C ObjC C++ ObjC++ Joined Separate
832 -include <file> Include the contents of <file> before other files
835 C ObjC C++ ObjC++ Joined Separate
836 -iprefix <path> Specify <path> as a prefix for next two options
839 C ObjC C++ ObjC++ Joined Separate
840 -isysroot <dir> Set <dir> to be the system root directory
843 C ObjC C++ ObjC++ Joined Separate
844 -isystem <dir> Add <dir> to the start of the system include path
847 C ObjC C++ ObjC++ Joined Separate
848 -iquote <dir> Add <dir> to the end of the quote include path
851 C ObjC C++ ObjC++ Joined Separate
852 -iwithprefix <dir> Add <dir> to the end of the system include path
855 C ObjC C++ ObjC++ Joined Separate
856 -iwithprefixbefore <dir> Add <dir> to the end of the main include path
865 C ObjC C++ ObjC++ Undocumented
869 Do not search standard system include directories (those specified with -isystem will still be used)
873 Do not search standard system include directories for C++
876 C ObjC C++ ObjC++ Joined Separate
877 ; Documented in common.opt
881 ; Documented in common.opt
885 ; Documented in common.opt
887 print-objc-runtime-info
889 Generate C header of platform-specific features
893 Print a checksum of the executable for PCH validity checking, and stop
897 Remap file names when including files
901 Conform to the ISO 1998 C++ standard
905 Conform to the ISO 1998 C++ standard, with extensions that are likely to
906 become a part of the upcoming ISO C++ standard, dubbed C++0x. Note that the
907 extensions enabled by this mode are experimental and may be removed in
908 future releases of GCC.
912 Conform to the ISO 1990 C standard
916 Conform to the ISO 1999 C standard
920 Deprecated in favor of -std=c99
924 Conform to the ISO 1998 C++ standard with GNU extensions
928 Conform to the ISO 1998 C++ standard, with GNU extensions and
929 extensions that are likely to become a part of the upcoming ISO C++
930 standard, dubbed C++0x. Note that the extensions enabled by this mode
931 are experimental and may be removed in future releases of GCC.
935 Conform to the ISO 1990 C standard with GNU extensions
939 Conform to the ISO 1999 C standard with GNU extensions
943 Deprecated in favor of -std=gnu99
947 Conform to the ISO 1990 C standard
951 Conform to the ISO 1990 C standard as amended in 1994
955 Conform to the ISO 1999 C standard
959 Deprecated in favor of -std=iso9899:1999
963 Enable traditional preprocessing
967 -trigraphs Support ISO C trigraphs
971 Do not predefine system-specific and GCC-specific macros
975 Enable verbose output
979 ; Documented in common.opt
981 ; This comment is to ensure we retain the blank line above.