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 3, 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 COPYING3. If not see
18 ; <http://www.gnu.org/licenses/>.
20 ; See the GCC internals manual for a description of this file's format.
22 ; Please try to keep this file in ASCII collating order.
37 C ObjC C++ ObjC++ Joined Separate
40 C ObjC C++ ObjC++ Joined Separate
41 -A<question>=<answer> Assert the <answer> to <question>. Putting '-' before <question> disables the <answer> to <question>
45 Do not discard comments
49 Do not discard comments in macro expansions
52 C ObjC C++ ObjC++ Joined Separate
53 -D<macro>[=<val>] Define a <macro> with <val> as its value. If just <macro> is given, <val> is taken to be 1
56 C ObjC C++ ObjC++ Undocumented
59 C ObjC C++ ObjC++ Joined Separate
60 -F <dir> Add <dir> to the end of the main framework include path
64 Print the name of header files as they are used
67 C ObjC C++ ObjC++ Joined Separate
68 -I <dir> Add <dir> to the end of the main include path
72 Generate make dependencies
75 C ObjC C++ ObjC++ Separate
76 Generate make dependencies and compile
79 C ObjC C++ ObjC++ Joined Separate
80 -MF <file> Write dependency output to the given file
84 Treat missing header files as generated files
88 Like -M but ignore system header files
91 C ObjC C++ ObjC++ Separate
92 Like -MD but ignore system header files
96 Generate phony targets for all headers
99 C ObjC C++ ObjC++ Joined Separate
100 -MQ <target> Add a MAKE-quoted target
103 C ObjC C++ ObjC++ Joined Separate
104 -MT <target> Add an unquoted target
108 Do not generate #line directives
111 C ObjC C++ ObjC++ Joined Separate
112 -U<macro> Undefine <macro>
115 C++ ObjC++ Var(warn_abi) Warning
116 Warn about things that will change when compiling with an ABI-compliant compiler
119 C ObjC C++ ObjC++ Var(warn_address) Warning
120 Warn about suspicious uses of memory addresses
123 C ObjC C++ ObjC++ Warning
124 Enable most warning messages
127 C ObjC C++ ObjC++ Var(warn_type_limits) Init(-1) Warning
128 Warn if a comparison is always true or always false due to the limited range of the data type
131 ObjC ObjC++ Var(warn_assign_intercept) Warning
132 Warn whenever an Objective-C assignment is being intercepted by the garbage collector
135 C ObjC Var(warn_bad_function_cast) Warning
136 Warn about casting functions to incompatible types
139 C ObjC Var(warn_cxx_compat) Warning
140 Warn about C constructs that are not in the common subset of C and C++
143 C++ ObjC++ Var(warn_cxx0x_compat) Warning
144 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++ 200x
147 C ObjC C++ ObjC++ Var(warn_cast_qual) Warning
148 Warn about casts which discard qualifiers
151 C ObjC C++ ObjC++ Var(warn_char_subscripts) Warning
152 Warn about subscripts whose type is \"char\"
155 C ObjC C++ ObjC++ Var(warn_clobbered) Init(-1) Warning
156 Warn about variables that might be changed by \"longjmp\" or \"vfork\"
159 C ObjC C++ ObjC++ Warning
160 Warn about possibly nested block comments, and C++ comments spanning more than one physical line
163 C ObjC C++ ObjC++ Warning
164 Synonym for -Wcomment
167 C ObjC C++ ObjC++ Var(warn_conversion) Warning
168 Warn for implicit type conversions that may change a value
171 C ObjC C++ ObjC++ Var(warn_sign_conversion) Init(-1)
172 Warn for implicit type conversions between signed and unsigned integers
175 C++ ObjC++ Var(warn_ctor_dtor_privacy) Warning
176 Warn when all constructors and destructors are private
178 Wdeclaration-after-statement
179 C ObjC Var(warn_declaration_after_statement) Warning
180 Warn when a declaration is found after a statement
183 C++ ObjC++ Var(warn_deprecated) Init(1) Warning
184 Warn about deprecated compiler features
187 C ObjC C++ ObjC++ Var(warn_div_by_zero) Init(1) Warning
188 Warn about compile-time integer division by zero
191 C++ ObjC++ Var(warn_ecpp) Warning
192 Warn about violations of Effective C++ style rules
195 C ObjC C++ ObjC++ Var(warn_empty_body) Init(-1) Warning
196 Warn about an empty body in an if or else statement
199 C ObjC C++ ObjC++ Warning
200 Warn about stray tokens after #elif and #endif
204 ; Documented in common.opt
206 Werror-implicit-function-declaration
207 C ObjC RejectNegative Warning
208 This switch is deprecated; use -Werror=implicit-function-declaration instead
211 C ObjC C++ ObjC++ Var(warn_float_equal) Warning
212 Warn if testing floating point numbers for equality
215 C ObjC C++ ObjC++ Warning
216 Warn about printf/scanf/strftime/strfmon format string anomalies
219 C ObjC C++ ObjC++ Var(warn_format_extra_args) Warning
220 Warn if passing too many arguments to a function for its format string
223 C ObjC C++ ObjC++ Var(warn_format_nonliteral) Warning
224 Warn about format strings that are not literals
227 C ObjC C++ ObjC++ Var(warn_format_contains_nul) Warning
228 Warn about format strings that contain NUL bytes
231 C ObjC C++ ObjC++ Var(warn_format_security) Warning
232 Warn about possible security problems with format functions
235 C ObjC C++ ObjC++ Var(warn_format_y2k) Warning
236 Warn about strftime formats yielding 2-digit years
239 C ObjC Var(warn_format_zero_length) Warning
240 Warn about zero-length formats
243 C ObjC C++ ObjC++ Joined Warning
246 C ObjC C++ ObjC++ Var(warn_init_self) Warning
247 Warn about variables which are initialized to themselves
250 C ObjC C++ ObjC++ Warning
252 Wimplicit-function-declaration
253 C ObjC Var(warn_implicit_function_declaration) Init(-1) Warning
254 Warn about implicit function declarations
257 C ObjC Var(warn_implicit_int) Warning
258 Warn when a declaration does not specify a type
262 Deprecated. This switch has no effect
265 C ObjC Var(warn_int_to_pointer_cast) Init(1) Warning
266 Warn when there is a cast to a pointer from an integer of a different size
269 C++ ObjC++ Var(warn_invalid_offsetof) Init(1) Warning
270 Warn about invalid uses of the \"offsetof\" macro
273 C ObjC C++ ObjC++ Warning
274 Warn about PCH files that are found but not used
277 C ObjC C++ ObjC++ Var(warn_long_long) Init(1) Warning
278 Do not warn about using \"long long\" when -pedantic
281 C ObjC C++ ObjC++ Warning
282 Warn about suspicious declarations of \"main\"
285 C ObjC C++ ObjC++ Var(warn_missing_braces) Warning
286 Warn about possibly missing braces around initializers
288 Wmissing-declarations
289 C ObjC C++ ObjC++ Var(warn_missing_declarations) Warning
290 Warn about global functions without previous declarations
292 Wmissing-field-initializers
293 C ObjC C++ ObjC++ Var(warn_missing_field_initializers) Init(-1) Warning
294 Warn about missing fields in struct initializers
296 Wmissing-format-attribute
297 C ObjC C++ ObjC++ Var(warn_missing_format_attribute) Warning
298 Warn about functions which might be candidates for format attributes
300 Wmissing-include-dirs
301 C ObjC C++ ObjC++ Warning
302 Warn about user-specified include directories that do not exist
304 Wmissing-parameter-type
305 C ObjC Var(warn_missing_parameter_type) Init(-1) Warning
306 Warn about function parameters declared without a type specifier in K&R-style functions
309 C ObjC Var(warn_missing_prototypes) Warning
310 Warn about global functions without prototypes
313 C ObjC C++ ObjC++ Warning
314 Warn about use of multi-character character constants
317 C ObjC Var(warn_nested_externs) Warning
318 Warn about \"extern\" declarations not at file scope
321 C++ ObjC++ Var(warn_nontemplate_friend) Init(1) Warning
322 Warn when non-templatized friend functions are declared within a template
325 C++ ObjC++ Var(warn_nonvdtor) Warning
326 Warn about non-virtual destructors
329 C ObjC Var(warn_nonnull) Warning
330 Warn about NULL being passed to argument slots marked as requiring non-NULL
333 C ObjC C++ ObjC++ Joined Warning
334 -Wnormalized=<id|nfc|nfkc> Warn about non-normalised Unicode strings
337 C++ ObjC++ Var(warn_old_style_cast) Warning
338 Warn if a C-style cast is used in a program
340 Wold-style-declaration
341 C ObjC Var(warn_old_style_declaration) Init(-1) Warning
342 Warn for obsolescent usage in a declaration
344 Wold-style-definition
345 C ObjC Var(warn_old_style_definition) Warning
346 Warn if an old-style parameter definition is used
349 C ObjC C++ ObjC++ Var(warn_overlength_strings) Init(-1) Warning
350 Warn if a string is longer than the maximum portable length specified by the standard
353 C++ ObjC++ Var(warn_overloaded_virtual) Warning
354 Warn about overloaded virtual function names
357 C ObjC Var(warn_override_init) Init(-1) Warning
358 Warn about overriding initializers without side effects
361 C ObjC C++ ObjC++ Var(warn_parentheses) Warning
362 Warn about possibly missing parentheses
365 C++ ObjC++ Var(warn_pmf2ptr) Init(1) Warning
366 Warn when converting the type of pointers to member functions
369 C ObjC C++ ObjC++ Var(warn_pointer_arith) Warning
370 Warn about function pointer arithmetic
373 C ObjC Var(warn_pointer_to_int_cast) Init(1) Warning
374 Warn when a pointer is cast to an integer of a different size
377 C ObjC C++ ObjC++ Var(warn_pragmas) Init(1) Warning
378 Warn about misuses of pragmas
381 ObjC ObjC++ Var(warn_protocol) Init(1) Warning
382 Warn if inherited methods are unimplemented
385 C ObjC C++ ObjC++ Var(warn_redundant_decls) Warning
386 Warn about multiple declarations of the same object
389 C++ ObjC++ Var(warn_reorder) Warning
390 Warn when the compiler reorders code
393 C ObjC C++ ObjC++ Var(warn_return_type) Warning
394 Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++)
397 ObjC ObjC++ Var(warn_selector) Warning
398 Warn if a selector has multiple methods
401 C ObjC C++ ObjC++ Var(warn_sequence_point) Warning
402 Warn about possible violations of sequence point rules
405 C ObjC C++ ObjC++ Var(warn_sign_compare) Init(-1) Warning
406 Warn about signed-unsigned comparisons
409 C++ ObjC++ Var(warn_sign_promo) Warning
410 Warn when overload promotes from unsigned to signed
412 Wstrict-null-sentinel
414 Warn about uncasted NULL used as sentinel
417 C ObjC Var(warn_strict_prototypes) Warning
418 Warn about unprototyped function declarations
420 Wstrict-selector-match
421 ObjC ObjC++ Var(warn_strict_selector_match) Warning
422 Warn if type signatures of candidate methods do not match exactly
425 C++ ObjC++ Var(warn_synth) Warning
426 Warn when synthesis behavior differs from Cfront
429 C ObjC C++ ObjC++ Warning
430 Do not suppress warnings from system headers
433 C ObjC Var(warn_traditional) Warning
434 Warn about features not present in traditional C
436 Wtraditional-conversion
437 C ObjC Var(warn_traditional_conversion) Warning
438 Warn of prototypes causing type conversions different from what would happen in the absence of prototype
441 C ObjC C++ ObjC++ Warning
442 Warn if trigraphs are encountered that might affect the meaning of the program
445 ObjC ObjC++ Var(warn_undeclared_selector) Warning
446 Warn about @selector()s without previously declared methods
449 C ObjC C++ ObjC++ Warning
450 Warn if an undefined macro is used in an #if directive
453 C ObjC C++ ObjC++ Warning
454 Warn about unrecognized pragmas
457 C ObjC C++ ObjC++ Warning
458 Warn about macros defined in the main file that are not used
461 C ObjC C++ ObjC++ Warning
462 Do not warn about using variadic macros when -pedantic
465 C ObjC C++ ObjC++ Var(warn_vla) Init(-1) Warning
466 Warn if a variable length array is used
469 C ObjC C++ ObjC++ Var(warn_write_strings) Warning
470 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.
473 C ObjC Var(warn_pointer_sign) Init(-1) Warning
474 Warn when a pointer differs in signedness in an assignment
478 A synonym for -std=c89 (for C) or -std=c++98 (for C++)
481 C ObjC C++ ObjC++ Joined
482 ; Documented in common.opt. FIXME - what about -dI, -dD, -dN and -dD?
486 Enforce class member access control semantics
491 falt-external-templates
493 Change when template instances are emitted
497 Recognize the \"asm\" keyword
501 Recognize built-in functions
504 C ObjC C++ ObjC++ Joined
508 Check the return value of new
512 Allow the arguments of the '?' operator to have different types
516 Reduce the size of object files
518 fconstant-string-class=
520 -fconst-string-class=<name> Use class <name> for constant strings
524 Inline member functions by default
526 fdollars-in-identifiers
528 Permit '$' as an identifier character
535 Generate code to check exception specifications
541 C ObjC C++ ObjC++ Joined RejectNegative
542 -fexec-charset=<cset> Convert all strings and character constants to character set <cset>
544 fextended-identifiers
546 Permit universal character names (\\u and \\U) in identifiers
549 C ObjC C++ ObjC++ Joined RejectNegative
550 -finput-charset=<cset> Specify the default character set for source files
558 Scope of for-init-statement variables is local to the loop
562 Do not assume that standard C libraries and \"main\" exist
566 Recognize GNU-defined keywords
570 Generate code for GNU runtime environment
573 C ObjC Var(flag_gnu89_inline) Init(-1)
574 Use traditional GNU semantics for inline functions
580 C++ ObjC++ Optimization
587 Assume normal C execution environment
591 Enable support for huge objects
595 Export functions even if they can be inlined
597 fimplicit-inline-templates
599 Emit implicit instantiations of inline templates
603 Emit implicit instantiations of templates
606 C++ ObjC++ Var(flag_friend_injection)
607 Inject friend functions into enclosing namespace
612 flax-vector-conversions
614 Allow implicit conversions between vectors with differing numbers of subparts and/or differing element types.
618 Don't warn about uses of Microsoft extensions
620 fname-mangling-version-
628 Generate code for NeXT (Apple Mac OS X) runtime environment
632 Assume that receivers of Objective-C messages may be nil
640 ; Generate special '- .cxx_construct' and '- .cxx_destruct' methods
641 ; to initialize any non-POD ivars in Objective-C++ classes.
642 fobjc-call-cxx-cdtors
643 ObjC++ Var(flag_objc_call_cxx_cdtors)
644 Generate special Objective-C methods to initialize/destroy non-POD C++ ivars, if needed
646 fobjc-direct-dispatch
647 ObjC ObjC++ Var(flag_objc_direct_dispatch)
648 Allow fast jumps to the message dispatcher
650 ; Nonzero means that we will allow new ObjC exception syntax (@throw,
651 ; @try, etc.) in source code.
653 ObjC ObjC++ Var(flag_objc_exceptions)
654 Enable Objective-C exception and synchronization syntax
657 ObjC ObjC++ Var(flag_objc_gc)
658 Enable garbage collection (GC) in Objective-C/Objective-C++ programs
660 ; Nonzero means that we generate NeXT setjmp based exceptions.
661 fobjc-sjlj-exceptions
662 ObjC ObjC++ Var(flag_objc_sjlj_exceptions) Init(-1)
663 Enable Objective-C setjmp exception handling runtime
666 C ObjC C++ ObjC++ Var(flag_openmp)
671 Recognize C++ kewords like \"compl\" and \"xor\"
675 Enable optional diagnostics
682 Look for and use PCH files even when preprocessing
686 Downgrade conformance errors to warnings
690 Treat the input file as already preprocessed
692 freplace-objc-classes
694 Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime
698 Enable automatic template instantiation
701 C++ ObjC++ Optimization
702 Generate run time type descriptor information
705 C ObjC C++ ObjC++ Optimization
706 Use the same size for double as for float
709 C ObjC C++ ObjC++ Optimization
710 Use the narrowest integer type possible for enumeration types
713 C ObjC C++ ObjC++ Optimization
714 Force the underlying type for \"wchar_t\" to be \"unsigned short\"
718 When \"signed\" or \"unsigned\" is not given make the bitfield signed
722 Make \"char\" signed by default
729 Display statistics accumulated during compilation
735 C ObjC C++ ObjC++ Joined RejectNegative UInteger
736 -ftabstop=<number> Distance between tab stops for column reporting
739 C++ ObjC++ Joined RejectNegative UInteger
740 -ftemplate-depth-<number> Specify maximum template instantiation depth
746 C++ ObjC++ Optimization
747 -fno-threadsafe-statics Do not generate thread-safe code for initializing local statics
751 When \"signed\" or \"unsigned\" is not given make the bitfield unsigned
755 Make \"char\" unsigned by default
759 Use __cxa_atexit to register destructors
761 fuse-cxa-get-exception-ptr
763 Use __cxa_get_exception_ptr in exception handling
765 fvisibility-inlines-hidden
767 Marks all inlined methods as having hidden visibility
769 fvisibility-ms-compat
770 C++ ObjC++ Var(flag_visibility_ms_compat)
771 Changes visibility to match Microsoft Visual Studio by default
775 Discard unused virtual functions
779 Implement vtables using thunks
783 Emit common-like symbols as weak symbols
786 C ObjC C++ ObjC++ Joined RejectNegative
787 -fwide-exec-charset=<cset> Convert all wide strings and character constants to character set <cset>
791 Generate a #line directive pointing at the current working directory
795 Emit cross referencing information
799 Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode
803 Dump declarations to a .decl file
805 femit-struct-debug-baseonly
807 -femit-struct-debug-baseonly Aggressive reduced debug info for structs
809 femit-struct-debug-reduced
811 -femit-struct-debug-reduced Conservative reduced debug info for structs
813 femit-struct-debug-detailed=
814 C ObjC C++ ObjC++ Joined
815 -femit-struct-debug-detailed=<spec-list> Detailed reduced debug info for structs
818 C ObjC C++ ObjC++ Joined Separate
819 -idirafter <dir> Add <dir> to the end of the system include path
822 C ObjC C++ ObjC++ Joined Separate
823 -imacros <file> Accept definition of macros in <file>
826 C ObjC C++ ObjC++ Joined Separate
827 -imultilib <dir> Set <dir> to be the multilib include subdirectory
830 C ObjC C++ ObjC++ Joined Separate
831 -include <file> Include the contents of <file> before other files
834 C ObjC C++ ObjC++ Joined Separate
835 -iprefix <path> Specify <path> as a prefix for next two options
838 C ObjC C++ ObjC++ Joined Separate
839 -isysroot <dir> Set <dir> to be the system root directory
842 C ObjC C++ ObjC++ Joined Separate
843 -isystem <dir> Add <dir> to the start of the system include path
846 C ObjC C++ ObjC++ Joined Separate
847 -iquote <dir> Add <dir> to the end of the quote include path
850 C ObjC C++ ObjC++ Joined Separate
851 -iwithprefix <dir> Add <dir> to the end of the system include path
854 C ObjC C++ ObjC++ Joined Separate
855 -iwithprefixbefore <dir> Add <dir> to the end of the main include path
864 C ObjC C++ ObjC++ Undocumented
868 Do not search standard system include directories (those specified with -isystem will still be used)
872 Do not search standard system include directories for C++
875 C ObjC C++ ObjC++ Joined Separate
876 ; Documented in common.opt
880 ; Documented in common.opt
884 ; Documented in common.opt
886 print-objc-runtime-info
888 Generate C header of platform-specific features
892 Print a checksum of the executable for PCH validity checking, and stop
896 Remap file names when including files
900 Conform to the ISO 1998 C++ standard
904 Conform to the ISO 1998 C++ standard, with extensions that are likely to
905 become a part of the upcoming ISO C++ standard, dubbed C++0x. Note that the
906 extensions enabled by this mode are experimental and may be removed in
907 future releases of GCC.
911 Conform to the ISO 1990 C standard
915 Conform to the ISO 1999 C standard
919 Deprecated in favor of -std=c99
923 Conform to the ISO 1998 C++ standard with GNU extensions
927 Conform to the ISO 1998 C++ standard, with GNU extensions and
928 extensions that are likely to become a part of the upcoming ISO C++
929 standard, dubbed C++0x. Note that the extensions enabled by this mode
930 are experimental and may be removed in future releases of GCC.
934 Conform to the ISO 1990 C standard with GNU extensions
938 Conform to the ISO 1999 C standard with GNU extensions
942 Deprecated in favor of -std=gnu99
946 Conform to the ISO 1990 C standard
950 Conform to the ISO 1990 C standard as amended in 1994
954 Conform to the ISO 1999 C standard
958 Deprecated in favor of -std=iso9899:1999
962 Enable traditional preprocessing
966 -trigraphs Support ISO C trigraphs
970 Do not predefine system-specific and GCC-specific macros
974 Enable verbose output
978 ; Documented in common.opt
980 ; This comment is to ensure we retain the blank line above.