1 ; Options for the C, ObjC, C++ and ObjC++ front ends.
2 ; Copyright (C) 2003, 2004, 2005, 2006 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.
24 ; Please try to keep this file in ASCII collating order.
39 C ObjC C++ ObjC++ Joined Separate
42 C ObjC C++ ObjC++ Joined Separate
43 -A<question>=<answer> Assert the <answer> to <question>. Putting '-' before <question> disables the <answer> to <question>
47 Do not discard comments
51 Do not discard comments in macro expansions
54 C ObjC C++ ObjC++ Joined Separate
55 -D<macro>[=<val>] Define a <macro> with <val> as its value. If just <macro> is given, <val> is taken to be 1
58 C ObjC C++ ObjC++ Undocumented
61 C ObjC C++ ObjC++ Joined Separate
62 -F <dir> Add <dir> to the end of the main framework include path
66 Print the name of header files as they are used
69 C ObjC C++ ObjC++ Joined Separate
70 -I <dir> Add <dir> to the end of the main include path
74 Generate make dependencies
77 C ObjC C++ ObjC++ Separate
78 Generate make dependencies and compile
81 C ObjC C++ ObjC++ Joined Separate
82 -MF <file> Write dependency output to the given file
86 Treat missing header files as generated files
90 Like -M but ignore system header files
93 C ObjC C++ ObjC++ Separate
94 Like -MD but ignore system header files
98 Generate phony targets for all headers
101 C ObjC C++ ObjC++ Joined Separate
102 -MQ <target> Add a MAKE-quoted target
105 C ObjC C++ ObjC++ Joined Separate
106 -MT <target> Add an unquoted target
110 Do not generate #line directives
113 C ObjC C++ ObjC++ Joined Separate
114 -U<macro> Undefine <macro>
117 C++ ObjC++ Var(warn_abi)
118 Warn about things that will change when compiling with an ABI-compliant compiler
121 C ObjC C++ ObjC++ Var(warn_address)
122 Warn about suspicious uses of memory addresses
126 Enable most warning messages
129 ObjC ObjC++ Var(warn_assign_intercept)
130 Warn whenever an Objective-C assignment is being intercepted by the garbage collector
133 C ObjC Var(warn_bad_function_cast)
134 Warn about casting functions to incompatible types
137 C ObjC Var(warn_cxx_compat)
138 Warn about C constructs that are not in the common subset of C and C++
142 C ObjC C++ ObjC++ Var(warn_cast_qual)
143 Warn about casts which discard qualifiers
146 C ObjC C++ ObjC++ Var(warn_char_subscripts)
147 Warn about subscripts whose type is \"char\"
151 Warn about possibly nested block comments, and C++ comments spanning more than one physical line
155 Synonym for -Wcomment
158 C ObjC C++ ObjC++ Var(warn_conversion)
159 Warn about possibly confusing type conversions
162 C++ ObjC++ Var(warn_ctor_dtor_privacy)
163 Warn when all constructors and destructors are private
165 Wdeclaration-after-statement
166 C ObjC Var(warn_declaration_after_statement)
167 Warn when a declaration is found after a statement
170 C++ ObjC++ Var(warn_deprecated) Init(1)
171 Warn about deprecated compiler features
174 C ObjC C++ ObjC++ Var(warn_div_by_zero) Init(1)
175 Warn about compile-time integer division by zero
178 C++ ObjC++ Var(warn_ecpp)
179 Warn about violations of Effective C++ style rules
183 Warn about stray tokens after #elif and #endif
187 ; Documented in common.opt
189 Werror-implicit-function-declaration
190 C ObjC RejectNegative
191 Make implicit function declarations an error
194 C ObjC C++ ObjC++ Var(warn_float_equal)
195 Warn if testing floating point numbers for equality
199 Warn about printf/scanf/strftime/strfmon format string anomalies
202 C ObjC C++ ObjC++ Var(warn_format_extra_args)
203 Warn if passing too many arguments to a function for its format string
206 C ObjC C++ ObjC++ Var(warn_format_nonliteral)
207 Warn about format strings that are not literals
210 C ObjC C++ ObjC++ Var(warn_format_security)
211 Warn about possible security problems with format functions
214 C ObjC C++ ObjC++ Var(warn_format_y2k)
215 Warn about strftime formats yielding 2-digit years
218 C ObjC Var(warn_format_zero_length)
219 Warn about zero-length formats
222 C ObjC C++ ObjC++ Joined
225 C ObjC C++ ObjC++ Var(warn_init_self)
226 Warn about variables which are initialized to themselves
231 Wimplicit-function-declaration
232 C ObjC Var(mesg_implicit_function_declaration) Init(-1)
233 Warn about implicit function declarations
236 C ObjC Var(warn_implicit_int)
237 Warn when a declaration does not specify a type
241 Deprecated. This switch has no effect
244 C ObjC Var(warn_int_to_pointer_cast) Init(1)
245 Warn when there is a cast to a pointer from an integer of a different size
248 C++ ObjC++ Var(warn_invalid_offsetof) Init(1)
249 Warn about invalid uses of the \"offsetof\" macro
253 Warn about PCH files that are found but not used
256 C ObjC C++ ObjC++ Var(warn_long_long) Init(1)
257 Do not warn about using \"long long\" when -pedantic
261 Warn about suspicious declarations of \"main\"
264 C ObjC C++ ObjC++ Var(warn_missing_braces)
265 Warn about possibly missing braces around initializers
267 Wmissing-declarations
268 C ObjC Var(warn_missing_declarations)
269 Warn about global functions without previous declarations
271 Wmissing-field-initializers
272 C ObjC C++ ObjC++ Var(warn_missing_field_initializers) Init(-1)
273 Warn about missing fields in struct initializers
275 Wmissing-format-attribute
276 C ObjC C++ ObjC++ Var(warn_missing_format_attribute)
277 Warn about functions which might be candidates for format attributes
279 Wmissing-include-dirs
281 Warn about user-specified include directories that do not exist
283 ; APPLE LOCAL begin warn missing prototype 6261539
285 C ObjC C++ ObjC++ Var(warn_missing_prototypes)
286 Warn about global functions without prototypes
287 ; APPLE LOCAL end warn missing prototype 6261539
289 ; APPLE LOCAL begin -Wmost
292 Like -Wall but without -Wparentheses
293 ; APPLE LOCAL end -Wmost
297 Warn about use of multi-character character constants
300 C ObjC Var(warn_nested_externs)
301 Warn about \"extern\" declarations not at file scope
303 ; APPLE LOCAL begin -Wnewline-eof
306 Warn about files missing a newline at the end of the file
307 ; APPLE LOCAL end -Wnewline-eof
310 C++ ObjC++ Var(warn_nontemplate_friend) Init(1)
311 Warn when non-templatized friend functions are declared within a template
314 C++ ObjC++ Var(warn_nonvdtor)
315 Warn about non-virtual destructors
318 C ObjC Var(warn_nonnull)
319 Warn about NULL being passed to argument slots marked as requiring non-NULL
322 C ObjC C++ ObjC++ Joined
323 -Wnormalized=<id|nfc|nfkc> Warn about non-normalised Unicode strings
326 C++ ObjC++ Var(warn_old_style_cast)
327 Warn if a C-style cast is used in a program
329 Wold-style-definition
330 C ObjC Var(warn_old_style_definition)
331 Warn if an old-style parameter definition is used
334 C ObjC C++ ObjC++ Var(warn_overlength_strings) Init(-1)
335 Warn if a string is longer than the maximum portable length specified by the standard
338 C++ ObjC++ Var(warn_overloaded_virtual)
339 Warn about overloaded virtual function names
342 C ObjC Var(warn_override_init) Init(-1)
343 Warn about overriding initializers without side effects
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 C ObjC Var(warn_pointer_to_int_cast) Init(1)
359 Warn when a pointer is cast to an integer of a different size
362 C ObjC C++ ObjC++ Var(warn_pragmas) Init(1)
363 Warn about misuses of pragmas
366 ObjC ObjC++ Var(warn_protocol) Init(1)
367 Warn if inherited methods are unimplemented
370 C ObjC C++ ObjC++ Var(warn_redundant_decls)
371 Warn about multiple declarations of the same object
374 C++ ObjC++ Var(warn_reorder)
375 Warn when the compiler reorders code
378 C ObjC C++ ObjC++ Var(warn_return_type)
379 Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++)
382 ObjC ObjC++ Var(warn_selector)
383 Warn if a selector has multiple methods
386 C ObjC C++ ObjC++ Var(warn_sequence_point)
387 Warn about possible violations of sequence point rules
390 C ObjC C++ ObjC++ Var(warn_sign_compare) Init(-1)
391 Warn about signed-unsigned comparisons
394 C++ ObjC++ Var(warn_sign_promo)
395 Warn when overload promotes from unsigned to signed
397 Wstrict-null-sentinel
399 Warn about uncasted NULL used as sentinel
402 C ObjC Var(warn_strict_prototypes)
403 Warn about unprototyped function declarations
405 Wstrict-selector-match
406 ObjC ObjC++ Var(warn_strict_selector_match)
407 Warn if type signatures of candidate methods do not match exactly
410 C++ ObjC++ Var(warn_synth)
411 Warn when synthesis behavior differs from Cfront
415 Do not suppress warnings from system headers
418 C ObjC Var(warn_traditional)
419 Warn about features not present in traditional C
422 Common Var(warn_trampolines)
423 Warn when trampolines are emitted
427 Warn if trigraphs are encountered that might affect the meaning of the program
430 ObjC ObjC++ Var(warn_undeclared_selector)
431 Warn about @selector()s without previously declared methods
435 Warn if an undefined macro is used in an #if directive
439 Warn about unrecognized pragmas
443 Warn about macros defined in the main file that are not used
447 Do not warn about using variadic macros when -pedantic
450 C ObjC C++ ObjC++ Var(warn_vla) Init(-1) Warning
451 Warn if a variable length array is used
454 C ObjC C++ ObjC++ Var(warn_write_strings)
455 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.
458 C ObjC Var(warn_pointer_sign) Init(-1)
459 Warn when a pointer differs in signedness in an assignment
463 A synonym for -std=c89 (for C) or -std=c++98 (for C++)
466 C ObjC C++ ObjC++ Joined
467 ; Documented in common.opt. FIXME - what about -dI, -dD, -dN and -dD?
471 Enforce class member access control semantics
476 falt-external-templates
478 Change when template instances are emitted
482 Recognize the \"asm\" keyword
486 Recognize built-in functions
489 C ObjC C++ ObjC++ Joined
493 Check the return value of new
497 Allow the arguments of the '?' operator to have different types
501 Reduce the size of object files
503 fconstant-string-class=
505 -fconst-string-class=<name> Use class <name> for constant strings
509 Inline member functions by default
513 Preprocess directives only.
515 fdollars-in-identifiers
517 Permit '$' as an identifier character
524 Generate code to check exception specifications
530 C ObjC C++ ObjC++ Joined RejectNegative
531 -fexec-charset=<cset> Convert all strings and character constants to character set <cset>
533 fextended-identifiers
535 Permit universal character names (\\u and \\U) in identifiers
538 C ObjC C++ ObjC++ Joined RejectNegative
539 -finput-charset=<cset> Specify the default character set for source files
547 Scope of for-init-statement variables is local to the loop
551 Do not assume that standard C libraries and \"main\" exist
555 Recognize GNU-defined keywords
559 Generate code for GNU runtime environment
562 C ObjC Var(flag_gnu89_inline) Init(-1)
563 Use traditional GNU semantics for inline functions
576 Assume normal C execution environment
580 Enable support for huge objects
584 Export functions even if they can be inlined
586 fimplicit-inline-templates
588 Emit implicit instantiations of inline templates
592 Emit implicit instantiations of templates
595 C++ ObjC++ Var(flag_friend_injection)
596 Inject friend functions into enclosing namespace
601 flax-vector-conversions
603 Allow implicit conversions between vectors with differing numbers of subparts and/or differing element types.
607 Don't warn about uses of Microsoft extensions
609 fname-mangling-version-
615 ; APPLE LOCAL begin nested functions 4258406 4357979
617 C ObjC Var(flag_nested_functions)
618 Allow nested functions.
619 ; APPLE LOCAL end nested functions 4258406 4357979
623 Generate code for NeXT (Apple Mac OS X) runtime environment
627 Assume that receivers of Objective-C messages may be nil
635 ; Generate special '- .cxx_construct' and '- .cxx_destruct' methods
636 ; to initialize any non-POD ivars in Objective-C++ classes.
637 fobjc-call-cxx-cdtors
638 ObjC++ Var(flag_objc_call_cxx_cdtors)
639 Generate special Objective-C methods to initialize/destroy non-POD C++ ivars, if needed
641 fobjc-direct-dispatch
642 ObjC ObjC++ Var(flag_objc_direct_dispatch)
643 Allow fast jumps to the message dispatcher
645 ; Nonzero means that we will allow new ObjC exception syntax (@throw,
646 ; @try, etc.) in source code.
648 ObjC ObjC++ Var(flag_objc_exceptions)
649 Enable Objective-C exception and synchronization syntax
652 ObjC ObjC++ Var(flag_objc_gc)
653 Enable garbage collection (GC) in Objective-C/Objective-C++ programs
655 ; APPLE LOCAL begin radar 5811887 - blocks
657 C ObjC C++ ObjC++ Var(flag_blocks) Init(-1)
658 Program supports c/objc extension blocks
659 ; APPLE LOCAL end radar 5811887 - blocks
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
703 Generate run time type descriptor information
707 Use the same size for double as for float
711 Use the narrowest integer type possible for enumeration types
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
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 1990 C standard
909 Conform to the ISO 1999 C standard
913 Deprecated in favor of -std=c99
917 Conform to the ISO 1998 C++ standard with GNU extensions
921 Conform to the ISO 1990 C standard with GNU extensions
925 Conform to the ISO 1999 C standard with GNU extensions
929 Deprecated in favor of -std=gnu99
933 Conform to the ISO 1990 C standard
937 Conform to the ISO 1990 C standard as amended in 1994
941 Conform to the ISO 1999 C standard
945 Deprecated in favor of -std=iso9899:1999
949 Enable traditional preprocessing
953 -trigraphs Support ISO C trigraphs
957 Do not predefine system-specific and GCC-specific macros
961 Enable verbose output
965 ; Documented in common.opt
967 ; This comment is to ensure we retain the blank line above.