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
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)
117 Warn about things that will change when compiling with an ABI-compliant compiler
121 Enable most warning messages
124 ObjC ObjC++ Var(warn_assign_intercept)
125 Warn whenever an Objective-C assignment is being intercepted by the garbage collector
128 C ObjC Var(warn_bad_function_cast)
129 Warn about casting functions to incompatible types
132 C ObjC C++ ObjC++ Var(warn_cast_qual)
133 Warn about casts which discard qualifiers
136 C ObjC C++ ObjC++ Var(warn_char_subscripts)
137 Warn about subscripts whose type is \"char\"
141 Warn about possibly nested block comments, and C++ comments spanning more than one physical line
145 Synonym for -Wcomment
148 C ObjC C++ ObjC++ Var(warn_conversion)
149 Warn about possibly confusing type conversions
152 C++ ObjC++ Var(warn_ctor_dtor_privacy)
153 Warn when all constructors and destructors are private
155 Wdeclaration-after-statement
156 C ObjC Var(warn_declaration_after_statement)
157 Warn when a declaration is found after a statement
160 C++ ObjC++ Var(warn_deprecated) Init(1)
161 Warn about deprecated compiler features
164 C ObjC Var(warn_div_by_zero) Init(1)
165 Warn about compile-time integer division by zero
168 C++ ObjC++ Var(warn_ecpp)
169 Warn about violations of Effective C++ style rules
173 Warn about stray tokens after #elif and #endif
177 ; Documented in common.opt
179 Werror-implicit-function-declaration
180 C ObjC RejectNegative
181 Make implicit function declarations an error
184 C ObjC C++ ObjC++ Var(warn_float_equal)
185 Warn if testing floating point numbers for equality
189 Warn about printf/scanf/strftime/strfmon format string anomalies
192 C ObjC C++ ObjC++ Var(warn_format_extra_args)
193 Warn if passing too many arguments to a function for its format string
196 C ObjC C++ ObjC++ Var(warn_format_nonliteral)
197 Warn about format strings that are not literals
200 C ObjC C++ ObjC++ Var(warn_format_security)
201 Warn about possible security problems with format functions
204 C ObjC C++ ObjC++ Var(warn_format_y2k)
205 Warn about strftime formats yielding 2-digit years
208 C ObjC Var(warn_format_zero_length)
209 Warn about zero-length formats
212 C ObjC C++ ObjC++ Joined
215 C ObjC C++ ObjC++ Var(warn_init_self)
216 Warn about variables which are initialized to themselves.
221 Wimplicit-function-declaration
222 C ObjC Var(mesg_implicit_function_declaration) Init(-1)
223 Warn about implicit function declarations
226 C ObjC Var(warn_implicit_int)
227 Warn when a declaration does not specify a type
231 Deprecated. This switch has no effect.
234 C ObjC Var(warn_int_to_pointer_cast) Init(1)
235 Warn when there is a cast to a pointer from an integer of a different size
238 C++ ObjC++ Var(warn_invalid_offsetof) Init(1)
239 Warn about invalid uses of the \"offsetof\" macro
243 Warn about PCH files that are found but not used
246 C ObjC C++ ObjC++ Var(warn_long_long) Init(1)
247 Do not warn about using \"long long\" when -pedantic
251 Warn about suspicious declarations of \"main\"
254 C ObjC C++ ObjC++ Var(warn_missing_braces)
255 Warn about possibly missing braces around initializers
257 Wmissing-declarations
258 C ObjC Var(warn_missing_declarations)
259 Warn about global functions without previous declarations
261 Wmissing-field-initializers
262 C ObjC C++ ObjC++ Var(warn_missing_field_initializers) Init(-1)
263 Warn about missing fields in struct initializers
265 Wmissing-format-attribute
266 C ObjC C++ ObjC++ Var(warn_missing_format_attribute)
267 Warn about functions which might be candidates for format attributes
269 Wmissing-include-dirs
271 Warn about user-specified include directories that do not exist
274 C ObjC Var(warn_missing_prototypes)
275 Warn about global functions without prototypes
279 Warn about use of multi-character character constants
282 C ObjC Var(warn_nested_externs)
283 Warn about \"extern\" declarations not at file scope
286 C++ ObjC++ Var(warn_nontemplate_friend) Init(1)
287 Warn when non-templatized friend functions are declared within a template
290 C++ ObjC++ Var(warn_nonvdtor)
291 Warn about non-virtual destructors
294 C ObjC Var(warn_nonnull)
295 Warn about NULL being passed to argument slots marked as requiring non-NULL
298 C ObjC C++ ObjC++ Joined
299 -Wnormalized=<id|nfc|nfkc> Warn about non-normalised Unicode strings
302 C++ ObjC++ Var(warn_old_style_cast)
303 Warn if a C-style cast is used in a program
305 Wold-style-definition
306 C ObjC Var(warn_old_style_definition)
307 Warn if an old-style parameter definition is used
310 C++ ObjC++ Var(warn_overloaded_virtual)
311 Warn about overloaded virtual function names
314 C ObjC C++ ObjC++ Var(warn_parentheses)
315 Warn about possibly missing parentheses
318 C++ ObjC++ Var(warn_pmf2ptr) Init(1)
319 Warn when converting the type of pointers to member functions
322 C ObjC C++ ObjC++ Var(warn_pointer_arith)
323 Warn about function pointer arithmetic
326 C ObjC Var(warn_pointer_to_int_cast) Init(1)
327 Warn when a pointer is cast to an integer of a different size
330 ObjC ObjC++ Var(warn_protocol) Init(1)
331 Warn if inherited methods are unimplemented
334 C ObjC C++ ObjC++ Var(warn_redundant_decls)
335 Warn about multiple declarations of the same object
338 C++ ObjC++ Var(warn_reorder)
339 Warn when the compiler reorders code
343 Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++)
346 ObjC ObjC++ Var(warn_selector)
347 Warn if a selector has multiple methods
350 C ObjC C++ ObjC++ Var(warn_sequence_point)
351 Warn about possible violations of sequence point rules
354 C ObjC C++ ObjC++ Var(warn_sign_compare) Init(-1)
355 Warn about signed-unsigned comparisons
358 C++ ObjC++ Var(warn_sign_promo)
359 Warn when overload promotes from unsigned to signed
361 Wstrict-null-sentinel
363 Warn about uncasted NULL used as sentinel
366 C ObjC Var(warn_strict_prototypes)
367 Warn about unprototyped function declarations
369 Wstrict-selector-match
370 ObjC ObjC++ Var(warn_strict_selector_match)
371 Warn if type signatures of candidate methods do not match exactly
374 C++ ObjC++ Var(warn_synth)
375 Warn when synthesis behavior differs from Cfront
379 Do not suppress warnings from system headers
382 C ObjC Var(warn_traditional)
383 Warn about features not present in traditional C
387 Warn if trigraphs are encountered that might affect the meaning of the program
390 ObjC ObjC++ Var(warn_undeclared_selector)
391 Warn about @selector()s without previously declared methods
395 Warn if an undefined macro is used in an #if directive
399 Warn about unrecognized pragmas
403 Warn about macros defined in the main file that are not used
407 Do not warn about using variadic macros when -pedantic
411 Give strings the type \"array of char\"
414 C ObjC Var(warn_pointer_sign) Init(1)
415 Warn when a pointer differs in signedness in an assignment.
419 A synonym for -std=c89 (for C) or -std=c++98 (for C++).
422 C ObjC C++ ObjC++ Joined
423 ; Documented in common.opt. FIXME - what about -dI, -dD, -dN and -dD?
427 Enforce class member access control semantics
432 falt-external-templates
434 Change when template instances are emitted
438 Recognize the \"asm\" keyword
442 Recognize built-in functions
445 C ObjC C++ ObjC++ Joined
449 Check the return value of new
453 Allow the arguments of the '?' operator to have different types
457 Reduce the size of object files
461 Make string literals \"const char[]\" not \"char[]\"
463 fconstant-string-class=
465 -fconst-string-class=<name> Use class <name> for constant strings
469 Inline member functions by default
471 fdollars-in-identifiers
473 Permit '$' as an identifier character
480 Generate code to check exception specifications
486 C ObjC C++ ObjC++ Joined RejectNegative
487 -fexec-charset=<cset> Convert all strings and character constants to character set <cset>
490 C ObjC C++ ObjC++ Joined RejectNegative
491 -finput-charset=<cset> Specify the default character set for source files.
505 Scope of for-init-statement variables is local to the loop
509 Do not assume that standard C libraries and \"main\" exist
513 Recognize GNU-defined keywords
517 Generate code for GNU runtime environment
530 Assume normal C execution environment
534 Enable support for huge objects
538 Export functions even if they can be inlined
540 fimplicit-inline-templates
542 Emit implicit instantiations of inline templates
546 Emit implicit instantiations of templates
553 Don't warn about uses of Microsoft extensions
555 fname-mangling-version-
563 Generate code for NeXT (Apple Mac OS X) runtime environment
567 Assume that receivers of Objective-C messages may be nil
575 ; Generate special '- .cxx_construct' and '- .cxx_destruct' methods
576 ; to initialize any non-POD ivars in Objective-C++ classes.
577 fobjc-call-cxx-cdtors
578 ObjC++ Var(flag_objc_call_cxx_cdtors)
579 Generate special Objective-C methods to initialize/destroy non-POD C++ ivars, if needed
581 fobjc-direct-dispatch
582 ObjC ObjC++ Var(flag_objc_direct_dispatch)
583 Allow fast jumps to the message dispatcher
585 ; Nonzero means that we will allow new ObjC exception syntax (@throw,
586 ; @try, etc.) in source code.
588 ObjC ObjC++ Var(flag_objc_exceptions)
589 Enable Objective-C exception and synchronization syntax
592 ObjC ObjC++ Var(flag_objc_gc)
593 Enable garbage collection (GC) in Objective-C/Objective-C++ programs
595 ; Nonzero means that we generate NeXT setjmp based exceptions.
596 fobjc-sjlj-exceptions
597 ObjC ObjC++ Var(flag_objc_sjlj_exceptions) Init(-1)
598 Enable Objective-C setjmp exception handling runtime
602 Recognize C++ kewords like \"compl\" and \"xor\"
606 Enable optional diagnostics
613 Look for and use PCH files even when preprocessing
617 Downgrade conformance errors to warnings
621 Treat the input file as already preprocessed
623 freplace-objc-classes
625 Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime
629 Enable automatic template instantiation
633 Generate run time type descriptor information
637 Use the same size for double as for float
641 Use the narrowest integer type possible for enumeration types
645 Force the underlying type for \"wchar_t\" to be \"unsigned short\"
649 When \"signed\" or \"unsigned\" is not given make the bitfield signed
653 Make \"char\" signed by default
660 Display statistics accumulated during compilation
666 C ObjC C++ ObjC++ Joined RejectNegative UInteger
667 -ftabstop=<number> Distance between tab stops for column reporting
670 C++ ObjC++ Joined RejectNegative UInteger
671 -ftemplate-depth-<number> Specify maximum template instantiation depth
678 -fno-threadsafe-statics Do not generate thread-safe code for initializing local statics.
682 When \"signed\" or \"unsigned\" is not given make the bitfield unsigned
686 Make \"char\" unsigned by default
690 Use __cxa_atexit to register destructors
692 fvisibility-inlines-hidden
694 Marks all inlined methods as having hidden visibility
698 Discard unused virtual functions
702 Implement vtables using thunks
706 Emit common-like symbols as weak symbols
709 C ObjC C++ ObjC++ Joined RejectNegative
710 -fwide-exec-charset=<cset> Convert all wide strings and character constants to character set <cset>
714 Generate a #line directive pointing at the current working directory
718 Emit cross referencing information
722 Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode
726 Dump declarations to a .decl file
729 C ObjC C++ ObjC++ Joined Separate
730 -idirafter <dir> Add <dir> to the end of the system include path
733 C ObjC C++ ObjC++ Joined Separate
734 -imacros <file> Accept definition of macros in <file>
737 C ObjC C++ ObjC++ Joined Separate
738 -include <file> Include the contents of <file> before other files
741 C ObjC C++ ObjC++ Joined Separate
742 -iprefix <path> Specify <path> as a prefix for next two options
745 C ObjC C++ ObjC++ Joined Separate
746 -isysroot <dir> Set <dir> to be the system root directory
749 C ObjC C++ ObjC++ Joined Separate
750 -isystem <dir> Add <dir> to the start of the system include path
753 C ObjC C++ ObjC++ Joined Separate
754 -iquote <dir> Add <dir> to the end of the quote include path
757 C ObjC C++ ObjC++ Joined Separate
758 -iwithprefix <dir> Add <dir> to the end of the system include path
761 C ObjC C++ ObjC++ Joined Separate
762 -iwithprefixbefore <dir> Add <dir> to the end of the main include path
768 C ObjC C++ ObjC++ Undocumented
772 Do not search standard system include directories (those specified with -isystem will still be used)
776 Do not search standard system include directories for C++
779 C ObjC C++ ObjC++ Joined Separate
780 ; Documented in common.opt
784 ; Documented in common.opt
788 ; Documented in common.opt
790 print-objc-runtime-info
792 Generate C header of platform-specific features
796 Remap file names when including files
800 Conform to the ISO 1998 C++ standard
804 Conform to the ISO 1990 C standard
808 Conform to the ISO 1999 C standard
812 Deprecated in favor of -std=c99
816 Conform to the ISO 1998 C++ standard with GNU extensions
820 Conform to the ISO 1990 C standard with GNU extensions
824 Conform to the ISO 1999 C standard with GNU extensions
828 Deprecated in favor of -std=gnu99
832 Conform to the ISO 1990 C standard
836 Conform to the ISO 1990 C standard as amended in 1994
840 Conform to the ISO 1999 C standard
844 Deprecated in favor of -std=iso9899:1999
848 Enable traditional preprocessing
852 -trigraphs Support ISO C trigraphs
856 Do not predefine system-specific and GCC-specific macros
860 Enable verbose output
864 ; Documented in common.opt
866 ; This comment is to ensure we retain the blank line above.