OSDN Git Service

* c.opt: Document more options.
[pf3gnuchains/gcc-fork.git] / gcc / c.opt
1 ; Options for the C, ObjC, C++ and ObjC++ front ends.
2 ; Copyright (C) 2003 Free Software Foundation, Inc.
3 ;
4 ; This file is part of GCC.
5 ;
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
9 ; version.
10
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
14 ; for more details.
15
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
19 ; 02111-1307, USA.
20
21
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.
30
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.
40
41 ; The third field is the help text to output with --help.  This is
42 ; automatically line-wrapped on output.  Normally the switch is output
43 ; automatically, with the help text on the right hand side of the
44 ; output.  However, if the help text contains a tab character, the
45 ; text to the left of the tab is output instead of the switch, and the
46 ; text to its right forms the help.  This is useful for elaborating on
47 ; what type of argument a switch takes, for example.
48
49 ; Comments can appear on their own line anwhere in the file, preceded
50 ; by a semicolon.  Whitespace is permitted before the semicolon.
51
52 ; For each switch XXX below, an enumeration constant is created by the
53 ; script opts.sh spelt OPT_XXX, but with all non-alphanumeric
54 ; characters replaced with an underscore.
55
56 ; Please try to keep this file in ASCII collating order.
57
58 Language
59 C
60
61 Language
62 ObjC
63
64 Language
65 C++
66
67 Language
68 ObjC++
69
70 -output-pch=
71 C ObjC C++ ObjC++ Joined Separate
72
73 A
74 C ObjC C++ ObjC++ Joined Separate
75 -A<question>=<answer>   Assert the <answer> to <question>.  Putting '-' before <question> disables the <answer> to <question>
76
77 C
78 C ObjC C++ ObjC++
79 Do not discard comments
80
81 CC
82 C ObjC C++ ObjC++
83 Do not discard comments in macro expansions
84
85 D
86 C ObjC C++ ObjC++ Joined Separate
87 -D<macro>[=<val>]       Define a <macro> with <val> as its value.  If just <macro> is given, <val> is taken to be 1
88
89 E
90 C ObjC C++ ObjC++
91
92 H
93 C ObjC C++ ObjC++
94 Print the name of header files as they are used
95
96 I
97 C ObjC C++ ObjC++ Joined Separate
98 -I <dir>        Add <dir> to the end of the main include path.  -I- gives more include path control; see info documentation
99
100 M
101 C ObjC C++ ObjC++
102 Generate make dependencies
103
104 MD
105 C ObjC C++ ObjC++ Separate
106 Generate make dependencies and compile
107
108 MF
109 C ObjC C++ ObjC++ Joined Separate
110 -MF <file>      Write dependency output to the given file
111
112 MG
113 C ObjC C++ ObjC++
114 Treat missing header files as generated files
115
116 MM
117 C ObjC C++ ObjC++
118 Like -M but ignore system header files
119
120 MMD
121 C ObjC C++ ObjC++ Separate
122 Like -MD but ignore system header files
123
124 MP
125 C ObjC C++ ObjC++
126 Generate phony targets for all headers
127
128 MQ
129 C ObjC C++ ObjC++ Joined Separate
130 -MQ <target>    Add a MAKE-quoted target
131
132 MT
133 C ObjC C++ ObjC++ Joined Separate
134 -MT <target>    Add an unquoted target
135
136 P
137 C ObjC C++ ObjC++
138 Do not generate #line directives
139
140 U
141 C ObjC C++ ObjC++ Joined Separate
142 -U<macro>       Undefine <macro>
143
144 Wabi
145 C++ ObjC++
146
147 Wall
148 C ObjC C++ ObjC++
149 Enable most warning messages
150
151 Wbad-function-cast
152 C ObjC
153 Warn about casting functions to incompatible types
154
155 Wcast-qual
156 C ObjC C++ ObjC++
157 Warn about casts which discard qualifiers
158
159 Wchar-subscripts
160 C ObjC C++ ObjC++
161 Warn about subscripts whose type is \"char\"
162
163 Wcomment
164 C ObjC C++ ObjC++
165 Warn about possibly nested block comments, and C++ comments spanning more than one physical line
166
167 Wcomments
168 C ObjC C++ ObjC++
169 Synonym for -Wcomment
170
171 Wconversion
172 C ObjC C++ ObjC++
173 Warn about possibly confusing type conversions
174
175 Wctor-dtor-privacy
176 C++ ObjC++
177 Warn when all constructors and destructors are private
178
179 Wdeprecated
180 C++ ObjC++
181 Warn about deprecated compiler features
182
183 Wdiv-by-zero
184 C ObjC
185 Warn about compile-time integer division by zero
186
187 Weffc++
188 C++ ObjC++
189 Warn about violations of Effective C++ style rules
190
191 Wendif-labels
192 C ObjC C++ ObjC++
193 Warn about stray tokens after #elif and #endif
194
195 Werror
196 C ObjC C++ ObjC++
197 ; Documented in common.opt
198
199 Werror-implicit-function-declaration
200 C ObjC RejectNegative
201 Make implicit function declarations an error
202
203 Wfloat-equal
204 C ObjC C++ ObjC++
205 Warn if testing floating point numbers for equality
206
207 Wformat
208 C ObjC C++ ObjC++
209 Warn about printf/scanf/strftime/strfmon format string anomalies
210
211 Wformat-extra-args
212 C ObjC C++ ObjC++
213 Warn if passing too many arguments to a function for its format string
214
215 Wformat-nonliteral
216 C ObjC C++ ObjC++
217 Warn about format strings that are not literals
218
219 Wformat-security
220 C ObjC C++ ObjC++
221 Warn about possible security problems with format functions
222
223 Wformat-y2k
224 C ObjC C++ ObjC++
225 Warn about strftime formats yielding 2-digit years
226
227 Wformat-zero-length
228 C ObjC
229
230 Wformat=
231 C ObjC C++ ObjC++ Joined
232
233 Wimplicit
234 C ObjC C++ ObjC++
235
236 Wimplicit-function-declaration
237 C ObjC
238 Warn about implicit function declarations
239
240 Wimplicit-int
241 C ObjC
242 Warn when a declaration does not specify a type
243
244 Wimport
245 C ObjC C++ ObjC++
246 Warn about uses of the \"#import\" directive
247
248 Winvalid-offsetof
249 C++ ObjC++
250 Warn about invalid uses of the \"offsetof\" macro
251
252 Winvalid-pch
253 C ObjC C++ ObjC++
254 Warn about PCH files that are found but not used
255
256 Wlong-long
257 C ObjC C++ ObjC++
258 Do not warn about using \"long long\" when -pedantic
259
260 Wmain
261 C ObjC
262 Warn about suspicious declarations of \"main\"
263
264 Wmissing-braces
265 C ObjC C++ ObjC++
266 Warn about possibly missing braces around initializers
267
268 Wmissing-declarations
269 C ObjC
270 Warn about global functions without previous declarations
271
272 Wmissing-format-attribute
273 C ObjC C++ ObjC++
274 Warn about functions which might be candidates for format attributes
275
276 Wmissing-prototypes
277 C ObjC
278 Warn about global functions without prototypes
279
280 Wmultichar
281 C ObjC C++ ObjC++
282 Warn about use of multi-character character constants
283
284 Wnested-externs
285 C ObjC
286 Warn about \"extern\" declarations not at file scope
287
288 Wnon-template-friend
289 C++ ObjC++
290 Warn when non-templatized friend functions are declared within a template
291
292 Wnon-virtual-dtor
293 C++ ObjC++
294 Warn about non-virtual destructors
295
296 Wnonnull
297 C ObjC
298
299 Wold-style-cast
300 C++ ObjC++
301 Warn if a C-style cast is used in a program
302
303 Woverloaded-virtual
304 C++ ObjC++
305 Warn about overloaded virtual function names
306
307 Wparentheses
308 C ObjC C++ ObjC++
309 Warn about possibly missing parentheses
310
311 Wpmf-conversions
312 C++ ObjC++
313 Warn when converting the type of pointers to member functions
314
315 Wpointer-arith
316 C ObjC C++ ObjC++
317 Warn about function pointer arithmetic
318
319 Wprotocol
320 ObjC ObjC++
321
322 Wredundant-decls
323 C ObjC C++ ObjC++
324 Warn about multiple declarations of the same object
325
326 Wreorder
327 C++ ObjC++
328 Warn when the compiler reorders code
329
330 Wreturn-type
331 C ObjC C++ ObjC++
332 Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++)
333
334 Wselector
335 ObjC ObjC++
336
337 Wsequence-point
338 C ObjC
339 Warn about possible violations of sequence point rules
340
341 Wsign-compare
342 C ObjC C++ ObjC++
343 Warn about signed-unsigned comparisons
344
345 Wsign-promo
346 C++ ObjC++
347 Warn when overload promotes from unsigned to signed
348
349 Wstrict-prototypes
350 C ObjC
351 Warn about unprototyped function declarations
352
353 Wsynth
354 C++ ObjC++
355 Warn when synthesis behavior differs from Cfront
356
357 Wsystem-headers
358 C ObjC C++ ObjC++
359 Do not suppress warnings from system headers
360
361 Wtraditional
362 C ObjC
363 Warn about features not present in traditional C
364
365 Wtrigraphs
366 C ObjC C++ ObjC++
367 Warn if trigraphs are encountered that might affect the meaning of the program
368
369 Wundeclared-selector
370 ObjC ObjC++
371
372 Wundef
373 C ObjC C++ ObjC++
374 Warn if an undefined macro is used in an #if directive
375
376 Wunknown-pragmas
377 C ObjC C++ ObjC++
378 Warn about unrecognized pragmas
379
380 Wunused-macros
381 C ObjC C++ ObjC++
382 Warn about macros defined in the main file that are not used
383
384 Wwrite-strings
385 C ObjC C++ ObjC++
386 Give strings the type \"array of char\"
387
388 ansi
389 C ObjC C++ ObjC++
390 A synonym for -std=c89.  In a future version of GCC it will become synonymous with -std=c99 instead
391
392 d
393 C ObjC C++ ObjC++ Joined
394 ; Documented in common.opt.  FIXME - what about -dI, -dD, -dN and -dD?
395
396 fabi-version=
397 C++ ObjC++ Joined UInteger
398
399 faccess-control
400 C++ ObjC++
401 Enforce class member access control semantics
402
403 fall-virtual
404 C++ ObjC++
405
406 falt-external-templates
407 C++ ObjC++
408 Change when template instances are emitted
409
410 fasm
411 C ObjC C++ ObjC++
412 Recognize the \"asm\" keyword
413
414 fbuiltin
415 C ObjC C++ ObjC++
416 Recognize built-in functions
417
418 fbuiltin-
419 C ObjC C++ ObjC++ Joined
420
421 fcheck-new
422 C++ ObjC++
423 Check the return value of new
424
425 fcond-mismatch
426 C ObjC C++ ObjC++
427 Allow the arguments of the '?' operator to have different types
428
429 fconserve-space
430 C++ ObjC++
431 Reduce the size of object files
432
433 fconst-strings
434 C++ ObjC++
435 Make string literals \"const char[]\" not \"char[]\"
436
437 fconstant-string-class=
438 ObjC ObjC++ Joined
439
440 fdefault-inline
441 C++ ObjC++
442 Inline member functions by default
443
444 fdollars-in-identifiers
445 C ObjC C++ ObjC++
446 Permit '$' as an identifier character
447
448 fdump-
449 C ObjC C++ ObjC++ Joined RejectNegative
450 -fdump-<type>   Dump various compiler internals to a file
451
452 felide-constructors
453 C++ ObjC++
454
455 fenforce-eh-specs
456 C++ ObjC++
457 Generate code to check exception specifications
458
459 fenum-int-equiv
460 C++ ObjC++
461
462 fexec-charset=
463 C ObjC C++ ObjC++ Joined RejectNegative
464 -fexec-charset=<cset>   Convert all strings and character constants to character set <cset>
465
466 fexternal-templates
467 C++ ObjC++
468
469 ffixed-form
470 C ObjC
471
472 ffixed-line-length-
473 C ObjC Joined
474
475 ffor-scope
476 C++ ObjC++
477 Scope of for-init-statement variables is local to the loop
478
479 ffreestanding
480 C ObjC
481 Do not assume that standard C libraries and \"main\" exist
482
483 fgnu-keywords
484 C++ ObjC++
485 Recognize GNU-defined keywords
486
487 fgnu-runtime
488 ObjC ObjC++
489
490 fguiding-decls
491 C++ ObjC++
492
493 fhandle-exceptions
494 C++ ObjC++
495
496 fhonor-std
497 C++ ObjC++
498
499 fhosted
500 C ObjC
501 Assume normal C execution environment
502
503 fhuge-objects
504 C++ ObjC++
505 Enable support for huge objects
506
507 fimplement-inlines
508 C++ ObjC++
509 Export functions even if they can be inlined
510
511 fimplicit-inline-templates
512 C++ ObjC++
513 Emit implicit instantiations of inline templates
514
515 fimplicit-templates
516 C++ ObjC++
517 Emit implicit instantiations of templates
518
519 flabels-ok
520 C++ ObjC++
521
522 fms-extensions
523 C ObjC C++ ObjC++
524 Don't warn about uses of Microsoft extensions
525
526 fname-mangling-version-
527 C++ ObjC++ Joined
528
529 fnew-abi
530 C++ ObjC++
531
532 fnext-runtime
533 ObjC ObjC++
534
535 fnonansi-builtins
536 C++ ObjC++
537
538 fnonnull-objects
539 C++ ObjC++
540
541 foperator-names
542 C++ ObjC++
543 Recognize C++ kewords like \"compl\" and \"xor\"
544
545 foptional-diags
546 C++ ObjC++
547 Enable optional diagnostics
548
549 fpch-deps
550 C ObjC C++ ObjC++
551
552 fpermissive
553 C++ ObjC++
554 Downgrade conformance errors to warnings
555
556 fpreprocessed
557 C ObjC C++ ObjC++
558 Treat the input file as already preprocessed
559
560 frepo
561 C++ ObjC++
562 Enable automatic template instantiation
563
564 frtti
565 C++ ObjC++
566 Generate run time type descriptor information
567
568 fshort-double
569 C ObjC C++ ObjC++
570 Use the same size for double as for float
571
572 fshort-enums
573 C ObjC C++ ObjC++
574 Use the narrowest integer type possible for enumeration types
575
576 fshort-wchar
577 C ObjC C++ ObjC++
578 Force the underlying type for \"wchar_t\" to be \"unsigned short\"
579
580 fshow-column
581 C ObjC C++ ObjC++
582
583 fsigned-bitfields
584 C ObjC C++ ObjC++
585 When \"signed\" or \"unsigned\" is not given make the bitfield signed
586
587 fsigned-char
588 C ObjC C++ ObjC++
589 Make \"char\" signed by default
590
591 fsquangle
592 C++ ObjC++
593
594 fstats
595 C++ ObjC++
596 Display statistics accumulated during compilation
597
598 fstrict-prototype
599 C++ ObjC++
600
601 ftabstop=
602 C ObjC C++ ObjC++ Joined RejectNegative UInteger
603 -ftabstop=<number>      Distance between tab stops for column reporting
604
605 ftemplate-depth-
606 C++ ObjC++ Joined RejectNegative UInteger 
607 -ftemplate-depth-<number>       Specify maximum template instantiation depth
608
609 fthis-is-variable
610 C++ ObjC++
611
612 funsigned-bitfields
613 C ObjC C++ ObjC++
614 When \"signed\" or \"unsigned\" is not given make the bitfield unsigned
615
616 funsigned-char
617 C ObjC C++ ObjC++
618 Make \"char\" unsigned by default
619
620 fuse-cxa-atexit
621 C++ ObjC++
622 Use __cxa_atexit to register destructors
623
624 fvtable-gc
625 C++ ObjC++
626 Discard unused virtual functions
627
628 fvtable-thunks
629 C++ ObjC++
630 Implement vtables using thunks
631
632 fweak
633 C++ ObjC++
634 Emit common-like symbols as weak symbols
635
636 fwide-exec-charset=
637 C ObjC C++ ObjC++ Joined RejectNegative
638 -fwide-exec-charset=<cset>      Convert all wide strings and character constants to character set <cset>
639
640 fxref
641 C++ ObjC++
642 Emit cross referencing information
643
644 gen-decls
645 ObjC ObjC++
646
647 idirafter
648 C ObjC C++ ObjC++ Joined Separate
649 -idirafter <dir>        Add <dir> to the end of the system include path
650
651 imacros
652 C ObjC C++ ObjC++ Joined Separate
653 -imacros <file> Accept definition of macros in <file>
654
655 include
656 C ObjC C++ ObjC++ Joined Separate
657 -include <file> Include the contents of <file> before other files
658
659 iprefix
660 C ObjC C++ ObjC++ Joined Separate
661 -iprefix <path> Specify <path> as a prefix for next two options
662
663 isysroot
664 C ObjC C++ ObjC++ Joined Separate
665 -isysroot <dir> Set <dir> to be the system root directory
666
667 isystem
668 C ObjC C++ ObjC++ Joined Separate
669 -isystem <dir>  Add <dir> to the start of the system include path
670
671 iwithprefix
672 C ObjC C++ ObjC++ Joined Separate
673 -iwithprefix <dir>      Add <dir> to the end of the system include path
674
675 iwithprefixbefore
676 C ObjC C++ ObjC++ Joined Separate
677 -iwithprefixbefore <dir>        Add <dir> to the end of the main include path
678
679 lang-asm
680 C
681 For internal use only
682
683 lang-objc
684 C ObjC C++ ObjC++
685 For internal use only
686
687 nostdinc
688 C ObjC C++ ObjC++
689 Do not search standard system include directories (those specified with -isystem will still be used)
690
691 nostdinc++
692 C++ ObjC++
693 Do not search standard system include directories for C++
694
695 o
696 C ObjC C++ ObjC++ Joined Separate
697 ; Documented in common.opt
698
699 pedantic
700 C ObjC C++ ObjC++
701 ; Documented in common.opt
702
703 pedantic-errors
704 C ObjC C++ ObjC++
705 ; Documented in common.opt
706
707 print-objc-runtime-info
708 ObjC ObjC++
709
710 remap
711 C ObjC C++ ObjC++
712 Remap file names when including files
713
714 std=c++98
715 C++ ObjC++
716 Conform to the ISO 1998 C++ standard
717
718 std=c89
719 C ObjC
720 Conform to the ISO 1990 C standard
721
722 std=c99
723 C ObjC
724 Conform to the ISO 1999 C standard
725
726 std=c9x
727 C ObjC
728 Deprecated in favor of -std=c99
729
730 std=gnu++98
731 C++ ObjC++
732 Conform to the ISO 1998 C++ standard with GNU extensions
733
734 std=gnu89
735 C ObjC
736 Conform to the ISO 1990 C standard with GNU extensions
737
738 std=gnu99
739 C ObjC
740 Conform to the ISO 1999 C standard with GNU extensions
741
742 std=gnu9x
743 C ObjC
744 Deprecated in favor of -std=gnu99
745
746 std=iso9899:1990
747 C ObjC
748 Deprecated in favor of -std=c89
749
750 std=iso9899:199409
751 C ObjC
752 Conform to the ISO 1990 C standard as amended in 1994
753
754 std=iso9899:1999
755 C ObjC
756 Deprecated in favor of -std=c99
757
758 std=iso9899:199x
759 C ObjC
760 Deprecated in favor of -std=c99
761
762 traditional-cpp
763 C ObjC C++ ObjC++
764 Enable traditional preprocessing
765
766 trigraphs
767 C ObjC C++ ObjC++
768 -trigraphs      Support ISO C trigraphs
769
770 undef
771 C ObjC C++ ObjC++
772 Do not predefine system-specific and GCC-specific macros
773
774 v
775 C ObjC C++ ObjC++
776 Enable verbose output
777
778 w
779 C ObjC C++ ObjC++
780 ; Documented in common.opt
781
782 ; This comment is to ensure we retain the blank line above.