| .\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) |
| .\" |
| .\" Standard preamble: |
| .\" ======================================================================== |
| .de Sp \" Vertical space (when we can't use .PP) |
| .if t .sp .5v |
| .if n .sp |
| .. |
| .de Vb \" Begin verbatim text |
| .ft CW |
| .nf |
| .ne \\$1 |
| .. |
| .de Ve \" End verbatim text |
| .ft R |
| .fi |
| .. |
| .\" Set up some character translations and predefined strings. \*(-- will |
| .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left |
| .\" double quote, and \*(R" will give a right double quote. \*(C+ will |
| .\" give a nicer C++. Capital omega is used to do unbreakable dashes and |
| .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, |
| .\" nothing in troff, for use with C<>. |
| .tr \(*W- |
| .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' |
| .ie n \{\ |
| . ds -- \(*W- |
| . ds PI pi |
| . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch |
| . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch |
| . ds L" "" |
| . ds R" "" |
| . ds C` "" |
| . ds C' "" |
| 'br\} |
| .el\{\ |
| . ds -- \|\(em\| |
| . ds PI \(*p |
| . ds L" `` |
| . ds R" '' |
| . ds C` |
| . ds C' |
| 'br\} |
| .\" |
| .\" Escape single quotes in literal strings from groff's Unicode transform. |
| .ie \n(.g .ds Aq \(aq |
| .el .ds Aq ' |
| .\" |
| .\" If the F register is turned on, we'll generate index entries on stderr for |
| .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| .\" entries marked with X<> in POD. Of course, you'll have to process the |
| .\" output yourself in some meaningful fashion. |
| .\" |
| .\" Avoid warning from groff about undefined register 'F'. |
| .de IX |
| .. |
| .nr rF 0 |
| .if \n(.g .if rF .nr rF 1 |
| .if (\n(rF:(\n(.g==0)) \{ |
| . if \nF \{ |
| . de IX |
| . tm Index:\\$1\t\\n%\t"\\$2" |
| .. |
| . if !\nF==2 \{ |
| . nr % 0 |
| . nr F 2 |
| . \} |
| . \} |
| .\} |
| .rr rF |
| .\" |
| .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). |
| .\" Fear. Run. Save yourself. No user-serviceable parts. |
| . \" fudge factors for nroff and troff |
| .if n \{\ |
| . ds #H 0 |
| . ds #V .8m |
| . ds #F .3m |
| . ds #[ \f1 |
| . ds #] \fP |
| .\} |
| .if t \{\ |
| . ds #H ((1u-(\\\\n(.fu%2u))*.13m) |
| . ds #V .6m |
| . ds #F 0 |
| . ds #[ \& |
| . ds #] \& |
| .\} |
| . \" simple accents for nroff and troff |
| .if n \{\ |
| . ds ' \& |
| . ds ` \& |
| . ds ^ \& |
| . ds , \& |
| . ds ~ ~ |
| . ds / |
| .\} |
| .if t \{\ |
| . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" |
| . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' |
| . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' |
| . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' |
| . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' |
| . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' |
| .\} |
| . \" troff and (daisy-wheel) nroff accents |
| .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' |
| .ds 8 \h'\*(#H'\(*b\h'-\*(#H' |
| .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] |
| .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' |
| .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' |
| .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] |
| .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] |
| .ds ae a\h'-(\w'a'u*4/10)'e |
| .ds Ae A\h'-(\w'A'u*4/10)'E |
| . \" corrections for vroff |
| .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' |
| .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' |
| . \" for low resolution devices (crt and lpr) |
| .if \n(.H>23 .if \n(.V>19 \ |
| \{\ |
| . ds : e |
| . ds 8 ss |
| . ds o a |
| . ds d- d\h'-1'\(ga |
| . ds D- D\h'-1'\(hy |
| . ds th \o'bp' |
| . ds Th \o'LP' |
| . ds ae ae |
| . ds Ae AE |
| .\} |
| .rm #[ #] #H #V #F C |
| .\" ======================================================================== |
| .\" |
| .IX Title "GCC 1" |
| .TH GCC 1 "2014-07-16" "gcc-4.9.1" "GNU" |
| .\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| .\" way too many mistakes in technical documents. |
| .if n .ad l |
| .nh |
| .SH "NAME" |
| gcc \- GNU project C and C++ compiler |
| .SH "SYNOPSIS" |
| .IX Header "SYNOPSIS" |
| gcc [\fB\-c\fR|\fB\-S\fR|\fB\-E\fR] [\fB\-std=\fR\fIstandard\fR] |
| [\fB\-g\fR] [\fB\-pg\fR] [\fB\-O\fR\fIlevel\fR] |
| [\fB\-W\fR\fIwarn\fR...] [\fB\-Wpedantic\fR] |
| [\fB\-I\fR\fIdir\fR...] [\fB\-L\fR\fIdir\fR...] |
| [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR] |
| [\fB\-f\fR\fIoption\fR...] [\fB\-m\fR\fImachine-option\fR...] |
| [\fB\-o\fR \fIoutfile\fR] [@\fIfile\fR] \fIinfile\fR... |
| .PP |
| Only the most useful options are listed here; see below for the |
| remainder. \fBg++\fR accepts mostly the same options as \fBgcc\fR. |
| .SH "DESCRIPTION" |
| .IX Header "DESCRIPTION" |
| When you invoke \s-1GCC,\s0 it normally does preprocessing, compilation, |
| assembly and linking. The \*(L"overall options\*(R" allow you to stop this |
| process at an intermediate stage. For example, the \fB\-c\fR option |
| says not to run the linker. Then the output consists of object files |
| output by the assembler. |
| .PP |
| Other options are passed on to one stage of processing. Some options |
| control the preprocessor and others the compiler itself. Yet other |
| options control the assembler and linker; most of these are not |
| documented here, since you rarely need to use any of them. |
| .PP |
| Most of the command-line options that you can use with \s-1GCC\s0 are useful |
| for C programs; when an option is only useful with another language |
| (usually \*(C+), the explanation says so explicitly. If the description |
| for a particular option does not mention a source language, you can use |
| that option with all supported languages. |
| .PP |
| The \fBgcc\fR program accepts options and file names as operands. Many |
| options have multi-letter names; therefore multiple single-letter options |
| may \fInot\fR be grouped: \fB\-dv\fR is very different from \fB\-d\ \-v\fR. |
| .PP |
| You can mix options and other arguments. For the most part, the order |
| you use doesn't matter. Order does matter when you use several |
| options of the same kind; for example, if you specify \fB\-L\fR more |
| than once, the directories are searched in the order specified. Also, |
| the placement of the \fB\-l\fR option is significant. |
| .PP |
| Many options have long names starting with \fB\-f\fR or with |
| \&\fB\-W\fR\-\-\-for example, |
| \&\fB\-fmove\-loop\-invariants\fR, \fB\-Wformat\fR and so on. Most of |
| these have both positive and negative forms; the negative form of |
| \&\fB\-ffoo\fR is \fB\-fno\-foo\fR. This manual documents |
| only one of these two forms, whichever one is not the default. |
| .SH "OPTIONS" |
| .IX Header "OPTIONS" |
| .SS "Option Summary" |
| .IX Subsection "Option Summary" |
| Here is a summary of all the options, grouped by type. Explanations are |
| in the following sections. |
| .IP "\fIOverall Options\fR" 4 |
| .IX Item "Overall Options" |
| \&\fB\-c \-S \-E \-o\fR \fIfile\fR \fB\-no\-canonical\-prefixes |
| \&\-pipe \-pass\-exit\-codes |
| \&\-x\fR \fIlanguage\fR \fB\-v \-### \-\-help\fR[\fB=\fR\fIclass\fR[\fB,...\fR]] \fB\-\-target\-help |
| \&\-\-version \-wrapper @\fR\fIfile\fR \fB\-fplugin=\fR\fIfile\fR \fB\-fplugin\-arg\-\fR\fIname\fR\fB=\fR\fIarg\fR |
| \&\fB\-fdump\-ada\-spec\fR[\fB\-slim\fR] \fB\-fada\-spec\-parent=\fR\fIunit\fR \fB\-fdump\-go\-spec=\fR\fIfile\fR |
| .IP "\fIC Language Options\fR" 4 |
| .IX Item "C Language Options" |
| \&\fB\-ansi \-std=\fR\fIstandard\fR \fB\-fgnu89\-inline |
| \&\-aux\-info\fR \fIfilename\fR \fB\-fallow\-parameterless\-variadic\-functions |
| \&\-fno\-asm \-fno\-builtin \-fno\-builtin\-\fR\fIfunction\fR |
| \&\fB\-fhosted \-ffreestanding \-fopenmp \-fopenmp\-simd \-fms\-extensions |
| \&\-fplan9\-extensions \-trigraphs \-traditional \-traditional\-cpp |
| \&\-fallow\-single\-precision \-fcond\-mismatch \-flax\-vector\-conversions |
| \&\-fsigned\-bitfields \-fsigned\-char |
| \&\-funsigned\-bitfields \-funsigned\-char\fR |
| .IP "\fI\*(C+ Language Options\fR" 4 |
| .IX Item " Language Options" |
| \&\fB\-fabi\-version=\fR\fIn\fR \fB\-fno\-access\-control \-fcheck\-new |
| \&\-fconstexpr\-depth=\fR\fIn\fR \fB\-ffriend\-injection |
| \&\-fno\-elide\-constructors |
| \&\-fno\-enforce\-eh\-specs |
| \&\-ffor\-scope \-fno\-for\-scope \-fno\-gnu\-keywords |
| \&\-fno\-implicit\-templates |
| \&\-fno\-implicit\-inline\-templates |
| \&\-fno\-implement\-inlines \-fms\-extensions |
| \&\-fno\-nonansi\-builtins \-fnothrow\-opt \-fno\-operator\-names |
| \&\-fno\-optional\-diags \-fpermissive |
| \&\-fno\-pretty\-templates |
| \&\-frepo \-fno\-rtti \-fstats \-ftemplate\-backtrace\-limit=\fR\fIn\fR |
| \&\fB\-ftemplate\-depth=\fR\fIn\fR |
| \&\fB\-fno\-threadsafe\-statics \-fuse\-cxa\-atexit \-fno\-weak \-nostdinc++ |
| \&\-fvisibility\-inlines\-hidden |
| \&\-fvtable\-verify=\fR\fIstd|preinit|none\fR |
| \&\fB\-fvtv\-counts \-fvtv\-debug |
| \&\-fvisibility\-ms\-compat |
| \&\-fext\-numeric\-literals |
| \&\-Wabi \-Wconversion\-null \-Wctor\-dtor\-privacy |
| \&\-Wdelete\-non\-virtual\-dtor \-Wliteral\-suffix \-Wnarrowing |
| \&\-Wnoexcept \-Wnon\-virtual\-dtor \-Wreorder |
| \&\-Weffc++ \-Wstrict\-null\-sentinel |
| \&\-Wno\-non\-template\-friend \-Wold\-style\-cast |
| \&\-Woverloaded\-virtual \-Wno\-pmf\-conversions |
| \&\-Wsign\-promo\fR |
| .IP "\fIObjective-C and Objective\-\*(C+ Language Options\fR" 4 |
| .IX Item "Objective-C and Objective- Language Options" |
| \&\fB\-fconstant\-string\-class=\fR\fIclass-name\fR |
| \&\fB\-fgnu\-runtime \-fnext\-runtime |
| \&\-fno\-nil\-receivers |
| \&\-fobjc\-abi\-version=\fR\fIn\fR |
| \&\fB\-fobjc\-call\-cxx\-cdtors |
| \&\-fobjc\-direct\-dispatch |
| \&\-fobjc\-exceptions |
| \&\-fobjc\-gc |
| \&\-fobjc\-nilcheck |
| \&\-fobjc\-std=objc1 |
| \&\-freplace\-objc\-classes |
| \&\-fzero\-link |
| \&\-gen\-decls |
| \&\-Wassign\-intercept |
| \&\-Wno\-protocol \-Wselector |
| \&\-Wstrict\-selector\-match |
| \&\-Wundeclared\-selector\fR |
| .IP "\fILanguage Independent Options\fR" 4 |
| .IX Item "Language Independent Options" |
| \&\fB\-fmessage\-length=\fR\fIn\fR |
| \&\fB\-fdiagnostics\-show\-location=\fR[\fBonce\fR|\fBevery-line\fR] |
| \&\fB\-fdiagnostics\-color=\fR[\fBauto\fR|\fBnever\fR|\fBalways\fR] |
| \&\fB\-fno\-diagnostics\-show\-option \-fno\-diagnostics\-show\-caret\fR |
| .IP "\fIWarning Options\fR" 4 |
| .IX Item "Warning Options" |
| \&\fB\-fsyntax\-only \-fmax\-errors=\fR\fIn\fR \fB\-Wpedantic |
| \&\-pedantic\-errors |
| \&\-w \-Wextra \-Wall \-Waddress \-Waggregate\-return |
| \&\-Waggressive\-loop\-optimizations \-Warray\-bounds |
| \&\-Wno\-attributes \-Wno\-builtin\-macro\-redefined |
| \&\-Wc++\-compat \-Wc++11\-compat \-Wcast\-align \-Wcast\-qual |
| \&\-Wchar\-subscripts \-Wclobbered \-Wcomment \-Wconditionally\-supported |
| \&\-Wconversion \-Wcoverage\-mismatch \-Wdate\-time \-Wdelete\-incomplete \-Wno\-cpp |
| \&\-Wno\-deprecated \-Wno\-deprecated\-declarations \-Wdisabled\-optimization |
| \&\-Wno\-div\-by\-zero \-Wdouble\-promotion \-Wempty\-body \-Wenum\-compare |
| \&\-Wno\-endif\-labels \-Werror \-Werror=* |
| \&\-Wfatal\-errors \-Wfloat\-equal \-Wformat \-Wformat=2 |
| \&\-Wno\-format\-contains\-nul \-Wno\-format\-extra\-args \-Wformat\-nonliteral |
| \&\-Wformat\-security \-Wformat\-y2k |
| \&\-Wframe\-larger\-than=\fR\fIlen\fR \fB\-Wno\-free\-nonheap\-object \-Wjump\-misses\-init |
| \&\-Wignored\-qualifiers |
| \&\-Wimplicit \-Wimplicit\-function\-declaration \-Wimplicit\-int |
| \&\-Winit\-self \-Winline \-Wmaybe\-uninitialized |
| \&\-Wno\-int\-to\-pointer\-cast \-Wno\-invalid\-offsetof |
| \&\-Winvalid\-pch \-Wlarger\-than=\fR\fIlen\fR \fB\-Wunsafe\-loop\-optimizations |
| \&\-Wlogical\-op \-Wlong\-long |
| \&\-Wmain \-Wmaybe\-uninitialized \-Wmissing\-braces \-Wmissing\-field\-initializers |
| \&\-Wmissing\-include\-dirs |
| \&\-Wno\-multichar \-Wnonnull \-Wno\-overflow \-Wopenmp\-simd |
| \&\-Woverlength\-strings \-Wpacked \-Wpacked\-bitfield\-compat \-Wpadded |
| \&\-Wparentheses \-Wpedantic\-ms\-format \-Wno\-pedantic\-ms\-format |
| \&\-Wpointer\-arith \-Wno\-pointer\-to\-int\-cast |
| \&\-Wredundant\-decls \-Wno\-return\-local\-addr |
| \&\-Wreturn\-type \-Wsequence\-point \-Wshadow |
| \&\-Wsign\-compare \-Wsign\-conversion \-Wfloat\-conversion |
| \&\-Wsizeof\-pointer\-memaccess |
| \&\-Wstack\-protector \-Wstack\-usage=\fR\fIlen\fR \fB\-Wstrict\-aliasing |
| \&\-Wstrict\-aliasing=n \-Wstrict\-overflow \-Wstrict\-overflow=\fR\fIn\fR |
| \&\fB\-Wsuggest\-attribute=\fR[\fBpure\fR|\fBconst\fR|\fBnoreturn\fR|\fBformat\fR] |
| \&\fB\-Wmissing\-format\-attribute |
| \&\-Wswitch \-Wswitch\-default \-Wswitch\-enum \-Wsync\-nand |
| \&\-Wsystem\-headers \-Wtrampolines \-Wtrigraphs \-Wtype\-limits \-Wundef |
| \&\-Wuninitialized \-Wunknown\-pragmas \-Wno\-pragmas |
| \&\-Wunsuffixed\-float\-constants \-Wunused \-Wunused\-function |
| \&\-Wunused\-label \-Wunused\-local\-typedefs \-Wunused\-parameter |
| \&\-Wno\-unused\-result \-Wunused\-value \-Wunused\-variable |
| \&\-Wunused\-but\-set\-parameter \-Wunused\-but\-set\-variable |
| \&\-Wuseless\-cast \-Wvariadic\-macros \-Wvector\-operation\-performance |
| \&\-Wvla \-Wvolatile\-register\-var \-Wwrite\-strings \-Wzero\-as\-null\-pointer\-constant\fR |
| .IP "\fIC and Objective-C-only Warning Options\fR" 4 |
| .IX Item "C and Objective-C-only Warning Options" |
| \&\fB\-Wbad\-function\-cast \-Wmissing\-declarations |
| \&\-Wmissing\-parameter\-type \-Wmissing\-prototypes \-Wnested\-externs |
| \&\-Wold\-style\-declaration \-Wold\-style\-definition |
| \&\-Wstrict\-prototypes \-Wtraditional \-Wtraditional\-conversion |
| \&\-Wdeclaration\-after\-statement \-Wpointer\-sign\fR |
| .IP "\fIDebugging Options\fR" 4 |
| .IX Item "Debugging Options" |
| \&\fB\-d\fR\fIletters\fR \fB\-dumpspecs \-dumpmachine \-dumpversion |
| \&\-fsanitize=\fR\fIstyle\fR |
| \&\fB\-fdbg\-cnt\-list \-fdbg\-cnt=\fR\fIcounter-value-list\fR |
| \&\fB\-fdisable\-ipa\-\fR\fIpass_name\fR |
| \&\fB\-fdisable\-rtl\-\fR\fIpass_name\fR |
| \&\fB\-fdisable\-rtl\-\fR\fIpass-name\fR\fB=\fR\fIrange-list\fR |
| \&\fB\-fdisable\-tree\-\fR\fIpass_name\fR |
| \&\fB\-fdisable\-tree\-\fR\fIpass-name\fR\fB=\fR\fIrange-list\fR |
| \&\fB\-fdump\-noaddr \-fdump\-unnumbered \-fdump\-unnumbered\-links |
| \&\-fdump\-translation\-unit\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-class\-hierarchy\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-ipa\-all \-fdump\-ipa\-cgraph \-fdump\-ipa\-inline |
| \&\-fdump\-passes |
| \&\-fdump\-statistics |
| \&\-fdump\-tree\-all |
| \&\-fdump\-tree\-original\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-optimized\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-cfg \-fdump\-tree\-alias |
| \&\-fdump\-tree\-ch |
| \&\-fdump\-tree\-ssa\fR[\fB\-\fR\fIn\fR] \fB\-fdump\-tree\-pre\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-ccp\fR[\fB\-\fR\fIn\fR] \fB\-fdump\-tree\-dce\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-gimple\fR[\fB\-raw\fR] |
| \&\fB\-fdump\-tree\-dom\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-dse\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-phiprop\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-phiopt\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-forwprop\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-copyrename\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-nrv \-fdump\-tree\-vect |
| \&\-fdump\-tree\-sink |
| \&\-fdump\-tree\-sra\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-forwprop\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-fre\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-vtable\-verify |
| \&\-fdump\-tree\-vrp\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-tree\-storeccp\fR[\fB\-\fR\fIn\fR] |
| \&\fB\-fdump\-final\-insns=\fR\fIfile\fR |
| \&\fB\-fcompare\-debug\fR[\fB=\fR\fIopts\fR] \fB\-fcompare\-debug\-second |
| \&\-feliminate\-dwarf2\-dups \-fno\-eliminate\-unused\-debug\-types |
| \&\-feliminate\-unused\-debug\-symbols \-femit\-class\-debug\-always |
| \&\-fenable\-\fR\fIkind\fR\fB\-\fR\fIpass\fR |
| \&\fB\-fenable\-\fR\fIkind\fR\fB\-\fR\fIpass\fR\fB=\fR\fIrange-list\fR |
| \&\fB\-fdebug\-types\-section \-fmem\-report\-wpa |
| \&\-fmem\-report \-fpre\-ipa\-mem\-report \-fpost\-ipa\-mem\-report \-fprofile\-arcs |
| \&\-fopt\-info |
| \&\-fopt\-info\-\fR\fIoptions\fR[\fB=\fR\fIfile\fR] |
| \&\fB\-frandom\-seed=\fR\fIstring\fR \fB\-fsched\-verbose=\fR\fIn\fR |
| \&\fB\-fsel\-sched\-verbose \-fsel\-sched\-dump\-cfg \-fsel\-sched\-pipelining\-verbose |
| \&\-fstack\-usage \-ftest\-coverage \-ftime\-report \-fvar\-tracking |
| \&\-fvar\-tracking\-assignments \-fvar\-tracking\-assignments\-toggle |
| \&\-g \-g\fR\fIlevel\fR \fB\-gtoggle \-gcoff \-gdwarf\-\fR\fIversion\fR |
| \&\fB\-ggdb \-grecord\-gcc\-switches \-gno\-record\-gcc\-switches |
| \&\-gstabs \-gstabs+ \-gstrict\-dwarf \-gno\-strict\-dwarf |
| \&\-gvms \-gxcoff \-gxcoff+ |
| \&\-fno\-merge\-debug\-strings \-fno\-dwarf2\-cfi\-asm |
| \&\-fdebug\-prefix\-map=\fR\fIold\fR\fB=\fR\fInew\fR |
| \&\fB\-femit\-struct\-debug\-baseonly \-femit\-struct\-debug\-reduced |
| \&\-femit\-struct\-debug\-detailed\fR[\fB=\fR\fIspec-list\fR] |
| \&\fB\-p \-pg \-print\-file\-name=\fR\fIlibrary\fR \fB\-print\-libgcc\-file\-name |
| \&\-print\-multi\-directory \-print\-multi\-lib \-print\-multi\-os\-directory |
| \&\-print\-prog\-name=\fR\fIprogram\fR \fB\-print\-search\-dirs \-Q |
| \&\-print\-sysroot \-print\-sysroot\-headers\-suffix |
| \&\-save\-temps \-save\-temps=cwd \-save\-temps=obj \-time\fR[\fB=\fR\fIfile\fR] |
| .IP "\fIOptimization Options\fR" 4 |
| .IX Item "Optimization Options" |
| \&\fB\-faggressive\-loop\-optimizations \-falign\-functions[=\fR\fIn\fR\fB] |
| \&\-falign\-jumps[=\fR\fIn\fR\fB] |
| \&\-falign\-labels[=\fR\fIn\fR\fB] \-falign\-loops[=\fR\fIn\fR\fB] |
| \&\-fassociative\-math \-fauto\-inc\-dec \-fbranch\-probabilities |
| \&\-fbranch\-target\-load\-optimize \-fbranch\-target\-load\-optimize2 |
| \&\-fbtr\-bb\-exclusive \-fcaller\-saves |
| \&\-fcheck\-data\-deps \-fcombine\-stack\-adjustments \-fconserve\-stack |
| \&\-fcompare\-elim \-fcprop\-registers \-fcrossjumping |
| \&\-fcse\-follow\-jumps \-fcse\-skip\-blocks \-fcx\-fortran\-rules |
| \&\-fcx\-limited\-range |
| \&\-fdata\-sections \-fdce \-fdelayed\-branch |
| \&\-fdelete\-null\-pointer\-checks \-fdevirtualize \-fdevirtualize\-speculatively \-fdse |
| \&\-fearly\-inlining \-fipa\-sra \-fexpensive\-optimizations \-ffat\-lto\-objects |
| \&\-ffast\-math \-ffinite\-math\-only \-ffloat\-store \-fexcess\-precision=\fR\fIstyle\fR |
| \&\fB\-fforward\-propagate \-ffp\-contract=\fR\fIstyle\fR \fB\-ffunction\-sections |
| \&\-fgcse \-fgcse\-after\-reload \-fgcse\-las \-fgcse\-lm \-fgraphite\-identity |
| \&\-fgcse\-sm \-fhoist\-adjacent\-loads \-fif\-conversion |
| \&\-fif\-conversion2 \-findirect\-inlining |
| \&\-finline\-functions \-finline\-functions\-called\-once \-finline\-limit=\fR\fIn\fR |
| \&\fB\-finline\-small\-functions \-fipa\-cp \-fipa\-cp\-clone |
| \&\-fipa\-pta \-fipa\-profile \-fipa\-pure\-const \-fipa\-reference |
| \&\-fira\-algorithm=\fR\fIalgorithm\fR |
| \&\fB\-fira\-region=\fR\fIregion\fR \fB\-fira\-hoist\-pressure |
| \&\-fira\-loop\-pressure \-fno\-ira\-share\-save\-slots |
| \&\-fno\-ira\-share\-spill\-slots \-fira\-verbose=\fR\fIn\fR |
| \&\fB\-fisolate\-erroneous\-paths\-dereference \-fisolate\-erroneous\-paths\-attribute |
| \&\-fivopts \-fkeep\-inline\-functions \-fkeep\-static\-consts \-flive\-range\-shrinkage |
| \&\-floop\-block \-floop\-interchange \-floop\-strip\-mine \-floop\-nest\-optimize |
| \&\-floop\-parallelize\-all \-flto \-flto\-compression\-level |
| \&\-flto\-partition=\fR\fIalg\fR \fB\-flto\-report \-flto\-report\-wpa \-fmerge\-all\-constants |
| \&\-fmerge\-constants \-fmodulo\-sched \-fmodulo\-sched\-allow\-regmoves |
| \&\-fmove\-loop\-invariants \-fno\-branch\-count\-reg |
| \&\-fno\-defer\-pop \-fno\-function\-cse \-fno\-guess\-branch\-probability |
| \&\-fno\-inline \-fno\-math\-errno \-fno\-peephole \-fno\-peephole2 |
| \&\-fno\-sched\-interblock \-fno\-sched\-spec \-fno\-signed\-zeros |
| \&\-fno\-toplevel\-reorder \-fno\-trapping\-math \-fno\-zero\-initialized\-in\-bss |
| \&\-fomit\-frame\-pointer \-foptimize\-sibling\-calls |
| \&\-fpartial\-inlining \-fpeel\-loops \-fpredictive\-commoning |
| \&\-fprefetch\-loop\-arrays \-fprofile\-report |
| \&\-fprofile\-correction \-fprofile\-dir=\fR\fIpath\fR \fB\-fprofile\-generate |
| \&\-fprofile\-generate=\fR\fIpath\fR |
| \&\fB\-fprofile\-use \-fprofile\-use=\fR\fIpath\fR \fB\-fprofile\-values \-fprofile\-reorder\-functions |
| \&\-freciprocal\-math \-free \-frename\-registers \-freorder\-blocks |
| \&\-freorder\-blocks\-and\-partition \-freorder\-functions |
| \&\-frerun\-cse\-after\-loop \-freschedule\-modulo\-scheduled\-loops |
| \&\-frounding\-math \-fsched2\-use\-superblocks \-fsched\-pressure |
| \&\-fsched\-spec\-load \-fsched\-spec\-load\-dangerous |
| \&\-fsched\-stalled\-insns\-dep[=\fR\fIn\fR\fB] \-fsched\-stalled\-insns[=\fR\fIn\fR\fB] |
| \&\-fsched\-group\-heuristic \-fsched\-critical\-path\-heuristic |
| \&\-fsched\-spec\-insn\-heuristic \-fsched\-rank\-heuristic |
| \&\-fsched\-last\-insn\-heuristic \-fsched\-dep\-count\-heuristic |
| \&\-fschedule\-insns \-fschedule\-insns2 \-fsection\-anchors |
| \&\-fselective\-scheduling \-fselective\-scheduling2 |
| \&\-fsel\-sched\-pipelining \-fsel\-sched\-pipelining\-outer\-loops |
| \&\-fshrink\-wrap \-fsignaling\-nans \-fsingle\-precision\-constant |
| \&\-fsplit\-ivs\-in\-unroller \-fsplit\-wide\-types \-fstack\-protector |
| \&\-fstack\-protector\-all \-fstack\-protector\-strong \-fstrict\-aliasing |
| \&\-fstrict\-overflow \-fthread\-jumps \-ftracer \-ftree\-bit\-ccp |
| \&\-ftree\-builtin\-call\-dce \-ftree\-ccp \-ftree\-ch |
| \&\-ftree\-coalesce\-inline\-vars \-ftree\-coalesce\-vars \-ftree\-copy\-prop |
| \&\-ftree\-copyrename \-ftree\-dce \-ftree\-dominator\-opts \-ftree\-dse |
| \&\-ftree\-forwprop \-ftree\-fre \-ftree\-loop\-if\-convert |
| \&\-ftree\-loop\-if\-convert\-stores \-ftree\-loop\-im |
| \&\-ftree\-phiprop \-ftree\-loop\-distribution \-ftree\-loop\-distribute\-patterns |
| \&\-ftree\-loop\-ivcanon \-ftree\-loop\-linear \-ftree\-loop\-optimize |
| \&\-ftree\-loop\-vectorize |
| \&\-ftree\-parallelize\-loops=\fR\fIn\fR \fB\-ftree\-pre \-ftree\-partial\-pre \-ftree\-pta |
| \&\-ftree\-reassoc \-ftree\-sink \-ftree\-slsr \-ftree\-sra |
| \&\-ftree\-switch\-conversion \-ftree\-tail\-merge \-ftree\-ter |
| \&\-ftree\-vectorize \-ftree\-vrp |
| \&\-funit\-at\-a\-time \-funroll\-all\-loops \-funroll\-loops |
| \&\-funsafe\-loop\-optimizations \-funsafe\-math\-optimizations \-funswitch\-loops |
| \&\-fvariable\-expansion\-in\-unroller \-fvect\-cost\-model \-fvpt \-fweb |
| \&\-fwhole\-program \-fwpa \-fuse\-ld=\fR\fIlinker\fR \fB\-fuse\-linker\-plugin |
| \&\-\-param\fR \fIname\fR\fB=\fR\fIvalue\fR |
| \&\fB\-O \-O0 \-O1 \-O2 \-O3 \-Os \-Ofast \-Og\fR |
| .IP "\fIPreprocessor Options\fR" 4 |
| .IX Item "Preprocessor Options" |
| \&\fB\-A\fR\fIquestion\fR\fB=\fR\fIanswer\fR |
| \&\fB\-A\-\fR\fIquestion\fR[\fB=\fR\fIanswer\fR] |
| \&\fB\-C \-dD \-dI \-dM \-dN |
| \&\-D\fR\fImacro\fR[\fB=\fR\fIdefn\fR] \fB\-E \-H |
| \&\-idirafter\fR \fIdir\fR |
| \&\fB\-include\fR \fIfile\fR \fB\-imacros\fR \fIfile\fR |
| \&\fB\-iprefix\fR \fIfile\fR \fB\-iwithprefix\fR \fIdir\fR |
| \&\fB\-iwithprefixbefore\fR \fIdir\fR \fB\-isystem\fR \fIdir\fR |
| \&\fB\-imultilib\fR \fIdir\fR \fB\-isysroot\fR \fIdir\fR |
| \&\fB\-M \-MM \-MF \-MG \-MP \-MQ \-MT \-nostdinc |
| \&\-P \-fdebug\-cpp \-ftrack\-macro\-expansion \-fworking\-directory |
| \&\-remap \-trigraphs \-undef \-U\fR\fImacro\fR |
| \&\fB\-Wp,\fR\fIoption\fR \fB\-Xpreprocessor\fR \fIoption\fR \fB\-no\-integrated\-cpp\fR |
| .IP "\fIAssembler Option\fR" 4 |
| .IX Item "Assembler Option" |
| \&\fB\-Wa,\fR\fIoption\fR \fB\-Xassembler\fR \fIoption\fR |
| .IP "\fILinker Options\fR" 4 |
| .IX Item "Linker Options" |
| \&\fIobject-file-name\fR \fB\-l\fR\fIlibrary\fR |
| \&\fB\-nostartfiles \-nodefaultlibs \-nostdlib \-pie \-rdynamic |
| \&\-s \-static \-static\-libgcc \-static\-libstdc++ |
| \&\-static\-libasan \-static\-libtsan \-static\-liblsan \-static\-libubsan |
| \&\-shared \-shared\-libgcc \-symbolic |
| \&\-T\fR \fIscript\fR \fB\-Wl,\fR\fIoption\fR \fB\-Xlinker\fR \fIoption\fR |
| \&\fB\-u\fR \fIsymbol\fR |
| .IP "\fIDirectory Options\fR" 4 |
| .IX Item "Directory Options" |
| \&\fB\-B\fR\fIprefix\fR \fB\-I\fR\fIdir\fR \fB\-iplugindir=\fR\fIdir\fR |
| \&\fB\-iquote\fR\fIdir\fR \fB\-L\fR\fIdir\fR \fB\-specs=\fR\fIfile\fR \fB\-I\- |
| \&\-\-sysroot=\fR\fIdir\fR \fB\-\-no\-sysroot\-suffix\fR |
| .IP "\fIMachine Dependent Options\fR" 4 |
| .IX Item "Machine Dependent Options" |
| \&\fIAArch64 Options\fR |
| \&\fB\-mabi=\fR\fIname\fR \fB\-mbig\-endian \-mlittle\-endian |
| \&\-mgeneral\-regs\-only |
| \&\-mcmodel=tiny \-mcmodel=small \-mcmodel=large |
| \&\-mstrict\-align |
| \&\-momit\-leaf\-frame\-pointer \-mno\-omit\-leaf\-frame\-pointer |
| \&\-mtls\-dialect=desc \-mtls\-dialect=traditional |
| \&\-march=\fR\fIname\fR \fB\-mcpu=\fR\fIname\fR \fB\-mtune=\fR\fIname\fR |
| .Sp |
| \&\fIAdapteva Epiphany Options\fR |
| \&\fB\-mhalf\-reg\-file \-mprefer\-short\-insn\-regs |
| \&\-mbranch\-cost=\fR\fInum\fR \fB\-mcmove \-mnops=\fR\fInum\fR \fB\-msoft\-cmpsf |
| \&\-msplit\-lohi \-mpost\-inc \-mpost\-modify \-mstack\-offset=\fR\fInum\fR |
| \&\fB\-mround\-nearest \-mlong\-calls \-mshort\-calls \-msmall16 |
| \&\-mfp\-mode=\fR\fImode\fR \fB\-mvect\-double \-max\-vect\-align=\fR\fInum\fR |
| \&\fB\-msplit\-vecmove\-early \-m1reg\-\fR\fIreg\fR |
| .Sp |
| \&\fI\s-1ARC\s0 Options\fR |
| \&\fB\-mbarrel\-shifter |
| \&\-mcpu=\fR\fIcpu\fR \fB\-mA6 \-mARC600 \-mA7 \-mARC700 |
| \&\-mdpfp \-mdpfp\-compact \-mdpfp\-fast \-mno\-dpfp\-lrsr |
| \&\-mea \-mno\-mpy \-mmul32x16 \-mmul64 |
| \&\-mnorm \-mspfp \-mspfp\-compact \-mspfp\-fast \-msimd \-msoft\-float \-mswap |
| \&\-mcrc \-mdsp\-packa \-mdvbf \-mlock \-mmac\-d16 \-mmac\-24 \-mrtsc \-mswape |
| \&\-mtelephony \-mxy \-misize \-mannotate\-align \-marclinux \-marclinux_prof |
| \&\-mepilogue\-cfi \-mlong\-calls \-mmedium\-calls \-msdata |
| \&\-mucb\-mcount \-mvolatile\-cache |
| \&\-malign\-call \-mauto\-modify\-reg \-mbbit\-peephole \-mno\-brcc |
| \&\-mcase\-vector\-pcrel \-mcompact\-casesi \-mno\-cond\-exec \-mearly\-cbranchsi |
| \&\-mexpand\-adddi \-mindexed\-loads \-mlra \-mlra\-priority\-none |
| \&\-mlra\-priority\-compact mlra-priority-noncompact \-mno\-millicode |
| \&\-mmixed\-code \-mq\-class \-mRcq \-mRcw \-msize\-level=\fR\fIlevel\fR |
| \&\fB\-mtune=\fR\fIcpu\fR \fB\-mmultcost=\fR\fInum\fR \fB\-munalign\-prob\-threshold=\fR\fIprobability\fR |
| .Sp |
| \&\fI\s-1ARM\s0 Options\fR |
| \&\fB\-mapcs\-frame \-mno\-apcs\-frame |
| \&\-mabi=\fR\fIname\fR |
| \&\fB\-mapcs\-stack\-check \-mno\-apcs\-stack\-check |
| \&\-mapcs\-float \-mno\-apcs\-float |
| \&\-mapcs\-reentrant \-mno\-apcs\-reentrant |
| \&\-msched\-prolog \-mno\-sched\-prolog |
| \&\-mlittle\-endian \-mbig\-endian \-mwords\-little\-endian |
| \&\-mfloat\-abi=\fR\fIname\fR |
| \&\fB\-mfp16\-format=\fR\fIname\fR |
| \&\fB\-mthumb\-interwork \-mno\-thumb\-interwork |
| \&\-mcpu=\fR\fIname\fR \fB\-march=\fR\fIname\fR \fB\-mfpu=\fR\fIname\fR |
| \&\fB\-mstructure\-size\-boundary=\fR\fIn\fR |
| \&\fB\-mabort\-on\-noreturn |
| \&\-mlong\-calls \-mno\-long\-calls |
| \&\-msingle\-pic\-base \-mno\-single\-pic\-base |
| \&\-mpic\-register=\fR\fIreg\fR |
| \&\fB\-mnop\-fun\-dllimport |
| \&\-mpoke\-function\-name |
| \&\-mthumb \-marm |
| \&\-mtpcs\-frame \-mtpcs\-leaf\-frame |
| \&\-mcaller\-super\-interworking \-mcallee\-super\-interworking |
| \&\-mtp=\fR\fIname\fR \fB\-mtls\-dialect=\fR\fIdialect\fR |
| \&\fB\-mword\-relocations |
| \&\-mfix\-cortex\-m3\-ldrd |
| \&\-munaligned\-access |
| \&\-mneon\-for\-64bits |
| \&\-mslow\-flash\-data |
| \&\-mrestrict\-it\fR |
| .Sp |
| \&\fI\s-1AVR\s0 Options\fR |
| \&\fB\-mmcu=\fR\fImcu\fR \fB\-maccumulate\-args \-mbranch\-cost=\fR\fIcost\fR |
| \&\fB\-mcall\-prologues \-mint8 \-mno\-interrupts \-mrelax |
| \&\-mstrict\-X \-mtiny\-stack \-Waddr\-space\-convert\fR |
| .Sp |
| \&\fIBlackfin Options\fR |
| \&\fB\-mcpu=\fR\fIcpu\fR[\fB\-\fR\fIsirevision\fR] |
| \&\fB\-msim \-momit\-leaf\-frame\-pointer \-mno\-omit\-leaf\-frame\-pointer |
| \&\-mspecld\-anomaly \-mno\-specld\-anomaly \-mcsync\-anomaly \-mno\-csync\-anomaly |
| \&\-mlow\-64k \-mno\-low64k \-mstack\-check\-l1 \-mid\-shared\-library |
| \&\-mno\-id\-shared\-library \-mshared\-library\-id=\fR\fIn\fR |
| \&\fB\-mleaf\-id\-shared\-library \-mno\-leaf\-id\-shared\-library |
| \&\-msep\-data \-mno\-sep\-data \-mlong\-calls \-mno\-long\-calls |
| \&\-mfast\-fp \-minline\-plt \-mmulticore \-mcorea \-mcoreb \-msdram |
| \&\-micplb\fR |
| .Sp |
| \&\fIC6X Options\fR |
| \&\fB\-mbig\-endian \-mlittle\-endian \-march=\fR\fIcpu\fR |
| \&\fB\-msim \-msdata=\fR\fIsdata-type\fR |
| .Sp |
| \&\fI\s-1CRIS\s0 Options\fR |
| \&\fB\-mcpu=\fR\fIcpu\fR \fB\-march=\fR\fIcpu\fR \fB\-mtune=\fR\fIcpu\fR |
| \&\fB\-mmax\-stack\-frame=\fR\fIn\fR \fB\-melinux\-stacksize=\fR\fIn\fR |
| \&\fB\-metrax4 \-metrax100 \-mpdebug \-mcc\-init \-mno\-side\-effects |
| \&\-mstack\-align \-mdata\-align \-mconst\-align |
| \&\-m32\-bit \-m16\-bit \-m8\-bit \-mno\-prologue\-epilogue \-mno\-gotplt |
| \&\-melf \-maout \-melinux \-mlinux \-sim \-sim2 |
| \&\-mmul\-bug\-workaround \-mno\-mul\-bug\-workaround\fR |
| .Sp |
| \&\fI\s-1CR16\s0 Options\fR |
| \&\fB\-mmac |
| \&\-mcr16cplus \-mcr16c |
| \&\-msim \-mint32 \-mbit\-ops |
| \&\-mdata\-model=\fR\fImodel\fR |
| .Sp |
| \&\fIDarwin Options\fR |
| \&\fB\-all_load \-allowable_client \-arch \-arch_errors_fatal |
| \&\-arch_only \-bind_at_load \-bundle \-bundle_loader |
| \&\-client_name \-compatibility_version \-current_version |
| \&\-dead_strip |
| \&\-dependency\-file \-dylib_file \-dylinker_install_name |
| \&\-dynamic \-dynamiclib \-exported_symbols_list |
| \&\-filelist \-flat_namespace \-force_cpusubtype_ALL |
| \&\-force_flat_namespace \-headerpad_max_install_names |
| \&\-iframework |
| \&\-image_base \-init \-install_name \-keep_private_externs |
| \&\-multi_module \-multiply_defined \-multiply_defined_unused |
| \&\-noall_load \-no_dead_strip_inits_and_terms |
| \&\-nofixprebinding \-nomultidefs \-noprebind \-noseglinkedit |
| \&\-pagezero_size \-prebind \-prebind_all_twolevel_modules |
| \&\-private_bundle \-read_only_relocs \-sectalign |
| \&\-sectobjectsymbols \-whyload \-seg1addr |
| \&\-sectcreate \-sectobjectsymbols \-sectorder |
| \&\-segaddr \-segs_read_only_addr \-segs_read_write_addr |
| \&\-seg_addr_table \-seg_addr_table_filename \-seglinkedit |
| \&\-segprot \-segs_read_only_addr \-segs_read_write_addr |
| \&\-single_module \-static \-sub_library \-sub_umbrella |
| \&\-twolevel_namespace \-umbrella \-undefined |
| \&\-unexported_symbols_list \-weak_reference_mismatches |
| \&\-whatsloaded \-F \-gused \-gfull \-mmacosx\-version\-min=\fR\fIversion\fR |
| \&\fB\-mkernel \-mone\-byte\-bool\fR |
| .Sp |
| \&\fI\s-1DEC\s0 Alpha Options\fR |
| \&\fB\-mno\-fp\-regs \-msoft\-float |
| \&\-mieee \-mieee\-with\-inexact \-mieee\-conformant |
| \&\-mfp\-trap\-mode=\fR\fImode\fR \fB\-mfp\-rounding\-mode=\fR\fImode\fR |
| \&\fB\-mtrap\-precision=\fR\fImode\fR \fB\-mbuild\-constants |
| \&\-mcpu=\fR\fIcpu-type\fR \fB\-mtune=\fR\fIcpu-type\fR |
| \&\fB\-mbwx \-mmax \-mfix \-mcix |
| \&\-mfloat\-vax \-mfloat\-ieee |
| \&\-mexplicit\-relocs \-msmall\-data \-mlarge\-data |
| \&\-msmall\-text \-mlarge\-text |
| \&\-mmemory\-latency=\fR\fItime\fR |
| .Sp |
| \&\fI\s-1FR30\s0 Options\fR |
| \&\fB\-msmall\-model \-mno\-lsim\fR |
| .Sp |
| \&\fI\s-1FRV\s0 Options\fR |
| \&\fB\-mgpr\-32 \-mgpr\-64 \-mfpr\-32 \-mfpr\-64 |
| \&\-mhard\-float \-msoft\-float |
| \&\-malloc\-cc \-mfixed\-cc \-mdword \-mno\-dword |
| \&\-mdouble \-mno\-double |
| \&\-mmedia \-mno\-media \-mmuladd \-mno\-muladd |
| \&\-mfdpic \-minline\-plt \-mgprel\-ro \-multilib\-library\-pic |
| \&\-mlinked\-fp \-mlong\-calls \-malign\-labels |
| \&\-mlibrary\-pic \-macc\-4 \-macc\-8 |
| \&\-mpack \-mno\-pack \-mno\-eflags \-mcond\-move \-mno\-cond\-move |
| \&\-moptimize\-membar \-mno\-optimize\-membar |
| \&\-mscc \-mno\-scc \-mcond\-exec \-mno\-cond\-exec |
| \&\-mvliw\-branch \-mno\-vliw\-branch |
| \&\-mmulti\-cond\-exec \-mno\-multi\-cond\-exec \-mnested\-cond\-exec |
| \&\-mno\-nested\-cond\-exec \-mtomcat\-stats |
| \&\-mTLS \-mtls |
| \&\-mcpu=\fR\fIcpu\fR |
| .Sp |
| \&\fIGNU/Linux Options\fR |
| \&\fB\-mglibc \-muclibc \-mbionic \-mandroid |
| \&\-tno\-android\-cc \-tno\-android\-ld\fR |
| .Sp |
| \&\fIH8/300 Options\fR |
| \&\fB\-mrelax \-mh \-ms \-mn \-mexr \-mno\-exr \-mint32 \-malign\-300\fR |
| .Sp |
| \&\fI\s-1HPPA\s0 Options\fR |
| \&\fB\-march=\fR\fIarchitecture-type\fR |
| \&\fB\-mdisable\-fpregs \-mdisable\-indexing |
| \&\-mfast\-indirect\-calls \-mgas \-mgnu\-ld \-mhp\-ld |
| \&\-mfixed\-range=\fR\fIregister-range\fR |
| \&\fB\-mjump\-in\-delay \-mlinker\-opt \-mlong\-calls |
| \&\-mlong\-load\-store \-mno\-disable\-fpregs |
| \&\-mno\-disable\-indexing \-mno\-fast\-indirect\-calls \-mno\-gas |
| \&\-mno\-jump\-in\-delay \-mno\-long\-load\-store |
| \&\-mno\-portable\-runtime \-mno\-soft\-float |
| \&\-mno\-space\-regs \-msoft\-float \-mpa\-risc\-1\-0 |
| \&\-mpa\-risc\-1\-1 \-mpa\-risc\-2\-0 \-mportable\-runtime |
| \&\-mschedule=\fR\fIcpu-type\fR \fB\-mspace\-regs \-msio \-mwsio |
| \&\-munix=\fR\fIunix-std\fR \fB\-nolibdld \-static \-threads\fR |
| .Sp |
| \&\fIi386 and x86\-64 Options\fR |
| \&\fB\-mtune=\fR\fIcpu-type\fR \fB\-march=\fR\fIcpu-type\fR |
| \&\fB\-mtune\-ctrl=\fR\fIfeature-list\fR \fB\-mdump\-tune\-features \-mno\-default |
| \&\-mfpmath=\fR\fIunit\fR |
| \&\fB\-masm=\fR\fIdialect\fR \fB\-mno\-fancy\-math\-387 |
| \&\-mno\-fp\-ret\-in\-387 \-msoft\-float |
| \&\-mno\-wide\-multiply \-mrtd \-malign\-double |
| \&\-mpreferred\-stack\-boundary=\fR\fInum\fR |
| \&\fB\-mincoming\-stack\-boundary=\fR\fInum\fR |
| \&\fB\-mcld \-mcx16 \-msahf \-mmovbe \-mcrc32 |
| \&\-mrecip \-mrecip=\fR\fIopt\fR |
| \&\fB\-mvzeroupper \-mprefer\-avx128 |
| \&\-mmmx \-msse \-msse2 \-msse3 \-mssse3 \-msse4.1 \-msse4.2 \-msse4 \-mavx |
| \&\-mavx2 \-mavx512f \-mavx512pf \-mavx512er \-mavx512cd \-msha |
| \&\-maes \-mpclmul \-mfsgsbase \-mrdrnd \-mf16c \-mfma \-mprefetchwt1 |
| \&\-msse4a \-m3dnow \-mpopcnt \-mabm \-mbmi \-mtbm \-mfma4 \-mxop \-mlzcnt |
| \&\-mbmi2 \-mfxsr \-mxsave \-mxsaveopt \-mrtm \-mlwp \-mthreads |
| \&\-mno\-align\-stringops \-minline\-all\-stringops |
| \&\-minline\-stringops\-dynamically \-mstringop\-strategy=\fR\fIalg\fR |
| \&\fB\-mmemcpy\-strategy=\fR\fIstrategy\fR \fB\-mmemset\-strategy=\fR\fIstrategy\fR |
| \&\fB\-mpush\-args \-maccumulate\-outgoing\-args \-m128bit\-long\-double |
| \&\-m96bit\-long\-double \-mlong\-double\-64 \-mlong\-double\-80 \-mlong\-double\-128 |
| \&\-mregparm=\fR\fInum\fR \fB\-msseregparm |
| \&\-mveclibabi=\fR\fItype\fR \fB\-mvect8\-ret\-in\-mem |
| \&\-mpc32 \-mpc64 \-mpc80 \-mstackrealign |
| \&\-momit\-leaf\-frame\-pointer \-mno\-red\-zone \-mno\-tls\-direct\-seg\-refs |
| \&\-mcmodel=\fR\fIcode-model\fR \fB\-mabi=\fR\fIname\fR \fB\-maddress\-mode=\fR\fImode\fR |
| \&\fB\-m32 \-m64 \-mx32 \-m16 \-mlarge\-data\-threshold=\fR\fInum\fR |
| \&\fB\-msse2avx \-mfentry \-m8bit\-idiv |
| \&\-mavx256\-split\-unaligned\-load \-mavx256\-split\-unaligned\-store |
| \&\-mstack\-protector\-guard=\fR\fIguard\fR |
| .Sp |
| \&\fIi386 and x86\-64 Windows Options\fR |
| \&\fB\-mconsole \-mcygwin \-mno\-cygwin \-mdll |
| \&\-mnop\-fun\-dllimport \-mthread |
| \&\-municode \-mwin32 \-mwindows \-fno\-set\-stack\-executable\fR |
| .Sp |
| \&\fI\s-1IA\-64\s0 Options\fR |
| \&\fB\-mbig\-endian \-mlittle\-endian \-mgnu\-as \-mgnu\-ld \-mno\-pic |
| \&\-mvolatile\-asm\-stop \-mregister\-names \-msdata \-mno\-sdata |
| \&\-mconstant\-gp \-mauto\-pic \-mfused\-madd |
| \&\-minline\-float\-divide\-min\-latency |
| \&\-minline\-float\-divide\-max\-throughput |
| \&\-mno\-inline\-float\-divide |
| \&\-minline\-int\-divide\-min\-latency |
| \&\-minline\-int\-divide\-max\-throughput |
| \&\-mno\-inline\-int\-divide |
| \&\-minline\-sqrt\-min\-latency \-minline\-sqrt\-max\-throughput |
| \&\-mno\-inline\-sqrt |
| \&\-mdwarf2\-asm \-mearly\-stop\-bits |
| \&\-mfixed\-range=\fR\fIregister-range\fR \fB\-mtls\-size=\fR\fItls-size\fR |
| \&\fB\-mtune=\fR\fIcpu-type\fR \fB\-milp32 \-mlp64 |
| \&\-msched\-br\-data\-spec \-msched\-ar\-data\-spec \-msched\-control\-spec |
| \&\-msched\-br\-in\-data\-spec \-msched\-ar\-in\-data\-spec \-msched\-in\-control\-spec |
| \&\-msched\-spec\-ldc \-msched\-spec\-control\-ldc |
| \&\-msched\-prefer\-non\-data\-spec\-insns \-msched\-prefer\-non\-control\-spec\-insns |
| \&\-msched\-stop\-bits\-after\-every\-cycle \-msched\-count\-spec\-in\-critical\-path |
| \&\-msel\-sched\-dont\-check\-control\-spec \-msched\-fp\-mem\-deps\-zero\-cost |
| \&\-msched\-max\-memory\-insns\-hard\-limit \-msched\-max\-memory\-insns=\fR\fImax-insns\fR |
| .Sp |
| \&\fI\s-1LM32\s0 Options\fR |
| \&\fB\-mbarrel\-shift\-enabled \-mdivide\-enabled \-mmultiply\-enabled |
| \&\-msign\-extend\-enabled \-muser\-enabled\fR |
| .Sp |
| \&\fIM32R/D Options\fR |
| \&\fB\-m32r2 \-m32rx \-m32r |
| \&\-mdebug |
| \&\-malign\-loops \-mno\-align\-loops |
| \&\-missue\-rate=\fR\fInumber\fR |
| \&\fB\-mbranch\-cost=\fR\fInumber\fR |
| \&\fB\-mmodel=\fR\fIcode-size-model-type\fR |
| \&\fB\-msdata=\fR\fIsdata-type\fR |
| \&\fB\-mno\-flush\-func \-mflush\-func=\fR\fIname\fR |
| \&\fB\-mno\-flush\-trap \-mflush\-trap=\fR\fInumber\fR |
| \&\fB\-G\fR \fInum\fR |
| .Sp |
| \&\fIM32C Options\fR |
| \&\fB\-mcpu=\fR\fIcpu\fR \fB\-msim \-memregs=\fR\fInumber\fR |
| .Sp |
| \&\fIM680x0 Options\fR |
| \&\fB\-march=\fR\fIarch\fR \fB\-mcpu=\fR\fIcpu\fR \fB\-mtune=\fR\fItune\fR |
| \&\fB\-m68000 \-m68020 \-m68020\-40 \-m68020\-60 \-m68030 \-m68040 |
| \&\-m68060 \-mcpu32 \-m5200 \-m5206e \-m528x \-m5307 \-m5407 |
| \&\-mcfv4e \-mbitfield \-mno\-bitfield \-mc68000 \-mc68020 |
| \&\-mnobitfield \-mrtd \-mno\-rtd \-mdiv \-mno\-div \-mshort |
| \&\-mno\-short \-mhard\-float \-m68881 \-msoft\-float \-mpcrel |
| \&\-malign\-int \-mstrict\-align \-msep\-data \-mno\-sep\-data |
| \&\-mshared\-library\-id=n \-mid\-shared\-library \-mno\-id\-shared\-library |
| \&\-mxgot \-mno\-xgot\fR |
| .Sp |
| \&\fIMCore Options\fR |
| \&\fB\-mhardlit \-mno\-hardlit \-mdiv \-mno\-div \-mrelax\-immediates |
| \&\-mno\-relax\-immediates \-mwide\-bitfields \-mno\-wide\-bitfields |
| \&\-m4byte\-functions \-mno\-4byte\-functions \-mcallgraph\-data |
| \&\-mno\-callgraph\-data \-mslow\-bytes \-mno\-slow\-bytes \-mno\-lsim |
| \&\-mlittle\-endian \-mbig\-endian \-m210 \-m340 \-mstack\-increment\fR |
| .Sp |
| \&\fIMeP Options\fR |
| \&\fB\-mabsdiff \-mall\-opts \-maverage \-mbased=\fR\fIn\fR \fB\-mbitops |
| \&\-mc=\fR\fIn\fR \fB\-mclip \-mconfig=\fR\fIname\fR \fB\-mcop \-mcop32 \-mcop64 \-mivc2 |
| \&\-mdc \-mdiv \-meb \-mel \-mio\-volatile \-ml \-mleadz \-mm \-mminmax |
| \&\-mmult \-mno\-opts \-mrepeat \-ms \-msatur \-msdram \-msim \-msimnovec \-mtf |
| \&\-mtiny=\fR\fIn\fR |
| .Sp |
| \&\fIMicroBlaze Options\fR |
| \&\fB\-msoft\-float \-mhard\-float \-msmall\-divides \-mcpu=\fR\fIcpu\fR |
| \&\fB\-mmemcpy \-mxl\-soft\-mul \-mxl\-soft\-div \-mxl\-barrel\-shift |
| \&\-mxl\-pattern\-compare \-mxl\-stack\-check \-mxl\-gp\-opt \-mno\-clearbss |
| \&\-mxl\-multiply\-high \-mxl\-float\-convert \-mxl\-float\-sqrt |
| \&\-mbig\-endian \-mlittle\-endian \-mxl\-reorder \-mxl\-mode\-\fR\fIapp-model\fR |
| .Sp |
| \&\fI\s-1MIPS\s0 Options\fR |
| \&\fB\-EL \-EB \-march=\fR\fIarch\fR \fB\-mtune=\fR\fIarch\fR |
| \&\fB\-mips1 \-mips2 \-mips3 \-mips4 \-mips32 \-mips32r2 |
| \&\-mips64 \-mips64r2 |
| \&\-mips16 \-mno\-mips16 \-mflip\-mips16 |
| \&\-minterlink\-compressed \-mno\-interlink\-compressed |
| \&\-minterlink\-mips16 \-mno\-interlink\-mips16 |
| \&\-mabi=\fR\fIabi\fR \fB\-mabicalls \-mno\-abicalls |
| \&\-mshared \-mno\-shared \-mplt \-mno\-plt \-mxgot \-mno\-xgot |
| \&\-mgp32 \-mgp64 \-mfp32 \-mfp64 \-mhard\-float \-msoft\-float |
| \&\-mno\-float \-msingle\-float \-mdouble\-float |
| \&\-mabs=\fR\fImode\fR \fB\-mnan=\fR\fIencoding\fR |
| \&\fB\-mdsp \-mno\-dsp \-mdspr2 \-mno\-dspr2 |
| \&\-mmcu \-mmno\-mcu |
| \&\-meva \-mno\-eva |
| \&\-mvirt \-mno\-virt |
| \&\-mmicromips \-mno\-micromips |
| \&\-mfpu=\fR\fIfpu-type\fR |
| \&\fB\-msmartmips \-mno\-smartmips |
| \&\-mpaired\-single \-mno\-paired\-single \-mdmx \-mno\-mdmx |
| \&\-mips3d \-mno\-mips3d \-mmt \-mno\-mt \-mllsc \-mno\-llsc |
| \&\-mlong64 \-mlong32 \-msym32 \-mno\-sym32 |
| \&\-G\fR\fInum\fR \fB\-mlocal\-sdata \-mno\-local\-sdata |
| \&\-mextern\-sdata \-mno\-extern\-sdata \-mgpopt \-mno\-gopt |
| \&\-membedded\-data \-mno\-embedded\-data |
| \&\-muninit\-const\-in\-rodata \-mno\-uninit\-const\-in\-rodata |
| \&\-mcode\-readable=\fR\fIsetting\fR |
| \&\fB\-msplit\-addresses \-mno\-split\-addresses |
| \&\-mexplicit\-relocs \-mno\-explicit\-relocs |
| \&\-mcheck\-zero\-division \-mno\-check\-zero\-division |
| \&\-mdivide\-traps \-mdivide\-breaks |
| \&\-mmemcpy \-mno\-memcpy \-mlong\-calls \-mno\-long\-calls |
| \&\-mmad \-mno\-mad \-mimadd \-mno\-imadd \-mfused\-madd \-mno\-fused\-madd \-nocpp |
| \&\-mfix\-24k \-mno\-fix\-24k |
| \&\-mfix\-r4000 \-mno\-fix\-r4000 \-mfix\-r4400 \-mno\-fix\-r4400 |
| \&\-mfix\-r10000 \-mno\-fix\-r10000 \-mfix\-rm7000 \-mno\-fix\-rm7000 |
| \&\-mfix\-vr4120 \-mno\-fix\-vr4120 |
| \&\-mfix\-vr4130 \-mno\-fix\-vr4130 \-mfix\-sb1 \-mno\-fix\-sb1 |
| \&\-mflush\-func=\fR\fIfunc\fR \fB\-mno\-flush\-func |
| \&\-mbranch\-cost=\fR\fInum\fR \fB\-mbranch\-likely \-mno\-branch\-likely |
| \&\-mfp\-exceptions \-mno\-fp\-exceptions |
| \&\-mvr4130\-align \-mno\-vr4130\-align \-msynci \-mno\-synci |
| \&\-mrelax\-pic\-calls \-mno\-relax\-pic\-calls \-mmcount\-ra\-address\fR |
| .Sp |
| \&\fI\s-1MMIX\s0 Options\fR |
| \&\fB\-mlibfuncs \-mno\-libfuncs \-mepsilon \-mno\-epsilon \-mabi=gnu |
| \&\-mabi=mmixware \-mzero\-extend \-mknuthdiv \-mtoplevel\-symbols |
| \&\-melf \-mbranch\-predict \-mno\-branch\-predict \-mbase\-addresses |
| \&\-mno\-base\-addresses \-msingle\-exit \-mno\-single\-exit\fR |
| .Sp |
| \&\fI\s-1MN10300\s0 Options\fR |
| \&\fB\-mmult\-bug \-mno\-mult\-bug |
| \&\-mno\-am33 \-mam33 \-mam33\-2 \-mam34 |
| \&\-mtune=\fR\fIcpu-type\fR |
| \&\fB\-mreturn\-pointer\-on\-d0 |
| \&\-mno\-crt0 \-mrelax \-mliw \-msetlb\fR |
| .Sp |
| \&\fIMoxie Options\fR |
| \&\fB\-meb \-mel \-mno\-crt0\fR |
| .Sp |
| \&\fI\s-1MSP430\s0 Options\fR |
| \&\fB\-msim \-masm\-hex \-mmcu= \-mcpu= \-mlarge \-msmall \-mrelax |
| \&\-mhwmult=\fR |
| .Sp |
| \&\fI\s-1NDS32\s0 Options\fR |
| \&\fB\-mbig\-endian \-mlittle\-endian |
| \&\-mreduced\-regs \-mfull\-regs |
| \&\-mcmov \-mno\-cmov |
| \&\-mperf\-ext \-mno\-perf\-ext |
| \&\-mv3push \-mno\-v3push |
| \&\-m16bit \-mno\-16bit |
| \&\-mgp\-direct \-mno\-gp\-direct |
| \&\-misr\-vector\-size=\fR\fInum\fR |
| \&\fB\-mcache\-block\-size=\fR\fInum\fR |
| \&\fB\-march=\fR\fIarch\fR |
| \&\fB\-mforce\-fp\-as\-gp \-mforbid\-fp\-as\-gp |
| \&\-mex9 \-mctor\-dtor \-mrelax\fR |
| .Sp |
| \&\fINios \s-1II\s0 Options\fR |
| \&\fB\-G\fR \fInum\fR \fB\-mgpopt \-mno\-gpopt \-mel \-meb |
| \&\-mno\-bypass\-cache \-mbypass\-cache |
| \&\-mno\-cache\-volatile \-mcache\-volatile |
| \&\-mno\-fast\-sw\-div \-mfast\-sw\-div |
| \&\-mhw\-mul \-mno\-hw\-mul \-mhw\-mulx \-mno\-hw\-mulx \-mno\-hw\-div \-mhw\-div |
| \&\-mcustom\-\fR\fIinsn\fR\fB=\fR\fIN\fR \fB\-mno\-custom\-\fR\fIinsn\fR |
| \&\fB\-mcustom\-fpu\-cfg=\fR\fIname\fR |
| \&\fB\-mhal \-msmallc \-msys\-crt0=\fR\fIname\fR \fB\-msys\-lib=\fR\fIname\fR |
| .Sp |
| \&\fI\s-1PDP\-11\s0 Options\fR |
| \&\fB\-mfpu \-msoft\-float \-mac0 \-mno\-ac0 \-m40 \-m45 \-m10 |
| \&\-mbcopy \-mbcopy\-builtin \-mint32 \-mno\-int16 |
| \&\-mint16 \-mno\-int32 \-mfloat32 \-mno\-float64 |
| \&\-mfloat64 \-mno\-float32 \-mabshi \-mno\-abshi |
| \&\-mbranch\-expensive \-mbranch\-cheap |
| \&\-munix\-asm \-mdec\-asm\fR |
| .Sp |
| \&\fIpicoChip Options\fR |
| \&\fB\-mae=\fR\fIae_type\fR \fB\-mvliw\-lookahead=\fR\fIN\fR |
| \&\fB\-msymbol\-as\-address \-mno\-inefficient\-warnings\fR |
| .Sp |
| \&\fIPowerPC Options\fR |
| See \s-1RS/6000\s0 and PowerPC Options. |
| .Sp |
| \&\fI\s-1RL78\s0 Options\fR |
| \&\fB\-msim \-mmul=none \-mmul=g13 \-mmul=rl78\fR |
| .Sp |
| \&\fI\s-1RS/6000\s0 and PowerPC Options\fR |
| \&\fB\-mcpu=\fR\fIcpu-type\fR |
| \&\fB\-mtune=\fR\fIcpu-type\fR |
| \&\fB\-mcmodel=\fR\fIcode-model\fR |
| \&\fB\-mpowerpc64 |
| \&\-maltivec \-mno\-altivec |
| \&\-mpowerpc\-gpopt \-mno\-powerpc\-gpopt |
| \&\-mpowerpc\-gfxopt \-mno\-powerpc\-gfxopt |
| \&\-mmfcrf \-mno\-mfcrf \-mpopcntb \-mno\-popcntb \-mpopcntd \-mno\-popcntd |
| \&\-mfprnd \-mno\-fprnd |
| \&\-mcmpb \-mno\-cmpb \-mmfpgpr \-mno\-mfpgpr \-mhard\-dfp \-mno\-hard\-dfp |
| \&\-mfull\-toc \-mminimal\-toc \-mno\-fp\-in\-toc \-mno\-sum\-in\-toc |
| \&\-m64 \-m32 \-mxl\-compat \-mno\-xl\-compat \-mpe |
| \&\-malign\-power \-malign\-natural |
| \&\-msoft\-float \-mhard\-float \-mmultiple \-mno\-multiple |
| \&\-msingle\-float \-mdouble\-float \-msimple\-fpu |
| \&\-mstring \-mno\-string \-mupdate \-mno\-update |
| \&\-mavoid\-indexed\-addresses \-mno\-avoid\-indexed\-addresses |
| \&\-mfused\-madd \-mno\-fused\-madd \-mbit\-align \-mno\-bit\-align |
| \&\-mstrict\-align \-mno\-strict\-align \-mrelocatable |
| \&\-mno\-relocatable \-mrelocatable\-lib \-mno\-relocatable\-lib |
| \&\-mtoc \-mno\-toc \-mlittle \-mlittle\-endian \-mbig \-mbig\-endian |
| \&\-mdynamic\-no\-pic \-maltivec \-mswdiv \-msingle\-pic\-base |
| \&\-mprioritize\-restricted\-insns=\fR\fIpriority\fR |
| \&\fB\-msched\-costly\-dep=\fR\fIdependence_type\fR |
| \&\fB\-minsert\-sched\-nops=\fR\fIscheme\fR |
| \&\fB\-mcall\-sysv \-mcall\-netbsd |
| \&\-maix\-struct\-return \-msvr4\-struct\-return |
| \&\-mabi=\fR\fIabi-type\fR \fB\-msecure\-plt \-mbss\-plt |
| \&\-mblock\-move\-inline\-limit=\fR\fInum\fR |
| \&\fB\-misel \-mno\-isel |
| \&\-misel=yes \-misel=no |
| \&\-mspe \-mno\-spe |
| \&\-mspe=yes \-mspe=no |
| \&\-mpaired |
| \&\-mgen\-cell\-microcode \-mwarn\-cell\-microcode |
| \&\-mvrsave \-mno\-vrsave |
| \&\-mmulhw \-mno\-mulhw |
| \&\-mdlmzb \-mno\-dlmzb |
| \&\-mfloat\-gprs=yes \-mfloat\-gprs=no \-mfloat\-gprs=single \-mfloat\-gprs=double |
| \&\-mprototype \-mno\-prototype |
| \&\-msim \-mmvme \-mads \-myellowknife \-memb \-msdata |
| \&\-msdata=\fR\fIopt\fR \fB\-mvxworks \-G\fR \fInum\fR \fB\-pthread |
| \&\-mrecip \-mrecip=\fR\fIopt\fR \fB\-mno\-recip \-mrecip\-precision |
| \&\-mno\-recip\-precision |
| \&\-mveclibabi=\fR\fItype\fR \fB\-mfriz \-mno\-friz |
| \&\-mpointers\-to\-nested\-functions \-mno\-pointers\-to\-nested\-functions |
| \&\-msave\-toc\-indirect \-mno\-save\-toc\-indirect |
| \&\-mpower8\-fusion \-mno\-mpower8\-fusion \-mpower8\-vector \-mno\-power8\-vector |
| \&\-mcrypto \-mno\-crypto \-mdirect\-move \-mno\-direct\-move |
| \&\-mquad\-memory \-mno\-quad\-memory |
| \&\-mquad\-memory\-atomic \-mno\-quad\-memory\-atomic |
| \&\-mcompat\-align\-parm \-mno\-compat\-align\-parm\fR |
| .Sp |
| \&\fI\s-1RX\s0 Options\fR |
| \&\fB\-m64bit\-doubles \-m32bit\-doubles \-fpu \-nofpu |
| \&\-mcpu= |
| \&\-mbig\-endian\-data \-mlittle\-endian\-data |
| \&\-msmall\-data |
| \&\-msim \-mno\-sim |
| \&\-mas100\-syntax \-mno\-as100\-syntax |
| \&\-mrelax |
| \&\-mmax\-constant\-size= |
| \&\-mint\-register= |
| \&\-mpid |
| \&\-mno\-warn\-multiple\-fast\-interrupts |
| \&\-msave\-acc\-in\-interrupts\fR |
| .Sp |
| \&\fIS/390 and zSeries Options\fR |
| \&\fB\-mtune=\fR\fIcpu-type\fR \fB\-march=\fR\fIcpu-type\fR |
| \&\fB\-mhard\-float \-msoft\-float \-mhard\-dfp \-mno\-hard\-dfp |
| \&\-mlong\-double\-64 \-mlong\-double\-128 |
| \&\-mbackchain \-mno\-backchain \-mpacked\-stack \-mno\-packed\-stack |
| \&\-msmall\-exec \-mno\-small\-exec \-mmvcle \-mno\-mvcle |
| \&\-m64 \-m31 \-mdebug \-mno\-debug \-mesa \-mzarch |
| \&\-mtpf\-trace \-mno\-tpf\-trace \-mfused\-madd \-mno\-fused\-madd |
| \&\-mwarn\-framesize \-mwarn\-dynamicstack \-mstack\-size \-mstack\-guard |
| \&\-mhotpatch[=\fR\fIhalfwords\fR\fB] \-mno\-hotpatch\fR |
| .Sp |
| \&\fIScore Options\fR |
| \&\fB\-meb \-mel |
| \&\-mnhwloop |
| \&\-muls |
| \&\-mmac |
| \&\-mscore5 \-mscore5u \-mscore7 \-mscore7d\fR |
| .Sp |
| \&\fI\s-1SH\s0 Options\fR |
| \&\fB\-m1 \-m2 \-m2e |
| \&\-m2a\-nofpu \-m2a\-single\-only \-m2a\-single \-m2a |
| \&\-m3 \-m3e |
| \&\-m4\-nofpu \-m4\-single\-only \-m4\-single \-m4 |
| \&\-m4a\-nofpu \-m4a\-single\-only \-m4a\-single \-m4a \-m4al |
| \&\-m5\-64media \-m5\-64media\-nofpu |
| \&\-m5\-32media \-m5\-32media\-nofpu |
| \&\-m5\-compact \-m5\-compact\-nofpu |
| \&\-mb \-ml \-mdalign \-mrelax |
| \&\-mbigtable \-mfmovd \-mhitachi \-mrenesas \-mno\-renesas \-mnomacsave |
| \&\-mieee \-mno\-ieee \-mbitops \-misize \-minline\-ic_invalidate \-mpadstruct |
| \&\-mspace \-mprefergot \-musermode \-multcost=\fR\fInumber\fR \fB\-mdiv=\fR\fIstrategy\fR |
| \&\fB\-mdivsi3_libfunc=\fR\fIname\fR \fB\-mfixed\-range=\fR\fIregister-range\fR |
| \&\fB\-mindexed\-addressing \-mgettrcost=\fR\fInumber\fR \fB\-mpt\-fixed |
| \&\-maccumulate\-outgoing\-args \-minvalid\-symbols |
| \&\-matomic\-model=\fR\fIatomic-model\fR |
| \&\fB\-mbranch\-cost=\fR\fInum\fR \fB\-mzdcbranch \-mno\-zdcbranch |
| \&\-mfused\-madd \-mno\-fused\-madd \-mfsca \-mno\-fsca \-mfsrra \-mno\-fsrra |
| \&\-mpretend\-cmove \-mtas\fR |
| .Sp |
| \&\fISolaris 2 Options\fR |
| \&\fB\-mclear\-hwcap \-mno\-clear\-hwcap \-mimpure\-text \-mno\-impure\-text |
| \&\-pthreads \-pthread\fR |
| .Sp |
| \&\fI\s-1SPARC\s0 Options\fR |
| \&\fB\-mcpu=\fR\fIcpu-type\fR |
| \&\fB\-mtune=\fR\fIcpu-type\fR |
| \&\fB\-mcmodel=\fR\fIcode-model\fR |
| \&\fB\-mmemory\-model=\fR\fImem-model\fR |
| \&\fB\-m32 \-m64 \-mapp\-regs \-mno\-app\-regs |
| \&\-mfaster\-structs \-mno\-faster\-structs \-mflat \-mno\-flat |
| \&\-mfpu \-mno\-fpu \-mhard\-float \-msoft\-float |
| \&\-mhard\-quad\-float \-msoft\-quad\-float |
| \&\-mstack\-bias \-mno\-stack\-bias |
| \&\-munaligned\-doubles \-mno\-unaligned\-doubles |
| \&\-muser\-mode \-mno\-user\-mode |
| \&\-mv8plus \-mno\-v8plus \-mvis \-mno\-vis |
| \&\-mvis2 \-mno\-vis2 \-mvis3 \-mno\-vis3 |
| \&\-mcbcond \-mno\-cbcond |
| \&\-mfmaf \-mno\-fmaf \-mpopc \-mno\-popc |
| \&\-mfix\-at697f \-mfix\-ut699\fR |
| .Sp |
| \&\fI\s-1SPU\s0 Options\fR |
| \&\fB\-mwarn\-reloc \-merror\-reloc |
| \&\-msafe\-dma \-munsafe\-dma |
| \&\-mbranch\-hints |
| \&\-msmall\-mem \-mlarge\-mem \-mstdmain |
| \&\-mfixed\-range=\fR\fIregister-range\fR |
| \&\fB\-mea32 \-mea64 |
| \&\-maddress\-space\-conversion \-mno\-address\-space\-conversion |
| \&\-mcache\-size=\fR\fIcache-size\fR |
| \&\fB\-matomic\-updates \-mno\-atomic\-updates\fR |
| .Sp |
| \&\fISystem V Options\fR |
| \&\fB\-Qy \-Qn \-YP,\fR\fIpaths\fR \fB\-Ym,\fR\fIdir\fR |
| .Sp |
| \&\fITILE-Gx Options\fR |
| \&\fB\-mcpu=CPU \-m32 \-m64 \-mbig\-endian \-mlittle\-endian |
| \&\-mcmodel=\fR\fIcode-model\fR |
| .Sp |
| \&\fITILEPro Options\fR |
| \&\fB\-mcpu=\fR\fIcpu\fR \fB\-m32\fR |
| .Sp |
| \&\fIV850 Options\fR |
| \&\fB\-mlong\-calls \-mno\-long\-calls \-mep \-mno\-ep |
| \&\-mprolog\-function \-mno\-prolog\-function \-mspace |
| \&\-mtda=\fR\fIn\fR \fB\-msda=\fR\fIn\fR \fB\-mzda=\fR\fIn\fR |
| \&\fB\-mapp\-regs \-mno\-app\-regs |
| \&\-mdisable\-callt \-mno\-disable\-callt |
| \&\-mv850e2v3 \-mv850e2 \-mv850e1 \-mv850es |
| \&\-mv850e \-mv850 \-mv850e3v5 |
| \&\-mloop |
| \&\-mrelax |
| \&\-mlong\-jumps |
| \&\-msoft\-float |
| \&\-mhard\-float |
| \&\-mgcc\-abi |
| \&\-mrh850\-abi |
| \&\-mbig\-switch\fR |
| .Sp |
| \&\fI\s-1VAX\s0 Options\fR |
| \&\fB\-mg \-mgnu \-munix\fR |
| .Sp |
| \&\fI\s-1VMS\s0 Options\fR |
| \&\fB\-mvms\-return\-codes \-mdebug\-main=\fR\fIprefix\fR \fB\-mmalloc64 |
| \&\-mpointer\-size=\fR\fIsize\fR |
| .Sp |
| \&\fIVxWorks Options\fR |
| \&\fB\-mrtp \-non\-static \-Bstatic \-Bdynamic |
| \&\-Xbind\-lazy \-Xbind\-now\fR |
| .Sp |
| \&\fIx86\-64 Options\fR |
| See i386 and x86\-64 Options. |
| .Sp |
| \&\fIXstormy16 Options\fR |
| \&\fB\-msim\fR |
| .Sp |
| \&\fIXtensa Options\fR |
| \&\fB\-mconst16 \-mno\-const16 |
| \&\-mfused\-madd \-mno\-fused\-madd |
| \&\-mforce\-no\-pic |
| \&\-mserialize\-volatile \-mno\-serialize\-volatile |
| \&\-mtext\-section\-literals \-mno\-text\-section\-literals |
| \&\-mtarget\-align \-mno\-target\-align |
| \&\-mlongcalls \-mno\-longcalls\fR |
| .Sp |
| \&\fIzSeries Options\fR |
| See S/390 and zSeries Options. |
| .IP "\fICode Generation Options\fR" 4 |
| .IX Item "Code Generation Options" |
| \&\fB\-fcall\-saved\-\fR\fIreg\fR \fB\-fcall\-used\-\fR\fIreg\fR |
| \&\fB\-ffixed\-\fR\fIreg\fR \fB\-fexceptions |
| \&\-fnon\-call\-exceptions \-fdelete\-dead\-exceptions \-funwind\-tables |
| \&\-fasynchronous\-unwind\-tables |
| \&\-fno\-gnu\-unique |
| \&\-finhibit\-size\-directive \-finstrument\-functions |
| \&\-finstrument\-functions\-exclude\-function\-list=\fR\fIsym\fR\fB,\fR\fIsym\fR\fB,... |
| \&\-finstrument\-functions\-exclude\-file\-list=\fR\fIfile\fR\fB,\fR\fIfile\fR\fB,... |
| \&\-fno\-common \-fno\-ident |
| \&\-fpcc\-struct\-return \-fpic \-fPIC \-fpie \-fPIE |
| \&\-fno\-jump\-tables |
| \&\-frecord\-gcc\-switches |
| \&\-freg\-struct\-return \-fshort\-enums |
| \&\-fshort\-double \-fshort\-wchar |
| \&\-fverbose\-asm \-fpack\-struct[=\fR\fIn\fR\fB] \-fstack\-check |
| \&\-fstack\-limit\-register=\fR\fIreg\fR \fB\-fstack\-limit\-symbol=\fR\fIsym\fR |
| \&\fB\-fno\-stack\-limit \-fsplit\-stack |
| \&\-fleading\-underscore \-ftls\-model=\fR\fImodel\fR |
| \&\fB\-fstack\-reuse=\fR\fIreuse_level\fR |
| \&\fB\-ftrapv \-fwrapv \-fbounds\-check |
| \&\-fvisibility \-fstrict\-volatile\-bitfields \-fsync\-libcalls\fR |
| .SS "Options Controlling the Kind of Output" |
| .IX Subsection "Options Controlling the Kind of Output" |
| Compilation can involve up to four stages: preprocessing, compilation |
| proper, assembly and linking, always in that order. \s-1GCC\s0 is capable of |
| preprocessing and compiling several files either into several |
| assembler input files, or into one assembler input file; then each |
| assembler input file produces an object file, and linking combines all |
| the object files (those newly compiled, and those specified as input) |
| into an executable file. |
| .PP |
| For any given input file, the file name suffix determines what kind of |
| compilation is done: |
| .IP "\fIfile\fR\fB.c\fR" 4 |
| .IX Item "file.c" |
| C source code that must be preprocessed. |
| .IP "\fIfile\fR\fB.i\fR" 4 |
| .IX Item "file.i" |
| C source code that should not be preprocessed. |
| .IP "\fIfile\fR\fB.ii\fR" 4 |
| .IX Item "file.ii" |
| \&\*(C+ source code that should not be preprocessed. |
| .IP "\fIfile\fR\fB.m\fR" 4 |
| .IX Item "file.m" |
| Objective-C source code. Note that you must link with the \fIlibobjc\fR |
| library to make an Objective-C program work. |
| .IP "\fIfile\fR\fB.mi\fR" 4 |
| .IX Item "file.mi" |
| Objective-C source code that should not be preprocessed. |
| .IP "\fIfile\fR\fB.mm\fR" 4 |
| .IX Item "file.mm" |
| .PD 0 |
| .IP "\fIfile\fR\fB.M\fR" 4 |
| .IX Item "file.M" |
| .PD |
| Objective\-\*(C+ source code. Note that you must link with the \fIlibobjc\fR |
| library to make an Objective\-\*(C+ program work. Note that \fB.M\fR refers |
| to a literal capital M. |
| .IP "\fIfile\fR\fB.mii\fR" 4 |
| .IX Item "file.mii" |
| Objective\-\*(C+ source code that should not be preprocessed. |
| .IP "\fIfile\fR\fB.h\fR" 4 |
| .IX Item "file.h" |
| C, \*(C+, Objective-C or Objective\-\*(C+ header file to be turned into a |
| precompiled header (default), or C, \*(C+ header file to be turned into an |
| Ada spec (via the \fB\-fdump\-ada\-spec\fR switch). |
| .IP "\fIfile\fR\fB.cc\fR" 4 |
| .IX Item "file.cc" |
| .PD 0 |
| .IP "\fIfile\fR\fB.cp\fR" 4 |
| .IX Item "file.cp" |
| .IP "\fIfile\fR\fB.cxx\fR" 4 |
| .IX Item "file.cxx" |
| .IP "\fIfile\fR\fB.cpp\fR" 4 |
| .IX Item "file.cpp" |
| .IP "\fIfile\fR\fB.CPP\fR" 4 |
| .IX Item "file.CPP" |
| .IP "\fIfile\fR\fB.c++\fR" 4 |
| .IX Item "file.c++" |
| .IP "\fIfile\fR\fB.C\fR" 4 |
| .IX Item "file.C" |
| .PD |
| \&\*(C+ source code that must be preprocessed. Note that in \fB.cxx\fR, |
| the last two letters must both be literally \fBx\fR. Likewise, |
| \&\fB.C\fR refers to a literal capital C. |
| .IP "\fIfile\fR\fB.mm\fR" 4 |
| .IX Item "file.mm" |
| .PD 0 |
| .IP "\fIfile\fR\fB.M\fR" 4 |
| .IX Item "file.M" |
| .PD |
| Objective\-\*(C+ source code that must be preprocessed. |
| .IP "\fIfile\fR\fB.mii\fR" 4 |
| .IX Item "file.mii" |
| Objective\-\*(C+ source code that should not be preprocessed. |
| .IP "\fIfile\fR\fB.hh\fR" 4 |
| .IX Item "file.hh" |
| .PD 0 |
| .IP "\fIfile\fR\fB.H\fR" 4 |
| .IX Item "file.H" |
| .IP "\fIfile\fR\fB.hp\fR" 4 |
| .IX Item "file.hp" |
| .IP "\fIfile\fR\fB.hxx\fR" 4 |
| .IX Item "file.hxx" |
| .IP "\fIfile\fR\fB.hpp\fR" 4 |
| .IX Item "file.hpp" |
| .IP "\fIfile\fR\fB.HPP\fR" 4 |
| .IX Item "file.HPP" |
| .IP "\fIfile\fR\fB.h++\fR" 4 |
| .IX Item "file.h++" |
| .IP "\fIfile\fR\fB.tcc\fR" 4 |
| .IX Item "file.tcc" |
| .PD |
| \&\*(C+ header file to be turned into a precompiled header or Ada spec. |
| .IP "\fIfile\fR\fB.f\fR" 4 |
| .IX Item "file.f" |
| .PD 0 |
| .IP "\fIfile\fR\fB.for\fR" 4 |
| .IX Item "file.for" |
| .IP "\fIfile\fR\fB.ftn\fR" 4 |
| .IX Item "file.ftn" |
| .PD |
| Fixed form Fortran source code that should not be preprocessed. |
| .IP "\fIfile\fR\fB.F\fR" 4 |
| .IX Item "file.F" |
| .PD 0 |
| .IP "\fIfile\fR\fB.FOR\fR" 4 |
| .IX Item "file.FOR" |
| .IP "\fIfile\fR\fB.fpp\fR" 4 |
| .IX Item "file.fpp" |
| .IP "\fIfile\fR\fB.FPP\fR" 4 |
| .IX Item "file.FPP" |
| .IP "\fIfile\fR\fB.FTN\fR" 4 |
| .IX Item "file.FTN" |
| .PD |
| Fixed form Fortran source code that must be preprocessed (with the traditional |
| preprocessor). |
| .IP "\fIfile\fR\fB.f90\fR" 4 |
| .IX Item "file.f90" |
| .PD 0 |
| .IP "\fIfile\fR\fB.f95\fR" 4 |
| .IX Item "file.f95" |
| .IP "\fIfile\fR\fB.f03\fR" 4 |
| .IX Item "file.f03" |
| .IP "\fIfile\fR\fB.f08\fR" 4 |
| .IX Item "file.f08" |
| .PD |
| Free form Fortran source code that should not be preprocessed. |
| .IP "\fIfile\fR\fB.F90\fR" 4 |
| .IX Item "file.F90" |
| .PD 0 |
| .IP "\fIfile\fR\fB.F95\fR" 4 |
| .IX Item "file.F95" |
| .IP "\fIfile\fR\fB.F03\fR" 4 |
| .IX Item "file.F03" |
| .IP "\fIfile\fR\fB.F08\fR" 4 |
| .IX Item "file.F08" |
| .PD |
| Free form Fortran source code that must be preprocessed (with the |
| traditional preprocessor). |
| .IP "\fIfile\fR\fB.go\fR" 4 |
| .IX Item "file.go" |
| Go source code. |
| .IP "\fIfile\fR\fB.ads\fR" 4 |
| .IX Item "file.ads" |
| Ada source code file that contains a library unit declaration (a |
| declaration of a package, subprogram, or generic, or a generic |
| instantiation), or a library unit renaming declaration (a package, |
| generic, or subprogram renaming declaration). Such files are also |
| called \fIspecs\fR. |
| .IP "\fIfile\fR\fB.adb\fR" 4 |
| .IX Item "file.adb" |
| Ada source code file containing a library unit body (a subprogram or |
| package body). Such files are also called \fIbodies\fR. |
| .IP "\fIfile\fR\fB.s\fR" 4 |
| .IX Item "file.s" |
| Assembler code. |
| .IP "\fIfile\fR\fB.S\fR" 4 |
| .IX Item "file.S" |
| .PD 0 |
| .IP "\fIfile\fR\fB.sx\fR" 4 |
| .IX Item "file.sx" |
| .PD |
| Assembler code that must be preprocessed. |
| .IP "\fIother\fR" 4 |
| .IX Item "other" |
| An object file to be fed straight into linking. |
| Any file name with no recognized suffix is treated this way. |
| .PP |
| You can specify the input language explicitly with the \fB\-x\fR option: |
| .IP "\fB\-x\fR \fIlanguage\fR" 4 |
| .IX Item "-x language" |
| Specify explicitly the \fIlanguage\fR for the following input files |
| (rather than letting the compiler choose a default based on the file |
| name suffix). This option applies to all following input files until |
| the next \fB\-x\fR option. Possible values for \fIlanguage\fR are: |
| .Sp |
| .Vb 9 |
| \& c c\-header cpp\-output |
| \& c++ c++\-header c++\-cpp\-output |
| \& objective\-c objective\-c\-header objective\-c\-cpp\-output |
| \& objective\-c++ objective\-c++\-header objective\-c++\-cpp\-output |
| \& assembler assembler\-with\-cpp |
| \& ada |
| \& f77 f77\-cpp\-input f95 f95\-cpp\-input |
| \& go |
| \& java |
| .Ve |
| .IP "\fB\-x none\fR" 4 |
| .IX Item "-x none" |
| Turn off any specification of a language, so that subsequent files are |
| handled according to their file name suffixes (as they are if \fB\-x\fR |
| has not been used at all). |
| .IP "\fB\-pass\-exit\-codes\fR" 4 |
| .IX Item "-pass-exit-codes" |
| Normally the \fBgcc\fR program exits with the code of 1 if any |
| phase of the compiler returns a non-success return code. If you specify |
| \&\fB\-pass\-exit\-codes\fR, the \fBgcc\fR program instead returns with |
| the numerically highest error produced by any phase returning an error |
| indication. The C, \*(C+, and Fortran front ends return 4 if an internal |
| compiler error is encountered. |
| .PP |
| If you only want some of the stages of compilation, you can use |
| \&\fB\-x\fR (or filename suffixes) to tell \fBgcc\fR where to start, and |
| one of the options \fB\-c\fR, \fB\-S\fR, or \fB\-E\fR to say where |
| \&\fBgcc\fR is to stop. Note that some combinations (for example, |
| \&\fB\-x cpp-output \-E\fR) instruct \fBgcc\fR to do nothing at all. |
| .IP "\fB\-c\fR" 4 |
| .IX Item "-c" |
| Compile or assemble the source files, but do not link. The linking |
| stage simply is not done. The ultimate output is in the form of an |
| object file for each source file. |
| .Sp |
| By default, the object file name for a source file is made by replacing |
| the suffix \fB.c\fR, \fB.i\fR, \fB.s\fR, etc., with \fB.o\fR. |
| .Sp |
| Unrecognized input files, not requiring compilation or assembly, are |
| ignored. |
| .IP "\fB\-S\fR" 4 |
| .IX Item "-S" |
| Stop after the stage of compilation proper; do not assemble. The output |
| is in the form of an assembler code file for each non-assembler input |
| file specified. |
| .Sp |
| By default, the assembler file name for a source file is made by |
| replacing the suffix \fB.c\fR, \fB.i\fR, etc., with \fB.s\fR. |
| .Sp |
| Input files that don't require compilation are ignored. |
| .IP "\fB\-E\fR" 4 |
| .IX Item "-E" |
| Stop after the preprocessing stage; do not run the compiler proper. The |
| output is in the form of preprocessed source code, which is sent to the |
| standard output. |
| .Sp |
| Input files that don't require preprocessing are ignored. |
| .IP "\fB\-o\fR \fIfile\fR" 4 |
| .IX Item "-o file" |
| Place output in file \fIfile\fR. This applies to whatever |
| sort of output is being produced, whether it be an executable file, |
| an object file, an assembler file or preprocessed C code. |
| .Sp |
| If \fB\-o\fR is not specified, the default is to put an executable |
| file in \fIa.out\fR, the object file for |
| \&\fI\fIsource\fI.\fIsuffix\fI\fR in \fI\fIsource\fI.o\fR, its |
| assembler file in \fI\fIsource\fI.s\fR, a precompiled header file in |
| \&\fI\fIsource\fI.\fIsuffix\fI.gch\fR, and all preprocessed C source on |
| standard output. |
| .IP "\fB\-v\fR" 4 |
| .IX Item "-v" |
| Print (on standard error output) the commands executed to run the stages |
| of compilation. Also print the version number of the compiler driver |
| program and of the preprocessor and the compiler proper. |
| .IP "\fB\-###\fR" 4 |
| .IX Item "-###" |
| Like \fB\-v\fR except the commands are not executed and arguments |
| are quoted unless they contain only alphanumeric characters or \f(CW\*(C`./\-_\*(C'\fR. |
| This is useful for shell scripts to capture the driver-generated command lines. |
| .IP "\fB\-pipe\fR" 4 |
| .IX Item "-pipe" |
| Use pipes rather than temporary files for communication between the |
| various stages of compilation. This fails to work on some systems where |
| the assembler is unable to read from a pipe; but the \s-1GNU\s0 assembler has |
| no trouble. |
| .IP "\fB\-\-help\fR" 4 |
| .IX Item "--help" |
| Print (on the standard output) a description of the command-line options |
| understood by \fBgcc\fR. If the \fB\-v\fR option is also specified |
| then \fB\-\-help\fR is also passed on to the various processes |
| invoked by \fBgcc\fR, so that they can display the command-line options |
| they accept. If the \fB\-Wextra\fR option has also been specified |
| (prior to the \fB\-\-help\fR option), then command-line options that |
| have no documentation associated with them are also displayed. |
| .IP "\fB\-\-target\-help\fR" 4 |
| .IX Item "--target-help" |
| Print (on the standard output) a description of target-specific command-line |
| options for each tool. For some targets extra target-specific |
| information may also be printed. |
| .IP "\fB\-\-help={\fR\fIclass\fR|[\fB^\fR]\fIqualifier\fR\fB}\fR[\fB,...\fR]" 4 |
| .IX Item "--help={class|[^]qualifier}[,...]" |
| Print (on the standard output) a description of the command-line |
| options understood by the compiler that fit into all specified classes |
| and qualifiers. These are the supported classes: |
| .RS 4 |
| .IP "\fBoptimizers\fR" 4 |
| .IX Item "optimizers" |
| Display all of the optimization options supported by the |
| compiler. |
| .IP "\fBwarnings\fR" 4 |
| .IX Item "warnings" |
| Display all of the options controlling warning messages |
| produced by the compiler. |
| .IP "\fBtarget\fR" 4 |
| .IX Item "target" |
| Display target-specific options. Unlike the |
| \&\fB\-\-target\-help\fR option however, target-specific options of the |
| linker and assembler are not displayed. This is because those |
| tools do not currently support the extended \fB\-\-help=\fR syntax. |
| .IP "\fBparams\fR" 4 |
| .IX Item "params" |
| Display the values recognized by the \fB\-\-param\fR |
| option. |
| .IP "\fIlanguage\fR" 4 |
| .IX Item "language" |
| Display the options supported for \fIlanguage\fR, where |
| \&\fIlanguage\fR is the name of one of the languages supported in this |
| version of \s-1GCC.\s0 |
| .IP "\fBcommon\fR" 4 |
| .IX Item "common" |
| Display the options that are common to all languages. |
| .RE |
| .RS 4 |
| .Sp |
| These are the supported qualifiers: |
| .IP "\fBundocumented\fR" 4 |
| .IX Item "undocumented" |
| Display only those options that are undocumented. |
| .IP "\fBjoined\fR" 4 |
| .IX Item "joined" |
| Display options taking an argument that appears after an equal |
| sign in the same continuous piece of text, such as: |
| \&\fB\-\-help=target\fR. |
| .IP "\fBseparate\fR" 4 |
| .IX Item "separate" |
| Display options taking an argument that appears as a separate word |
| following the original option, such as: \fB\-o output-file\fR. |
| .RE |
| .RS 4 |
| .Sp |
| Thus for example to display all the undocumented target-specific |
| switches supported by the compiler, use: |
| .Sp |
| .Vb 1 |
| \& \-\-help=target,undocumented |
| .Ve |
| .Sp |
| The sense of a qualifier can be inverted by prefixing it with the |
| \&\fB^\fR character, so for example to display all binary warning |
| options (i.e., ones that are either on or off and that do not take an |
| argument) that have a description, use: |
| .Sp |
| .Vb 1 |
| \& \-\-help=warnings,^joined,^undocumented |
| .Ve |
| .Sp |
| The argument to \fB\-\-help=\fR should not consist solely of inverted |
| qualifiers. |
| .Sp |
| Combining several classes is possible, although this usually |
| restricts the output so much that there is nothing to display. One |
| case where it does work, however, is when one of the classes is |
| \&\fItarget\fR. For example, to display all the target-specific |
| optimization options, use: |
| .Sp |
| .Vb 1 |
| \& \-\-help=target,optimizers |
| .Ve |
| .Sp |
| The \fB\-\-help=\fR option can be repeated on the command line. Each |
| successive use displays its requested class of options, skipping |
| those that have already been displayed. |
| .Sp |
| If the \fB\-Q\fR option appears on the command line before the |
| \&\fB\-\-help=\fR option, then the descriptive text displayed by |
| \&\fB\-\-help=\fR is changed. Instead of describing the displayed |
| options, an indication is given as to whether the option is enabled, |
| disabled or set to a specific value (assuming that the compiler |
| knows this at the point where the \fB\-\-help=\fR option is used). |
| .Sp |
| Here is a truncated example from the \s-1ARM\s0 port of \fBgcc\fR: |
| .Sp |
| .Vb 5 |
| \& % gcc \-Q \-mabi=2 \-\-help=target \-c |
| \& The following options are target specific: |
| \& \-mabi= 2 |
| \& \-mabort\-on\-noreturn [disabled] |
| \& \-mapcs [disabled] |
| .Ve |
| .Sp |
| The output is sensitive to the effects of previous command-line |
| options, so for example it is possible to find out which optimizations |
| are enabled at \fB\-O2\fR by using: |
| .Sp |
| .Vb 1 |
| \& \-Q \-O2 \-\-help=optimizers |
| .Ve |
| .Sp |
| Alternatively you can discover which binary optimizations are enabled |
| by \fB\-O3\fR by using: |
| .Sp |
| .Vb 3 |
| \& gcc \-c \-Q \-O3 \-\-help=optimizers > /tmp/O3\-opts |
| \& gcc \-c \-Q \-O2 \-\-help=optimizers > /tmp/O2\-opts |
| \& diff /tmp/O2\-opts /tmp/O3\-opts | grep enabled |
| .Ve |
| .RE |
| .IP "\fB\-no\-canonical\-prefixes\fR" 4 |
| .IX Item "-no-canonical-prefixes" |
| Do not expand any symbolic links, resolve references to \fB/../\fR |
| or \fB/./\fR, or make the path absolute when generating a relative |
| prefix. |
| .IP "\fB\-\-version\fR" 4 |
| .IX Item "--version" |
| Display the version number and copyrights of the invoked \s-1GCC.\s0 |
| .IP "\fB\-wrapper\fR" 4 |
| .IX Item "-wrapper" |
| Invoke all subcommands under a wrapper program. The name of the |
| wrapper program and its parameters are passed as a comma separated |
| list. |
| .Sp |
| .Vb 1 |
| \& gcc \-c t.c \-wrapper gdb,\-\-args |
| .Ve |
| .Sp |
| This invokes all subprograms of \fBgcc\fR under |
| \&\fBgdb \-\-args\fR, thus the invocation of \fBcc1\fR is |
| \&\fBgdb \-\-args cc1 ...\fR. |
| .IP "\fB\-fplugin=\fR\fIname\fR\fB.so\fR" 4 |
| .IX Item "-fplugin=name.so" |
| Load the plugin code in file \fIname\fR.so, assumed to be a |
| shared object to be dlopen'd by the compiler. The base name of |
| the shared object file is used to identify the plugin for the |
| purposes of argument parsing (See |
| \&\fB\-fplugin\-arg\-\fR\fIname\fR\fB\-\fR\fIkey\fR\fB=\fR\fIvalue\fR below). |
| Each plugin should define the callback functions specified in the |
| Plugins \s-1API.\s0 |
| .IP "\fB\-fplugin\-arg\-\fR\fIname\fR\fB\-\fR\fIkey\fR\fB=\fR\fIvalue\fR" 4 |
| .IX Item "-fplugin-arg-name-key=value" |
| Define an argument called \fIkey\fR with a value of \fIvalue\fR |
| for the plugin called \fIname\fR. |
| .IP "\fB\-fdump\-ada\-spec\fR[\fB\-slim\fR]" 4 |
| .IX Item "-fdump-ada-spec[-slim]" |
| For C and \*(C+ source and include files, generate corresponding Ada specs. |
| .IP "\fB\-fada\-spec\-parent=\fR\fIunit\fR" 4 |
| .IX Item "-fada-spec-parent=unit" |
| In conjunction with \fB\-fdump\-ada\-spec\fR[\fB\-slim\fR] above, generate |
| Ada specs as child units of parent \fIunit\fR. |
| .IP "\fB\-fdump\-go\-spec=\fR\fIfile\fR" 4 |
| .IX Item "-fdump-go-spec=file" |
| For input files in any language, generate corresponding Go |
| declarations in \fIfile\fR. This generates Go \f(CW\*(C`const\*(C'\fR, |
| \&\f(CW\*(C`type\*(C'\fR, \f(CW\*(C`var\*(C'\fR, and \f(CW\*(C`func\*(C'\fR declarations which may be a |
| useful way to start writing a Go interface to code written in some |
| other language. |
| .IP "\fB@\fR\fIfile\fR" 4 |
| .IX Item "@file" |
| Read command-line options from \fIfile\fR. The options read are |
| inserted in place of the original @\fIfile\fR option. If \fIfile\fR |
| does not exist, or cannot be read, then the option will be treated |
| literally, and not removed. |
| .Sp |
| Options in \fIfile\fR are separated by whitespace. A whitespace |
| character may be included in an option by surrounding the entire |
| option in either single or double quotes. Any character (including a |
| backslash) may be included by prefixing the character to be included |
| with a backslash. The \fIfile\fR may itself contain additional |
| @\fIfile\fR options; any such options will be processed recursively. |
| .SS "Compiling \*(C+ Programs" |
| .IX Subsection "Compiling Programs" |
| \&\*(C+ source files conventionally use one of the suffixes \fB.C\fR, |
| \&\fB.cc\fR, \fB.cpp\fR, \fB.CPP\fR, \fB.c++\fR, \fB.cp\fR, or |
| \&\fB.cxx\fR; \*(C+ header files often use \fB.hh\fR, \fB.hpp\fR, |
| \&\fB.H\fR, or (for shared template code) \fB.tcc\fR; and |
| preprocessed \*(C+ files use the suffix \fB.ii\fR. \s-1GCC\s0 recognizes |
| files with these names and compiles them as \*(C+ programs even if you |
| call the compiler the same way as for compiling C programs (usually |
| with the name \fBgcc\fR). |
| .PP |
| However, the use of \fBgcc\fR does not add the \*(C+ library. |
| \&\fBg++\fR is a program that calls \s-1GCC\s0 and automatically specifies linking |
| against the \*(C+ library. It treats \fB.c\fR, |
| \&\fB.h\fR and \fB.i\fR files as \*(C+ source files instead of C source |
| files unless \fB\-x\fR is used. This program is also useful when |
| precompiling a C header file with a \fB.h\fR extension for use in \*(C+ |
| compilations. On many systems, \fBg++\fR is also installed with |
| the name \fBc++\fR. |
| .PP |
| When you compile \*(C+ programs, you may specify many of the same |
| command-line options that you use for compiling programs in any |
| language; or command-line options meaningful for C and related |
| languages; or options that are meaningful only for \*(C+ programs. |
| .SS "Options Controlling C Dialect" |
| .IX Subsection "Options Controlling C Dialect" |
| The following options control the dialect of C (or languages derived |
| from C, such as \*(C+, Objective-C and Objective\-\*(C+) that the compiler |
| accepts: |
| .IP "\fB\-ansi\fR" 4 |
| .IX Item "-ansi" |
| In C mode, this is equivalent to \fB\-std=c90\fR. In \*(C+ mode, it is |
| equivalent to \fB\-std=c++98\fR. |
| .Sp |
| This turns off certain features of \s-1GCC\s0 that are incompatible with \s-1ISO |
| C90 \s0(when compiling C code), or of standard \*(C+ (when compiling \*(C+ code), |
| such as the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, and |
| predefined macros such as \f(CW\*(C`unix\*(C'\fR and \f(CW\*(C`vax\*(C'\fR that identify the |
| type of system you are using. It also enables the undesirable and |
| rarely used \s-1ISO\s0 trigraph feature. For the C compiler, |
| it disables recognition of \*(C+ style \fB//\fR comments as well as |
| the \f(CW\*(C`inline\*(C'\fR keyword. |
| .Sp |
| The alternate keywords \f(CW\*(C`_\|_asm_\|_\*(C'\fR, \f(CW\*(C`_\|_extension_\|_\*(C'\fR, |
| \&\f(CW\*(C`_\|_inline_\|_\*(C'\fR and \f(CW\*(C`_\|_typeof_\|_\*(C'\fR continue to work despite |
| \&\fB\-ansi\fR. You would not want to use them in an \s-1ISO C\s0 program, of |
| course, but it is useful to put them in header files that might be included |
| in compilations done with \fB\-ansi\fR. Alternate predefined macros |
| such as \f(CW\*(C`_\|_unix_\|_\*(C'\fR and \f(CW\*(C`_\|_vax_\|_\*(C'\fR are also available, with or |
| without \fB\-ansi\fR. |
| .Sp |
| The \fB\-ansi\fR option does not cause non-ISO programs to be |
| rejected gratuitously. For that, \fB\-Wpedantic\fR is required in |
| addition to \fB\-ansi\fR. |
| .Sp |
| The macro \f(CW\*(C`_\|_STRICT_ANSI_\|_\*(C'\fR is predefined when the \fB\-ansi\fR |
| option is used. Some header files may notice this macro and refrain |
| from declaring certain functions or defining certain macros that the |
| \&\s-1ISO\s0 standard doesn't call for; this is to avoid interfering with any |
| programs that might use these names for other things. |
| .Sp |
| Functions that are normally built in but do not have semantics |
| defined by \s-1ISO C \s0(such as \f(CW\*(C`alloca\*(C'\fR and \f(CW\*(C`ffs\*(C'\fR) are not built-in |
| functions when \fB\-ansi\fR is used. |
| .IP "\fB\-std=\fR" 4 |
| .IX Item "-std=" |
| Determine the language standard. This option |
| is currently only supported when compiling C or \*(C+. |
| .Sp |
| The compiler can accept several base standards, such as \fBc90\fR or |
| \&\fBc++98\fR, and \s-1GNU\s0 dialects of those standards, such as |
| \&\fBgnu90\fR or \fBgnu++98\fR. When a base standard is specified, the |
| compiler accepts all programs following that standard plus those |
| using \s-1GNU\s0 extensions that do not contradict it. For example, |
| \&\fB\-std=c90\fR turns off certain features of \s-1GCC\s0 that are |
| incompatible with \s-1ISO C90,\s0 such as the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR |
| keywords, but not other \s-1GNU\s0 extensions that do not have a meaning in |
| \&\s-1ISO C90,\s0 such as omitting the middle term of a \f(CW\*(C`?:\*(C'\fR |
| expression. On the other hand, when a \s-1GNU\s0 dialect of a standard is |
| specified, all features supported by the compiler are enabled, even when |
| those features change the meaning of the base standard. As a result, some |
| strict-conforming programs may be rejected. The particular standard |
| is used by \fB\-Wpedantic\fR to identify which features are \s-1GNU\s0 |
| extensions given that version of the standard. For example |
| \&\fB\-std=gnu90 \-Wpedantic\fR warns about \*(C+ style \fB//\fR |
| comments, while \fB\-std=gnu99 \-Wpedantic\fR does not. |
| .Sp |
| A value for this option must be provided; possible values are |
| .RS 4 |
| .IP "\fBc90\fR" 4 |
| .IX Item "c90" |
| .PD 0 |
| .IP "\fBc89\fR" 4 |
| .IX Item "c89" |
| .IP "\fBiso9899:1990\fR" 4 |
| .IX Item "iso9899:1990" |
| .PD |
| Support all \s-1ISO C90\s0 programs (certain \s-1GNU\s0 extensions that conflict |
| with \s-1ISO C90\s0 are disabled). Same as \fB\-ansi\fR for C code. |
| .IP "\fBiso9899:199409\fR" 4 |
| .IX Item "iso9899:199409" |
| \&\s-1ISO C90\s0 as modified in amendment 1. |
| .IP "\fBc99\fR" 4 |
| .IX Item "c99" |
| .PD 0 |
| .IP "\fBc9x\fR" 4 |
| .IX Item "c9x" |
| .IP "\fBiso9899:1999\fR" 4 |
| .IX Item "iso9899:1999" |
| .IP "\fBiso9899:199x\fR" 4 |
| .IX Item "iso9899:199x" |
| .PD |
| \&\s-1ISO C99. \s0 This standard is substantially completely supported, modulo |
| bugs, extended identifiers (supported except for corner cases when |
| \&\fB\-fextended\-identifiers\fR is used) and floating-point issues |
| (mainly but not entirely relating to optional C99 features from |
| Annexes F and G). See |
| <\fBhttp://gcc.gnu.org/c99status.html\fR> for more information. The |
| names \fBc9x\fR and \fBiso9899:199x\fR are deprecated. |
| .IP "\fBc11\fR" 4 |
| .IX Item "c11" |
| .PD 0 |
| .IP "\fBc1x\fR" 4 |
| .IX Item "c1x" |
| .IP "\fBiso9899:2011\fR" 4 |
| .IX Item "iso9899:2011" |
| .PD |
| \&\s-1ISO C11,\s0 the 2011 revision of the \s-1ISO C\s0 standard. This standard is |
| substantially completely supported, modulo bugs, extended identifiers |
| (supported except for corner cases when |
| \&\fB\-fextended\-identifiers\fR is used), floating-point issues |
| (mainly but not entirely relating to optional C11 features from |
| Annexes F and G) and the optional Annexes K (Bounds-checking |
| interfaces) and L (Analyzability). The name \fBc1x\fR is deprecated. |
| .IP "\fBgnu90\fR" 4 |
| .IX Item "gnu90" |
| .PD 0 |
| .IP "\fBgnu89\fR" 4 |
| .IX Item "gnu89" |
| .PD |
| \&\s-1GNU\s0 dialect of \s-1ISO C90 \s0(including some C99 features). This |
| is the default for C code. |
| .IP "\fBgnu99\fR" 4 |
| .IX Item "gnu99" |
| .PD 0 |
| .IP "\fBgnu9x\fR" 4 |
| .IX Item "gnu9x" |
| .PD |
| \&\s-1GNU\s0 dialect of \s-1ISO C99. \s0 The name \fBgnu9x\fR is deprecated. |
| .IP "\fBgnu11\fR" 4 |
| .IX Item "gnu11" |
| .PD 0 |
| .IP "\fBgnu1x\fR" 4 |
| .IX Item "gnu1x" |
| .PD |
| \&\s-1GNU\s0 dialect of \s-1ISO C11. \s0 This is intended to become the default in a |
| future release of \s-1GCC. \s0 The name \fBgnu1x\fR is deprecated. |
| .IP "\fBc++98\fR" 4 |
| .IX Item "c++98" |
| .PD 0 |
| .IP "\fBc++03\fR" 4 |
| .IX Item "c++03" |
| .PD |
| The 1998 \s-1ISO \*(C+\s0 standard plus the 2003 technical corrigendum and some |
| additional defect reports. Same as \fB\-ansi\fR for \*(C+ code. |
| .IP "\fBgnu++98\fR" 4 |
| .IX Item "gnu++98" |
| .PD 0 |
| .IP "\fBgnu++03\fR" 4 |
| .IX Item "gnu++03" |
| .PD |
| \&\s-1GNU\s0 dialect of \fB\-std=c++98\fR. This is the default for |
| \&\*(C+ code. |
| .IP "\fBc++11\fR" 4 |
| .IX Item "c++11" |
| .PD 0 |
| .IP "\fBc++0x\fR" 4 |
| .IX Item "c++0x" |
| .PD |
| The 2011 \s-1ISO \*(C+\s0 standard plus amendments. |
| The name \fBc++0x\fR is deprecated. |
| .IP "\fBgnu++11\fR" 4 |
| .IX Item "gnu++11" |
| .PD 0 |
| .IP "\fBgnu++0x\fR" 4 |
| .IX Item "gnu++0x" |
| .PD |
| \&\s-1GNU\s0 dialect of \fB\-std=c++11\fR. |
| The name \fBgnu++0x\fR is deprecated. |
| .IP "\fBc++1y\fR" 4 |
| .IX Item "c++1y" |
| The next revision of the \s-1ISO \*(C+\s0 standard, tentatively planned for |
| 2014. Support is highly experimental, and will almost certainly |
| change in incompatible ways in future releases. |
| .IP "\fBgnu++1y\fR" 4 |
| .IX Item "gnu++1y" |
| \&\s-1GNU\s0 dialect of \fB\-std=c++1y\fR. Support is highly experimental, |
| and will almost certainly change in incompatible ways in future |
| releases. |
| .RE |
| .RS 4 |
| .RE |
| .IP "\fB\-fgnu89\-inline\fR" 4 |
| .IX Item "-fgnu89-inline" |
| The option \fB\-fgnu89\-inline\fR tells \s-1GCC\s0 to use the traditional |
| \&\s-1GNU\s0 semantics for \f(CW\*(C`inline\*(C'\fR functions when in C99 mode. |
| This option |
| is accepted and ignored by \s-1GCC\s0 versions 4.1.3 up to but not including |
| 4.3. In \s-1GCC\s0 versions 4.3 and later it changes the behavior of \s-1GCC\s0 in |
| C99 mode. Using this option is roughly equivalent to adding the |
| \&\f(CW\*(C`gnu_inline\*(C'\fR function attribute to all inline functions. |
| .Sp |
| The option \fB\-fno\-gnu89\-inline\fR explicitly tells \s-1GCC\s0 to use the |
| C99 semantics for \f(CW\*(C`inline\*(C'\fR when in C99 or gnu99 mode (i.e., it |
| specifies the default behavior). This option was first supported in |
| \&\s-1GCC 4.3. \s0 This option is not supported in \fB\-std=c90\fR or |
| \&\fB\-std=gnu90\fR mode. |
| .Sp |
| The preprocessor macros \f(CW\*(C`_\|_GNUC_GNU_INLINE_\|_\*(C'\fR and |
| \&\f(CW\*(C`_\|_GNUC_STDC_INLINE_\|_\*(C'\fR may be used to check which semantics are |
| in effect for \f(CW\*(C`inline\*(C'\fR functions. |
| .IP "\fB\-aux\-info\fR \fIfilename\fR" 4 |
| .IX Item "-aux-info filename" |
| Output to the given filename prototyped declarations for all functions |
| declared and/or defined in a translation unit, including those in header |
| files. This option is silently ignored in any language other than C. |
| .Sp |
| Besides declarations, the file indicates, in comments, the origin of |
| each declaration (source file and line), whether the declaration was |
| implicit, prototyped or unprototyped (\fBI\fR, \fBN\fR for new or |
| \&\fBO\fR for old, respectively, in the first character after the line |
| number and the colon), and whether it came from a declaration or a |
| definition (\fBC\fR or \fBF\fR, respectively, in the following |
| character). In the case of function definitions, a K&R\-style list of |
| arguments followed by their declarations is also provided, inside |
| comments, after the declaration. |
| .IP "\fB\-fallow\-parameterless\-variadic\-functions\fR" 4 |
| .IX Item "-fallow-parameterless-variadic-functions" |
| Accept variadic functions without named parameters. |
| .Sp |
| Although it is possible to define such a function, this is not very |
| useful as it is not possible to read the arguments. This is only |
| supported for C as this construct is allowed by \*(C+. |
| .IP "\fB\-fno\-asm\fR" 4 |
| .IX Item "-fno-asm" |
| Do not recognize \f(CW\*(C`asm\*(C'\fR, \f(CW\*(C`inline\*(C'\fR or \f(CW\*(C`typeof\*(C'\fR as a |
| keyword, so that code can use these words as identifiers. You can use |
| the keywords \f(CW\*(C`_\|_asm_\|_\*(C'\fR, \f(CW\*(C`_\|_inline_\|_\*(C'\fR and \f(CW\*(C`_\|_typeof_\|_\*(C'\fR |
| instead. \fB\-ansi\fR implies \fB\-fno\-asm\fR. |
| .Sp |
| In \*(C+, this switch only affects the \f(CW\*(C`typeof\*(C'\fR keyword, since |
| \&\f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`inline\*(C'\fR are standard keywords. You may want to |
| use the \fB\-fno\-gnu\-keywords\fR flag instead, which has the same |
| effect. In C99 mode (\fB\-std=c99\fR or \fB\-std=gnu99\fR), this |
| switch only affects the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, since |
| \&\f(CW\*(C`inline\*(C'\fR is a standard keyword in \s-1ISO C99.\s0 |
| .IP "\fB\-fno\-builtin\fR" 4 |
| .IX Item "-fno-builtin" |
| .PD 0 |
| .IP "\fB\-fno\-builtin\-\fR\fIfunction\fR" 4 |
| .IX Item "-fno-builtin-function" |
| .PD |
| Don't recognize built-in functions that do not begin with |
| \&\fB_\|_builtin_\fR as prefix. |
| .Sp |
| \&\s-1GCC\s0 normally generates special code to handle certain built-in functions |
| more efficiently; for instance, calls to \f(CW\*(C`alloca\*(C'\fR may become single |
| instructions which adjust the stack directly, and calls to \f(CW\*(C`memcpy\*(C'\fR |
| may become inline copy loops. The resulting code is often both smaller |
| and faster, but since the function calls no longer appear as such, you |
| cannot set a breakpoint on those calls, nor can you change the behavior |
| of the functions by linking with a different library. In addition, |
| when a function is recognized as a built-in function, \s-1GCC\s0 may use |
| information about that function to warn about problems with calls to |
| that function, or to generate more efficient code, even if the |
| resulting code still contains calls to that function. For example, |
| warnings are given with \fB\-Wformat\fR for bad calls to |
| \&\f(CW\*(C`printf\*(C'\fR when \f(CW\*(C`printf\*(C'\fR is built in and \f(CW\*(C`strlen\*(C'\fR is |
| known not to modify global memory. |
| .Sp |
| With the \fB\-fno\-builtin\-\fR\fIfunction\fR option |
| only the built-in function \fIfunction\fR is |
| disabled. \fIfunction\fR must not begin with \fB_\|_builtin_\fR. If a |
| function is named that is not built-in in this version of \s-1GCC,\s0 this |
| option is ignored. There is no corresponding |
| \&\fB\-fbuiltin\-\fR\fIfunction\fR option; if you wish to enable |
| built-in functions selectively when using \fB\-fno\-builtin\fR or |
| \&\fB\-ffreestanding\fR, you may define macros such as: |
| .Sp |
| .Vb 2 |
| \& #define abs(n) _\|_builtin_abs ((n)) |
| \& #define strcpy(d, s) _\|_builtin_strcpy ((d), (s)) |
| .Ve |
| .IP "\fB\-fhosted\fR" 4 |
| .IX Item "-fhosted" |
| Assert that compilation targets a hosted environment. This implies |
| \&\fB\-fbuiltin\fR. A hosted environment is one in which the |
| entire standard library is available, and in which \f(CW\*(C`main\*(C'\fR has a return |
| type of \f(CW\*(C`int\*(C'\fR. Examples are nearly everything except a kernel. |
| This is equivalent to \fB\-fno\-freestanding\fR. |
| .IP "\fB\-ffreestanding\fR" 4 |
| .IX Item "-ffreestanding" |
| Assert that compilation targets a freestanding environment. This |
| implies \fB\-fno\-builtin\fR. A freestanding environment |
| is one in which the standard library may not exist, and program startup may |
| not necessarily be at \f(CW\*(C`main\*(C'\fR. The most obvious example is an \s-1OS\s0 kernel. |
| This is equivalent to \fB\-fno\-hosted\fR. |
| .IP "\fB\-fopenmp\fR" 4 |
| .IX Item "-fopenmp" |
| Enable handling of OpenMP directives \f(CW\*(C`#pragma omp\*(C'\fR in C/\*(C+ and |
| \&\f(CW\*(C`!$omp\*(C'\fR in Fortran. When \fB\-fopenmp\fR is specified, the |
| compiler generates parallel code according to the OpenMP Application |
| Program Interface v4.0 <\fBhttp://www.openmp.org/\fR>. This option |
| implies \fB\-pthread\fR, and thus is only supported on targets that |
| have support for \fB\-pthread\fR. \fB\-fopenmp\fR implies |
| \&\fB\-fopenmp\-simd\fR. |
| .IP "\fB\-fopenmp\-simd\fR" 4 |
| .IX Item "-fopenmp-simd" |
| Enable handling of OpenMP's \s-1SIMD\s0 directives with \f(CW\*(C`#pragma omp\*(C'\fR |
| in C/\*(C+ and \f(CW\*(C`!$omp\*(C'\fR in Fortran. Other OpenMP directives |
| are ignored. |
| .IP "\fB\-fcilkplus\fR" 4 |
| .IX Item "-fcilkplus" |
| Enable the usage of Cilk Plus language extension features for C/\*(C+. |
| When the option \fB\-fcilkplus\fR is specified, enable the usage of |
| the Cilk Plus Language extension features for C/\*(C+. The present |
| implementation follows \s-1ABI\s0 version 1.2. This is an experimental |
| feature that is only partially complete, and whose interface may |
| change in future versions of \s-1GCC\s0 as the official specification |
| changes. Currently, all features but \f(CW\*(C`_Cilk_for\*(C'\fR have been |
| implemented. |
| .IP "\fB\-fgnu\-tm\fR" 4 |
| .IX Item "-fgnu-tm" |
| When the option \fB\-fgnu\-tm\fR is specified, the compiler |
| generates code for the Linux variant of Intel's current Transactional |
| Memory \s-1ABI\s0 specification document (Revision 1.1, May 6 2009). This is |
| an experimental feature whose interface may change in future versions |
| of \s-1GCC,\s0 as the official specification changes. Please note that not |
| all architectures are supported for this feature. |
| .Sp |
| For more information on \s-1GCC\s0's support for transactional memory, |
| .Sp |
| Note that the transactional memory feature is not supported with |
| non-call exceptions (\fB\-fnon\-call\-exceptions\fR). |
| .IP "\fB\-fms\-extensions\fR" 4 |
| .IX Item "-fms-extensions" |
| Accept some non-standard constructs used in Microsoft header files. |
| .Sp |
| In \*(C+ code, this allows member names in structures to be similar |
| to previous types declarations. |
| .Sp |
| .Vb 4 |
| \& typedef int UOW; |
| \& struct ABC { |
| \& UOW UOW; |
| \& }; |
| .Ve |
| .Sp |
| Some cases of unnamed fields in structures and unions are only |
| accepted with this option. |
| .Sp |
| Note that this option is off for all targets but i?86 and x86_64 |
| targets using ms-abi. |
| .IP "\fB\-fplan9\-extensions\fR" 4 |
| .IX Item "-fplan9-extensions" |
| Accept some non-standard constructs used in Plan 9 code. |
| .Sp |
| This enables \fB\-fms\-extensions\fR, permits passing pointers to |
| structures with anonymous fields to functions that expect pointers to |
| elements of the type of the field, and permits referring to anonymous |
| fields declared using a typedef. This is only |
| supported for C, not \*(C+. |
| .IP "\fB\-trigraphs\fR" 4 |
| .IX Item "-trigraphs" |
| Support \s-1ISO C\s0 trigraphs. The \fB\-ansi\fR option (and \fB\-std\fR |
| options for strict \s-1ISO C\s0 conformance) implies \fB\-trigraphs\fR. |
| .IP "\fB\-traditional\fR" 4 |
| .IX Item "-traditional" |
| .PD 0 |
| .IP "\fB\-traditional\-cpp\fR" 4 |
| .IX Item "-traditional-cpp" |
| .PD |
| Formerly, these options caused \s-1GCC\s0 to attempt to emulate a pre-standard |
| C compiler. They are now only supported with the \fB\-E\fR switch. |
| The preprocessor continues to support a pre-standard mode. See the \s-1GNU |
| CPP\s0 manual for details. |
| .IP "\fB\-fcond\-mismatch\fR" 4 |
| .IX Item "-fcond-mismatch" |
| Allow conditional expressions with mismatched types in the second and |
| third arguments. The value of such an expression is void. This option |
| is not supported for \*(C+. |
| .IP "\fB\-flax\-vector\-conversions\fR" 4 |
| .IX Item "-flax-vector-conversions" |
| Allow implicit conversions between vectors with differing numbers of |
| elements and/or incompatible element types. This option should not be |
| used for new code. |
| .IP "\fB\-funsigned\-char\fR" 4 |
| .IX Item "-funsigned-char" |
| Let the type \f(CW\*(C`char\*(C'\fR be unsigned, like \f(CW\*(C`unsigned char\*(C'\fR. |
| .Sp |
| Each kind of machine has a default for what \f(CW\*(C`char\*(C'\fR should |
| be. It is either like \f(CW\*(C`unsigned char\*(C'\fR by default or like |
| \&\f(CW\*(C`signed char\*(C'\fR by default. |
| .Sp |
| Ideally, a portable program should always use \f(CW\*(C`signed char\*(C'\fR or |
| \&\f(CW\*(C`unsigned char\*(C'\fR when it depends on the signedness of an object. |
| But many programs have been written to use plain \f(CW\*(C`char\*(C'\fR and |
| expect it to be signed, or expect it to be unsigned, depending on the |
| machines they were written for. This option, and its inverse, let you |
| make such a program work with the opposite default. |
| .Sp |
| The type \f(CW\*(C`char\*(C'\fR is always a distinct type from each of |
| \&\f(CW\*(C`signed char\*(C'\fR or \f(CW\*(C`unsigned char\*(C'\fR, even though its behavior |
| is always just like one of those two. |
| .IP "\fB\-fsigned\-char\fR" 4 |
| .IX Item "-fsigned-char" |
| Let the type \f(CW\*(C`char\*(C'\fR be signed, like \f(CW\*(C`signed char\*(C'\fR. |
| .Sp |
| Note that this is equivalent to \fB\-fno\-unsigned\-char\fR, which is |
| the negative form of \fB\-funsigned\-char\fR. Likewise, the option |
| \&\fB\-fno\-signed\-char\fR is equivalent to \fB\-funsigned\-char\fR. |
| .IP "\fB\-fsigned\-bitfields\fR" 4 |
| .IX Item "-fsigned-bitfields" |
| .PD 0 |
| .IP "\fB\-funsigned\-bitfields\fR" 4 |
| .IX Item "-funsigned-bitfields" |
| .IP "\fB\-fno\-signed\-bitfields\fR" 4 |
| .IX Item "-fno-signed-bitfields" |
| .IP "\fB\-fno\-unsigned\-bitfields\fR" 4 |
| .IX Item "-fno-unsigned-bitfields" |
| .PD |
| These options control whether a bit-field is signed or unsigned, when the |
| declaration does not use either \f(CW\*(C`signed\*(C'\fR or \f(CW\*(C`unsigned\*(C'\fR. By |
| default, such a bit-field is signed, because this is consistent: the |
| basic integer types such as \f(CW\*(C`int\*(C'\fR are signed types. |
| .SS "Options Controlling \*(C+ Dialect" |
| .IX Subsection "Options Controlling Dialect" |
| This section describes the command-line options that are only meaningful |
| for \*(C+ programs. You can also use most of the \s-1GNU\s0 compiler options |
| regardless of what language your program is in. For example, you |
| might compile a file \f(CW\*(C`firstClass.C\*(C'\fR like this: |
| .PP |
| .Vb 1 |
| \& g++ \-g \-frepo \-O \-c firstClass.C |
| .Ve |
| .PP |
| In this example, only \fB\-frepo\fR is an option meant |
| only for \*(C+ programs; you can use the other options with any |
| language supported by \s-1GCC.\s0 |
| .PP |
| Here is a list of options that are \fIonly\fR for compiling \*(C+ programs: |
| .IP "\fB\-fabi\-version=\fR\fIn\fR" 4 |
| .IX Item "-fabi-version=n" |
| Use version \fIn\fR of the \*(C+ \s-1ABI. \s0 The default is version 2. |
| .Sp |
| Version 0 refers to the version conforming most closely to |
| the \*(C+ \s-1ABI\s0 specification. Therefore, the \s-1ABI\s0 obtained using version 0 |
| will change in different versions of G++ as \s-1ABI\s0 bugs are fixed. |
| .Sp |
| Version 1 is the version of the \*(C+ \s-1ABI\s0 that first appeared in G++ 3.2. |
| .Sp |
| Version 2 is the version of the \*(C+ \s-1ABI\s0 that first appeared in G++ 3.4. |
| .Sp |
| Version 3 corrects an error in mangling a constant address as a |
| template argument. |
| .Sp |
| Version 4, which first appeared in G++ 4.5, implements a standard |
| mangling for vector types. |
| .Sp |
| Version 5, which first appeared in G++ 4.6, corrects the mangling of |
| attribute const/volatile on function pointer types, decltype of a |
| plain decl, and use of a function parameter in the declaration of |
| another parameter. |
| .Sp |
| Version 6, which first appeared in G++ 4.7, corrects the promotion |
| behavior of \*(C+11 scoped enums and the mangling of template argument |
| packs, const/static_cast, prefix ++ and \-\-, and a class scope function |
| used as a template argument. |
| .Sp |
| See also \fB\-Wabi\fR. |
| .IP "\fB\-fno\-access\-control\fR" 4 |
| .IX Item "-fno-access-control" |
| Turn off all access checking. This switch is mainly useful for working |
| around bugs in the access control code. |
| .IP "\fB\-fcheck\-new\fR" 4 |
| .IX Item "-fcheck-new" |
| Check that the pointer returned by \f(CW\*(C`operator new\*(C'\fR is non-null |
| before attempting to modify the storage allocated. This check is |
| normally unnecessary because the \*(C+ standard specifies that |
| \&\f(CW\*(C`operator new\*(C'\fR only returns \f(CW0\fR if it is declared |
| \&\fB\f(BIthrow()\fB\fR, in which case the compiler always checks the |
| return value even without this option. In all other cases, when |
| \&\f(CW\*(C`operator new\*(C'\fR has a non-empty exception specification, memory |
| exhaustion is signalled by throwing \f(CW\*(C`std::bad_alloc\*(C'\fR. See also |
| \&\fBnew (nothrow)\fR. |
| .IP "\fB\-fconstexpr\-depth=\fR\fIn\fR" 4 |
| .IX Item "-fconstexpr-depth=n" |
| Set the maximum nested evaluation depth for \*(C+11 constexpr functions |
| to \fIn\fR. A limit is needed to detect endless recursion during |
| constant expression evaluation. The minimum specified by the standard |
| is 512. |
| .IP "\fB\-fdeduce\-init\-list\fR" 4 |
| .IX Item "-fdeduce-init-list" |
| Enable deduction of a template type parameter as |
| \&\f(CW\*(C`std::initializer_list\*(C'\fR from a brace-enclosed initializer list, i.e. |
| .Sp |
| .Vb 4 |
| \& template <class T> auto forward(T t) \-> decltype (realfn (t)) |
| \& { |
| \& return realfn (t); |
| \& } |
| \& |
| \& void f() |
| \& { |
| \& forward({1,2}); // call forward<std::initializer_list<int>> |
| \& } |
| .Ve |
| .Sp |
| This deduction was implemented as a possible extension to the |
| originally proposed semantics for the \*(C+11 standard, but was not part |
| of the final standard, so it is disabled by default. This option is |
| deprecated, and may be removed in a future version of G++. |
| .IP "\fB\-ffriend\-injection\fR" 4 |
| .IX Item "-ffriend-injection" |
| Inject friend functions into the enclosing namespace, so that they are |
| visible outside the scope of the class in which they are declared. |
| Friend functions were documented to work this way in the old Annotated |
| \&\*(C+ Reference Manual, and versions of G++ before 4.1 always worked |
| that way. However, in \s-1ISO \*(C+\s0 a friend function that is not declared |
| in an enclosing scope can only be found using argument dependent |
| lookup. This option causes friends to be injected as they were in |
| earlier releases. |
| .Sp |
| This option is for compatibility, and may be removed in a future |
| release of G++. |
| .IP "\fB\-fno\-elide\-constructors\fR" 4 |
| .IX Item "-fno-elide-constructors" |
| The \*(C+ standard allows an implementation to omit creating a temporary |
| that is only used to initialize another object of the same type. |
| Specifying this option disables that optimization, and forces G++ to |
| call the copy constructor in all cases. |
| .IP "\fB\-fno\-enforce\-eh\-specs\fR" 4 |
| .IX Item "-fno-enforce-eh-specs" |
| Don't generate code to check for violation of exception specifications |
| at run time. This option violates the \*(C+ standard, but may be useful |
| for reducing code size in production builds, much like defining |
| \&\fB\s-1NDEBUG\s0\fR. This does not give user code permission to throw |
| exceptions in violation of the exception specifications; the compiler |
| still optimizes based on the specifications, so throwing an |
| unexpected exception results in undefined behavior at run time. |
| .IP "\fB\-fextern\-tls\-init\fR" 4 |
| .IX Item "-fextern-tls-init" |
| .PD 0 |
| .IP "\fB\-fno\-extern\-tls\-init\fR" 4 |
| .IX Item "-fno-extern-tls-init" |
| .PD |
| The \*(C+11 and OpenMP standards allow \fBthread_local\fR and |
| \&\fBthreadprivate\fR variables to have dynamic (runtime) |
| initialization. To support this, any use of such a variable goes |
| through a wrapper function that performs any necessary initialization. |
| When the use and definition of the variable are in the same |
| translation unit, this overhead can be optimized away, but when the |
| use is in a different translation unit there is significant overhead |
| even if the variable doesn't actually need dynamic initialization. If |
| the programmer can be sure that no use of the variable in a |
| non-defining \s-1TU\s0 needs to trigger dynamic initialization (either |
| because the variable is statically initialized, or a use of the |
| variable in the defining \s-1TU\s0 will be executed before any uses in |
| another \s-1TU\s0), they can avoid this overhead with the |
| \&\fB\-fno\-extern\-tls\-init\fR option. |
| .Sp |
| On targets that support symbol aliases, the default is |
| \&\fB\-fextern\-tls\-init\fR. On targets that do not support symbol |
| aliases, the default is \fB\-fno\-extern\-tls\-init\fR. |
| .IP "\fB\-ffor\-scope\fR" 4 |
| .IX Item "-ffor-scope" |
| .PD 0 |
| .IP "\fB\-fno\-for\-scope\fR" 4 |
| .IX Item "-fno-for-scope" |
| .PD |
| If \fB\-ffor\-scope\fR is specified, the scope of variables declared in |
| a \fIfor-init-statement\fR is limited to the \fBfor\fR loop itself, |
| as specified by the \*(C+ standard. |
| If \fB\-fno\-for\-scope\fR is specified, the scope of variables declared in |
| a \fIfor-init-statement\fR extends to the end of the enclosing scope, |
| as was the case in old versions of G++, and other (traditional) |
| implementations of \*(C+. |
| .Sp |
| If neither flag is given, the default is to follow the standard, |
| but to allow and give a warning for old-style code that would |
| otherwise be invalid, or have different behavior. |
| .IP "\fB\-fno\-gnu\-keywords\fR" 4 |
| .IX Item "-fno-gnu-keywords" |
| Do not recognize \f(CW\*(C`typeof\*(C'\fR as a keyword, so that code can use this |
| word as an identifier. You can use the keyword \f(CW\*(C`_\|_typeof_\|_\*(C'\fR instead. |
| \&\fB\-ansi\fR implies \fB\-fno\-gnu\-keywords\fR. |
| .IP "\fB\-fno\-implicit\-templates\fR" 4 |
| .IX Item "-fno-implicit-templates" |
| Never emit code for non-inline templates that are instantiated |
| implicitly (i.e. by use); only emit code for explicit instantiations. |
| .IP "\fB\-fno\-implicit\-inline\-templates\fR" 4 |
| .IX Item "-fno-implicit-inline-templates" |
| Don't emit code for implicit instantiations of inline templates, either. |
| The default is to handle inlines differently so that compiles with and |
| without optimization need the same set of explicit instantiations. |
| .IP "\fB\-fno\-implement\-inlines\fR" 4 |
| .IX Item "-fno-implement-inlines" |
| To save space, do not emit out-of-line copies of inline functions |
| controlled by \fB#pragma implementation\fR. This causes linker |
| errors if these functions are not inlined everywhere they are called. |
| .IP "\fB\-fms\-extensions\fR" 4 |
| .IX Item "-fms-extensions" |
| Disable Wpedantic warnings about constructs used in \s-1MFC,\s0 such as implicit |
| int and getting a pointer to member function via non-standard syntax. |
| .IP "\fB\-fno\-nonansi\-builtins\fR" 4 |
| .IX Item "-fno-nonansi-builtins" |
| Disable built-in declarations of functions that are not mandated by |
| \&\s-1ANSI/ISO C. \s0 These include \f(CW\*(C`ffs\*(C'\fR, \f(CW\*(C`alloca\*(C'\fR, \f(CW\*(C`_exit\*(C'\fR, |
| \&\f(CW\*(C`index\*(C'\fR, \f(CW\*(C`bzero\*(C'\fR, \f(CW\*(C`conjf\*(C'\fR, and other related functions. |
| .IP "\fB\-fnothrow\-opt\fR" 4 |
| .IX Item "-fnothrow-opt" |
| Treat a \f(CW\*(C`throw()\*(C'\fR exception specification as if it were a |
| \&\f(CW\*(C`noexcept\*(C'\fR specification to reduce or eliminate the text size |
| overhead relative to a function with no exception specification. If |
| the function has local variables of types with non-trivial |
| destructors, the exception specification actually makes the |
| function smaller because the \s-1EH\s0 cleanups for those variables can be |
| optimized away. The semantic effect is that an exception thrown out of |
| a function with such an exception specification results in a call |
| to \f(CW\*(C`terminate\*(C'\fR rather than \f(CW\*(C`unexpected\*(C'\fR. |
| .IP "\fB\-fno\-operator\-names\fR" 4 |
| .IX Item "-fno-operator-names" |
| Do not treat the operator name keywords \f(CW\*(C`and\*(C'\fR, \f(CW\*(C`bitand\*(C'\fR, |
| \&\f(CW\*(C`bitor\*(C'\fR, \f(CW\*(C`compl\*(C'\fR, \f(CW\*(C`not\*(C'\fR, \f(CW\*(C`or\*(C'\fR and \f(CW\*(C`xor\*(C'\fR as |
| synonyms as keywords. |
| .IP "\fB\-fno\-optional\-diags\fR" 4 |
| .IX Item "-fno-optional-diags" |
| Disable diagnostics that the standard says a compiler does not need to |
| issue. Currently, the only such diagnostic issued by G++ is the one for |
| a name having multiple meanings within a class. |
| .IP "\fB\-fpermissive\fR" 4 |
| .IX Item "-fpermissive" |
| Downgrade some diagnostics about nonconformant code from errors to |
| warnings. Thus, using \fB\-fpermissive\fR allows some |
| nonconforming code to compile. |
| .IP "\fB\-fno\-pretty\-templates\fR" 4 |
| .IX Item "-fno-pretty-templates" |
| When an error message refers to a specialization of a function |
| template, the compiler normally prints the signature of the |
| template followed by the template arguments and any typedefs or |
| typenames in the signature (e.g. \f(CW\*(C`void f(T) [with T = int]\*(C'\fR |
| rather than \f(CW\*(C`void f(int)\*(C'\fR) so that it's clear which template is |
| involved. When an error message refers to a specialization of a class |
| template, the compiler omits any template arguments that match |
| the default template arguments for that template. If either of these |
| behaviors make it harder to understand the error message rather than |
| easier, you can use \fB\-fno\-pretty\-templates\fR to disable them. |
| .IP "\fB\-frepo\fR" 4 |
| .IX Item "-frepo" |
| Enable automatic template instantiation at link time. This option also |
| implies \fB\-fno\-implicit\-templates\fR. |
| .IP "\fB\-fno\-rtti\fR" 4 |
| .IX Item "-fno-rtti" |
| Disable generation of information about every class with virtual |
| functions for use by the \*(C+ run-time type identification features |
| (\fBdynamic_cast\fR and \fBtypeid\fR). If you don't use those parts |
| of the language, you can save some space by using this flag. Note that |
| exception handling uses the same information, but G++ generates it as |
| needed. The \fBdynamic_cast\fR operator can still be used for casts that |
| do not require run-time type information, i.e. casts to \f(CW\*(C`void *\*(C'\fR or to |
| unambiguous base classes. |
| .IP "\fB\-fstats\fR" 4 |
| .IX Item "-fstats" |
| Emit statistics about front-end processing at the end of the compilation. |
| This information is generally only useful to the G++ development team. |
| .IP "\fB\-fstrict\-enums\fR" 4 |
| .IX Item "-fstrict-enums" |
| Allow the compiler to optimize using the assumption that a value of |
| enumerated type can only be one of the values of the enumeration (as |
| defined in the \*(C+ standard; basically, a value that can be |
| represented in the minimum number of bits needed to represent all the |
| enumerators). This assumption may not be valid if the program uses a |
| cast to convert an arbitrary integer value to the enumerated type. |
| .IP "\fB\-ftemplate\-backtrace\-limit=\fR\fIn\fR" 4 |
| .IX Item "-ftemplate-backtrace-limit=n" |
| Set the maximum number of template instantiation notes for a single |
| warning or error to \fIn\fR. The default value is 10. |
| .IP "\fB\-ftemplate\-depth=\fR\fIn\fR" 4 |
| .IX Item "-ftemplate-depth=n" |
| Set the maximum instantiation depth for template classes to \fIn\fR. |
| A limit on the template instantiation depth is needed to detect |
| endless recursions during template class instantiation. \s-1ANSI/ISO \*(C+\s0 |
| conforming programs must not rely on a maximum depth greater than 17 |
| (changed to 1024 in \*(C+11). The default value is 900, as the compiler |
| can run out of stack space before hitting 1024 in some situations. |
| .IP "\fB\-fno\-threadsafe\-statics\fR" 4 |
| .IX Item "-fno-threadsafe-statics" |
| Do not emit the extra code to use the routines specified in the \*(C+ |
| \&\s-1ABI\s0 for thread-safe initialization of local statics. You can use this |
| option to reduce code size slightly in code that doesn't need to be |
| thread-safe. |
| .IP "\fB\-fuse\-cxa\-atexit\fR" 4 |
| .IX Item "-fuse-cxa-atexit" |
| Register destructors for objects with static storage duration with the |
| \&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR function rather than the \f(CW\*(C`atexit\*(C'\fR function. |
| This option is required for fully standards-compliant handling of static |
| destructors, but only works if your C library supports |
| \&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR. |
| .IP "\fB\-fno\-use\-cxa\-get\-exception\-ptr\fR" 4 |
| .IX Item "-fno-use-cxa-get-exception-ptr" |
| Don't use the \f(CW\*(C`_\|_cxa_get_exception_ptr\*(C'\fR runtime routine. This |
| causes \f(CW\*(C`std::uncaught_exception\*(C'\fR to be incorrect, but is necessary |
| if the runtime routine is not available. |
| .IP "\fB\-fvisibility\-inlines\-hidden\fR" 4 |
| .IX Item "-fvisibility-inlines-hidden" |
| This switch declares that the user does not attempt to compare |
| pointers to inline functions or methods where the addresses of the two functions |
| are taken in different shared objects. |
| .Sp |
| The effect of this is that \s-1GCC\s0 may, effectively, mark inline methods with |
| \&\f(CW\*(C`_\|_attribute_\|_ ((visibility ("hidden")))\*(C'\fR so that they do not |
| appear in the export table of a \s-1DSO\s0 and do not require a \s-1PLT\s0 indirection |
| when used within the \s-1DSO. \s0 Enabling this option can have a dramatic effect |
| on load and link times of a \s-1DSO\s0 as it massively reduces the size of the |
| dynamic export table when the library makes heavy use of templates. |
| .Sp |
| The behavior of this switch is not quite the same as marking the |
| methods as hidden directly, because it does not affect static variables |
| local to the function or cause the compiler to deduce that |
| the function is defined in only one shared object. |
| .Sp |
| You may mark a method as having a visibility explicitly to negate the |
| effect of the switch for that method. For example, if you do want to |
| compare pointers to a particular inline method, you might mark it as |
| having default visibility. Marking the enclosing class with explicit |
| visibility has no effect. |
| .Sp |
| Explicitly instantiated inline methods are unaffected by this option |
| as their linkage might otherwise cross a shared library boundary. |
| .IP "\fB\-fvisibility\-ms\-compat\fR" 4 |
| .IX Item "-fvisibility-ms-compat" |
| This flag attempts to use visibility settings to make \s-1GCC\s0's \*(C+ |
| linkage model compatible with that of Microsoft Visual Studio. |
| .Sp |
| The flag makes these changes to \s-1GCC\s0's linkage model: |
| .RS 4 |
| .IP "1." 4 |
| It sets the default visibility to \f(CW\*(C`hidden\*(C'\fR, like |
| \&\fB\-fvisibility=hidden\fR. |
| .IP "2." 4 |
| Types, but not their members, are not hidden by default. |
| .IP "3." 4 |
| The One Definition Rule is relaxed for types without explicit |
| visibility specifications that are defined in more than one |
| shared object: those declarations are permitted if they are |
| permitted when this option is not used. |
| .RE |
| .RS 4 |
| .Sp |
| In new code it is better to use \fB\-fvisibility=hidden\fR and |
| export those classes that are intended to be externally visible. |
| Unfortunately it is possible for code to rely, perhaps accidentally, |
| on the Visual Studio behavior. |
| .Sp |
| Among the consequences of these changes are that static data members |
| of the same type with the same name but defined in different shared |
| objects are different, so changing one does not change the other; |
| and that pointers to function members defined in different shared |
| objects may not compare equal. When this flag is given, it is a |
| violation of the \s-1ODR\s0 to define types with the same name differently. |
| .RE |
| .IP "\fB\-fvtable\-verify=\fR\fIstd|preinit|none\fR" 4 |
| .IX Item "-fvtable-verify=std|preinit|none" |
| Turn on (or off, if using \fB\-fvtable\-verify=none\fR) the security |
| feature that verifies at runtime, for every virtual call that is made, that |
| the vtable pointer through which the call is made is valid for the type of |
| the object, and has not been corrupted or overwritten. If an invalid vtable |
| pointer is detected (at runtime), an error is reported and execution of the |
| program is immediately halted. |
| .Sp |
| This option causes runtime data structures to be built, at program start up, |
| for verifying the vtable pointers. The options \f(CW\*(C`std\*(C'\fR and \f(CW\*(C`preinit\*(C'\fR |
| control the timing of when these data structures are built. In both cases the |
| data structures are built before execution reaches 'main'. The |
| \&\fB\-fvtable\-verify=std\fR causes these data structure to be built after the |
| shared libraries have been loaded and initialized. |
| \&\fB\-fvtable\-verify=preinit\fR causes them to be built before the shared |
| libraries have been loaded and initialized. |
| .Sp |
| If this option appears multiple times in the compiler line, with different |
| values specified, 'none' will take highest priority over both 'std' and |
| \&'preinit'; 'preinit' will take priority over 'std'. |
| .IP "\fB\-fvtv\-debug\fR" 4 |
| .IX Item "-fvtv-debug" |
| Causes debug versions of the runtime functions for the vtable verification |
| feature to be called. This assumes the \fB\-fvtable\-verify=std\fR or |
| \&\fB\-fvtable\-verify=preinit\fR has been used. This flag will also cause the |
| compiler to keep track of which vtable pointers it found for each class, and |
| record that information in the file \*(L"vtv_set_ptr_data.log\*(R", in the dump |
| file directory on the user's machine. |
| .Sp |
| Note: This feature \s-1APPENDS\s0 data to the log file. If you want a fresh log |
| file, be sure to delete any existing one. |
| .IP "\fB\-fvtv\-counts\fR" 4 |
| .IX Item "-fvtv-counts" |
| This is a debugging flag. When used in conjunction with |
| \&\fB\-fvtable\-verify=std\fR or \fB\-fvtable\-verify=preinit\fR, this |
| causes the compiler to keep track of the total number of virtual calls |
| it encountered and the number of verifications it inserted. It also |
| counts the number of calls to certain runtime library functions |
| that it inserts. This information, for each compilation unit, is written |
| to a file named \*(L"vtv_count_data.log\*(R", in the dump_file directory on |
| the user's machine. It also counts the size of the vtable pointer sets |
| for each class, and writes this information to \*(L"vtv_class_set_sizes.log\*(R" |
| in the same directory. |
| .Sp |
| Note: This feature \s-1APPENDS\s0 data to the log files. To get a fresh log |
| files, be sure to delete any existing ones. |
| .IP "\fB\-fno\-weak\fR" 4 |
| .IX Item "-fno-weak" |
| Do not use weak symbol support, even if it is provided by the linker. |
| By default, G++ uses weak symbols if they are available. This |
| option exists only for testing, and should not be used by end-users; |
| it results in inferior code and has no benefits. This option may |
| be removed in a future release of G++. |
| .IP "\fB\-nostdinc++\fR" 4 |
| .IX Item "-nostdinc++" |
| Do not search for header files in the standard directories specific to |
| \&\*(C+, but do still search the other standard directories. (This option |
| is used when building the \*(C+ library.) |
| .PP |
| In addition, these optimization, warning, and code generation options |
| have meanings only for \*(C+ programs: |
| .IP "\fB\-Wabi\fR (C, Objective-C, \*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wabi (C, Objective-C, and Objective- only)" |
| Warn when G++ generates code that is probably not compatible with the |
| vendor-neutral \*(C+ \s-1ABI. \s0 Although an effort has been made to warn about |
| all such cases, there are probably some cases that are not warned about, |
| even though G++ is generating incompatible code. There may also be |
| cases where warnings are emitted even though the code that is generated |
| is compatible. |
| .Sp |
| You should rewrite your code to avoid these warnings if you are |
| concerned about the fact that code generated by G++ may not be binary |
| compatible with code generated by other compilers. |
| .Sp |
| The known incompatibilities in \fB\-fabi\-version=2\fR (the default) include: |
| .RS 4 |
| .IP "\(bu" 4 |
| A template with a non-type template parameter of reference type is |
| mangled incorrectly: |
| .Sp |
| .Vb 3 |
| \& extern int N; |
| \& template <int &> struct S {}; |
| \& void n (S<N>) {2} |
| .Ve |
| .Sp |
| This is fixed in \fB\-fabi\-version=3\fR. |
| .IP "\(bu" 4 |
| \&\s-1SIMD\s0 vector types declared using \f(CW\*(C`_\|_attribute ((vector_size))\*(C'\fR are |
| mangled in a non-standard way that does not allow for overloading of |
| functions taking vectors of different sizes. |
| .Sp |
| The mangling is changed in \fB\-fabi\-version=4\fR. |
| .RE |
| .RS 4 |
| .Sp |
| The known incompatibilities in \fB\-fabi\-version=1\fR include: |
| .IP "\(bu" 4 |
| Incorrect handling of tail-padding for bit-fields. G++ may attempt to |
| pack data into the same byte as a base class. For example: |
| .Sp |
| .Vb 2 |
| \& struct A { virtual void f(); int f1 : 1; }; |
| \& struct B : public A { int f2 : 1; }; |
| .Ve |
| .Sp |
| In this case, G++ places \f(CW\*(C`B::f2\*(C'\fR into the same byte |
| as \f(CW\*(C`A::f1\*(C'\fR; other compilers do not. You can avoid this problem |
| by explicitly padding \f(CW\*(C`A\*(C'\fR so that its size is a multiple of the |
| byte size on your platform; that causes G++ and other compilers to |
| lay out \f(CW\*(C`B\*(C'\fR identically. |
| .IP "\(bu" 4 |
| Incorrect handling of tail-padding for virtual bases. G++ does not use |
| tail padding when laying out virtual bases. For example: |
| .Sp |
| .Vb 3 |
| \& struct A { virtual void f(); char c1; }; |
| \& struct B { B(); char c2; }; |
| \& struct C : public A, public virtual B {}; |
| .Ve |
| .Sp |
| In this case, G++ does not place \f(CW\*(C`B\*(C'\fR into the tail-padding for |
| \&\f(CW\*(C`A\*(C'\fR; other compilers do. You can avoid this problem by |
| explicitly padding \f(CW\*(C`A\*(C'\fR so that its size is a multiple of its |
| alignment (ignoring virtual base classes); that causes G++ and other |
| compilers to lay out \f(CW\*(C`C\*(C'\fR identically. |
| .IP "\(bu" 4 |
| Incorrect handling of bit-fields with declared widths greater than that |
| of their underlying types, when the bit-fields appear in a union. For |
| example: |
| .Sp |
| .Vb 1 |
| \& union U { int i : 4096; }; |
| .Ve |
| .Sp |
| Assuming that an \f(CW\*(C`int\*(C'\fR does not have 4096 bits, G++ makes the |
| union too small by the number of bits in an \f(CW\*(C`int\*(C'\fR. |
| .IP "\(bu" 4 |
| Empty classes can be placed at incorrect offsets. For example: |
| .Sp |
| .Vb 1 |
| \& struct A {}; |
| \& |
| \& struct B { |
| \& A a; |
| \& virtual void f (); |
| \& }; |
| \& |
| \& struct C : public B, public A {}; |
| .Ve |
| .Sp |
| G++ places the \f(CW\*(C`A\*(C'\fR base class of \f(CW\*(C`C\*(C'\fR at a nonzero offset; |
| it should be placed at offset zero. G++ mistakenly believes that the |
| \&\f(CW\*(C`A\*(C'\fR data member of \f(CW\*(C`B\*(C'\fR is already at offset zero. |
| .IP "\(bu" 4 |
| Names of template functions whose types involve \f(CW\*(C`typename\*(C'\fR or |
| template template parameters can be mangled incorrectly. |
| .Sp |
| .Vb 2 |
| \& template <typename Q> |
| \& void f(typename Q::X) {} |
| \& |
| \& template <template <typename> class Q> |
| \& void f(typename Q<int>::X) {} |
| .Ve |
| .Sp |
| Instantiations of these templates may be mangled incorrectly. |
| .RE |
| .RS 4 |
| .Sp |
| It also warns about psABI-related changes. The known psABI changes at this |
| point include: |
| .IP "\(bu" 4 |
| For SysV/x86\-64, unions with \f(CW\*(C`long double\*(C'\fR members are |
| passed in memory as specified in psABI. For example: |
| .Sp |
| .Vb 4 |
| \& union U { |
| \& long double ld; |
| \& int i; |
| \& }; |
| .Ve |
| .Sp |
| \&\f(CW\*(C`union U\*(C'\fR is always passed in memory. |
| .RE |
| .RS 4 |
| .RE |
| .IP "\fB\-Wctor\-dtor\-privacy\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wctor-dtor-privacy ( and Objective- only)" |
| Warn when a class seems unusable because all the constructors or |
| destructors in that class are private, and it has neither friends nor |
| public static member functions. Also warn if there are no non-private |
| methods, and there's at least one private member function that isn't |
| a constructor or destructor. |
| .IP "\fB\-Wdelete\-non\-virtual\-dtor\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wdelete-non-virtual-dtor ( and Objective- only)" |
| Warn when \fBdelete\fR is used to destroy an instance of a class that |
| has virtual functions and non-virtual destructor. It is unsafe to delete |
| an instance of a derived class through a pointer to a base class if the |
| base class does not have a virtual destructor. This warning is enabled |
| by \fB\-Wall\fR. |
| .IP "\fB\-Wliteral\-suffix\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wliteral-suffix ( and Objective- only)" |
| Warn when a string or character literal is followed by a ud-suffix which does |
| not begin with an underscore. As a conforming extension, \s-1GCC\s0 treats such |
| suffixes as separate preprocessing tokens in order to maintain backwards |
| compatibility with code that uses formatting macros from \f(CW\*(C`<inttypes.h>\*(C'\fR. |
| For example: |
| .Sp |
| .Vb 3 |
| \& #define _\|_STDC_FORMAT_MACROS |
| \& #include <inttypes.h> |
| \& #include <stdio.h> |
| \& |
| \& int main() { |
| \& int64_t i64 = 123; |
| \& printf("My int64: %"PRId64"\en", i64); |
| \& } |
| .Ve |
| .Sp |
| In this case, \f(CW\*(C`PRId64\*(C'\fR is treated as a separate preprocessing token. |
| .Sp |
| This warning is enabled by default. |
| .IP "\fB\-Wnarrowing\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wnarrowing ( and Objective- only)" |
| Warn when a narrowing conversion prohibited by \*(C+11 occurs within |
| \&\fB{ }\fR, e.g. |
| .Sp |
| .Vb 1 |
| \& int i = { 2.2 }; // error: narrowing from double to int |
| .Ve |
| .Sp |
| This flag is included in \fB\-Wall\fR and \fB\-Wc++11\-compat\fR. |
| .Sp |
| With \fB\-std=c++11\fR, \fB\-Wno\-narrowing\fR suppresses the diagnostic |
| required by the standard. Note that this does not affect the meaning |
| of well-formed code; narrowing conversions are still considered |
| ill-formed in \s-1SFINAE\s0 context. |
| .IP "\fB\-Wnoexcept\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wnoexcept ( and Objective- only)" |
| Warn when a noexcept-expression evaluates to false because of a call |
| to a function that does not have a non-throwing exception |
| specification (i.e. \fB\f(BIthrow()\fB\fR or \fBnoexcept\fR) but is known by |
| the compiler to never throw an exception. |
| .IP "\fB\-Wnon\-virtual\-dtor\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wnon-virtual-dtor ( and Objective- only)" |
| Warn when a class has virtual functions and an accessible non-virtual |
| destructor itself or in an accessible polymorphic base class, in which |
| case it is possible but unsafe to delete an instance of a derived |
| class through a pointer to the class itself or base class. This |
| warning is automatically enabled if \fB\-Weffc++\fR is specified. |
| .IP "\fB\-Wreorder\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wreorder ( and Objective- only)" |
| Warn when the order of member initializers given in the code does not |
| match the order in which they must be executed. For instance: |
| .Sp |
| .Vb 5 |
| \& struct A { |
| \& int i; |
| \& int j; |
| \& A(): j (0), i (1) { } |
| \& }; |
| .Ve |
| .Sp |
| The compiler rearranges the member initializers for \fBi\fR |
| and \fBj\fR to match the declaration order of the members, emitting |
| a warning to that effect. This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-fext\-numeric\-literals\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-fext-numeric-literals ( and Objective- only)" |
| Accept imaginary, fixed-point, or machine-defined |
| literal number suffixes as \s-1GNU\s0 extensions. |
| When this option is turned off these suffixes are treated |
| as \*(C+11 user-defined literal numeric suffixes. |
| This is on by default for all pre\-\*(C+11 dialects and all \s-1GNU\s0 dialects: |
| \&\fB\-std=c++98\fR, \fB\-std=gnu++98\fR, \fB\-std=gnu++11\fR, |
| \&\fB\-std=gnu++1y\fR. |
| This option is off by default |
| for \s-1ISO \*(C+11\s0 onwards (\fB\-std=c++11\fR, ...). |
| .PP |
| The following \fB\-W...\fR options are not affected by \fB\-Wall\fR. |
| .IP "\fB\-Weffc++\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Weffc++ ( and Objective- only)" |
| Warn about violations of the following style guidelines from Scott Meyers' |
| \&\fIEffective \*(C+\fR series of books: |
| .RS 4 |
| .IP "\(bu" 4 |
| Define a copy constructor and an assignment operator for classes |
| with dynamically-allocated memory. |
| .IP "\(bu" 4 |
| Prefer initialization to assignment in constructors. |
| .IP "\(bu" 4 |
| Have \f(CW\*(C`operator=\*(C'\fR return a reference to \f(CW*this\fR. |
| .IP "\(bu" 4 |
| Don't try to return a reference when you must return an object. |
| .IP "\(bu" 4 |
| Distinguish between prefix and postfix forms of increment and |
| decrement operators. |
| .IP "\(bu" 4 |
| Never overload \f(CW\*(C`&&\*(C'\fR, \f(CW\*(C`||\*(C'\fR, or \f(CW\*(C`,\*(C'\fR. |
| .RE |
| .RS 4 |
| .Sp |
| This option also enables \fB\-Wnon\-virtual\-dtor\fR, which is also |
| one of the effective \*(C+ recommendations. However, the check is |
| extended to warn about the lack of virtual destructor in accessible |
| non-polymorphic bases classes too. |
| .Sp |
| When selecting this option, be aware that the standard library |
| headers do not obey all of these guidelines; use \fBgrep \-v\fR |
| to filter out those warnings. |
| .RE |
| .IP "\fB\-Wstrict\-null\-sentinel\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wstrict-null-sentinel ( and Objective- only)" |
| Warn about the use of an uncasted \f(CW\*(C`NULL\*(C'\fR as sentinel. When |
| compiling only with \s-1GCC\s0 this is a valid sentinel, as \f(CW\*(C`NULL\*(C'\fR is defined |
| to \f(CW\*(C`_\|_null\*(C'\fR. Although it is a null pointer constant rather than a |
| null pointer, it is guaranteed to be of the same size as a pointer. |
| But this use is not portable across different compilers. |
| .IP "\fB\-Wno\-non\-template\-friend\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wno-non-template-friend ( and Objective- only)" |
| Disable warnings when non-templatized friend functions are declared |
| within a template. Since the advent of explicit template specification |
| support in G++, if the name of the friend is an unqualified-id (i.e., |
| \&\fBfriend foo(int)\fR), the \*(C+ language specification demands that the |
| friend declare or define an ordinary, nontemplate function. (Section |
| 14.5.3). Before G++ implemented explicit specification, unqualified-ids |
| could be interpreted as a particular specialization of a templatized |
| function. Because this non-conforming behavior is no longer the default |
| behavior for G++, \fB\-Wnon\-template\-friend\fR allows the compiler to |
| check existing code for potential trouble spots and is on by default. |
| This new compiler behavior can be turned off with |
| \&\fB\-Wno\-non\-template\-friend\fR, which keeps the conformant compiler code |
| but disables the helpful warning. |
| .IP "\fB\-Wold\-style\-cast\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wold-style-cast ( and Objective- only)" |
| Warn if an old-style (C\-style) cast to a non-void type is used within |
| a \*(C+ program. The new-style casts (\fBdynamic_cast\fR, |
| \&\fBstatic_cast\fR, \fBreinterpret_cast\fR, and \fBconst_cast\fR) are |
| less vulnerable to unintended effects and much easier to search for. |
| .IP "\fB\-Woverloaded\-virtual\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Woverloaded-virtual ( and Objective- only)" |
| Warn when a function declaration hides virtual functions from a |
| base class. For example, in: |
| .Sp |
| .Vb 3 |
| \& struct A { |
| \& virtual void f(); |
| \& }; |
| \& |
| \& struct B: public A { |
| \& void f(int); |
| \& }; |
| .Ve |
| .Sp |
| the \f(CW\*(C`A\*(C'\fR class version of \f(CW\*(C`f\*(C'\fR is hidden in \f(CW\*(C`B\*(C'\fR, and code |
| like: |
| .Sp |
| .Vb 2 |
| \& B* b; |
| \& b\->f(); |
| .Ve |
| .Sp |
| fails to compile. |
| .IP "\fB\-Wno\-pmf\-conversions\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wno-pmf-conversions ( and Objective- only)" |
| Disable the diagnostic for converting a bound pointer to member function |
| to a plain pointer. |
| .IP "\fB\-Wsign\-promo\fR (\*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wsign-promo ( and Objective- only)" |
| Warn when overload resolution chooses a promotion from unsigned or |
| enumerated type to a signed type, over a conversion to an unsigned type of |
| the same size. Previous versions of G++ tried to preserve |
| unsignedness, but the standard mandates the current behavior. |
| .SS "Options Controlling Objective-C and Objective\-\*(C+ Dialects" |
| .IX Subsection "Options Controlling Objective-C and Objective- Dialects" |
| (\s-1NOTE:\s0 This manual does not describe the Objective-C and Objective\-\*(C+ |
| languages themselves. |
| .PP |
| This section describes the command-line options that are only meaningful |
| for Objective-C and Objective\-\*(C+ programs. You can also use most of |
| the language-independent \s-1GNU\s0 compiler options. |
| For example, you might compile a file \f(CW\*(C`some_class.m\*(C'\fR like this: |
| .PP |
| .Vb 1 |
| \& gcc \-g \-fgnu\-runtime \-O \-c some_class.m |
| .Ve |
| .PP |
| In this example, \fB\-fgnu\-runtime\fR is an option meant only for |
| Objective-C and Objective\-\*(C+ programs; you can use the other options with |
| any language supported by \s-1GCC.\s0 |
| .PP |
| Note that since Objective-C is an extension of the C language, Objective-C |
| compilations may also use options specific to the C front-end (e.g., |
| \&\fB\-Wtraditional\fR). Similarly, Objective\-\*(C+ compilations may use |
| \&\*(C+\-specific options (e.g., \fB\-Wabi\fR). |
| .PP |
| Here is a list of options that are \fIonly\fR for compiling Objective-C |
| and Objective\-\*(C+ programs: |
| .IP "\fB\-fconstant\-string\-class=\fR\fIclass-name\fR" 4 |
| .IX Item "-fconstant-string-class=class-name" |
| Use \fIclass-name\fR as the name of the class to instantiate for each |
| literal string specified with the syntax \f(CW\*(C`@"..."\*(C'\fR. The default |
| class name is \f(CW\*(C`NXConstantString\*(C'\fR if the \s-1GNU\s0 runtime is being used, and |
| \&\f(CW\*(C`NSConstantString\*(C'\fR if the NeXT runtime is being used (see below). The |
| \&\fB\-fconstant\-cfstrings\fR option, if also present, overrides the |
| \&\fB\-fconstant\-string\-class\fR setting and cause \f(CW\*(C`@"..."\*(C'\fR literals |
| to be laid out as constant CoreFoundation strings. |
| .IP "\fB\-fgnu\-runtime\fR" 4 |
| .IX Item "-fgnu-runtime" |
| Generate object code compatible with the standard \s-1GNU\s0 Objective-C |
| runtime. This is the default for most types of systems. |
| .IP "\fB\-fnext\-runtime\fR" 4 |
| .IX Item "-fnext-runtime" |
| Generate output compatible with the NeXT runtime. This is the default |
| for NeXT-based systems, including Darwin and Mac \s-1OS X. \s0 The macro |
| \&\f(CW\*(C`_\|_NEXT_RUNTIME_\|_\*(C'\fR is predefined if (and only if) this option is |
| used. |
| .IP "\fB\-fno\-nil\-receivers\fR" 4 |
| .IX Item "-fno-nil-receivers" |
| Assume that all Objective-C message dispatches (\f(CW\*(C`[receiver |
| message:arg]\*(C'\fR) in this translation unit ensure that the receiver is |
| not \f(CW\*(C`nil\*(C'\fR. This allows for more efficient entry points in the |
| runtime to be used. This option is only available in conjunction with |
| the NeXT runtime and \s-1ABI\s0 version 0 or 1. |
| .IP "\fB\-fobjc\-abi\-version=\fR\fIn\fR" 4 |
| .IX Item "-fobjc-abi-version=n" |
| Use version \fIn\fR of the Objective-C \s-1ABI\s0 for the selected runtime. |
| This option is currently supported only for the NeXT runtime. In that |
| case, Version 0 is the traditional (32\-bit) \s-1ABI\s0 without support for |
| properties and other Objective-C 2.0 additions. Version 1 is the |
| traditional (32\-bit) \s-1ABI\s0 with support for properties and other |
| Objective-C 2.0 additions. Version 2 is the modern (64\-bit) \s-1ABI. \s0 If |
| nothing is specified, the default is Version 0 on 32\-bit target |
| machines, and Version 2 on 64\-bit target machines. |
| .IP "\fB\-fobjc\-call\-cxx\-cdtors\fR" 4 |
| .IX Item "-fobjc-call-cxx-cdtors" |
| For each Objective-C class, check if any of its instance variables is a |
| \&\*(C+ object with a non-trivial default constructor. If so, synthesize a |
| special \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR instance method which runs |
| non-trivial default constructors on any such instance variables, in order, |
| and then return \f(CW\*(C`self\*(C'\fR. Similarly, check if any instance variable |
| is a \*(C+ object with a non-trivial destructor, and if so, synthesize a |
| special \f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR method which runs |
| all such default destructors, in reverse order. |
| .Sp |
| The \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR and \f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR |
| methods thusly generated only operate on instance variables |
| declared in the current Objective-C class, and not those inherited |
| from superclasses. It is the responsibility of the Objective-C |
| runtime to invoke all such methods in an object's inheritance |
| hierarchy. The \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR methods are invoked |
| by the runtime immediately after a new object instance is allocated; |
| the \f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR methods are invoked immediately |
| before the runtime deallocates an object instance. |
| .Sp |
| As of this writing, only the NeXT runtime on Mac \s-1OS X 10.4\s0 and later has |
| support for invoking the \f(CW\*(C`\- (id) .cxx_construct\*(C'\fR and |
| \&\f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR methods. |
| .IP "\fB\-fobjc\-direct\-dispatch\fR" 4 |
| .IX Item "-fobjc-direct-dispatch" |
| Allow fast jumps to the message dispatcher. On Darwin this is |
| accomplished via the comm page. |
| .IP "\fB\-fobjc\-exceptions\fR" 4 |
| .IX Item "-fobjc-exceptions" |
| Enable syntactic support for structured exception handling in |
| Objective-C, similar to what is offered by \*(C+ and Java. This option |
| is required to use the Objective-C keywords \f(CW@try\fR, |
| \&\f(CW@throw\fR, \f(CW@catch\fR, \f(CW@finally\fR and |
| \&\f(CW@synchronized\fR. This option is available with both the \s-1GNU\s0 |
| runtime and the NeXT runtime (but not available in conjunction with |
| the NeXT runtime on Mac \s-1OS X 10.2\s0 and earlier). |
| .IP "\fB\-fobjc\-gc\fR" 4 |
| .IX Item "-fobjc-gc" |
| Enable garbage collection (\s-1GC\s0) in Objective-C and Objective\-\*(C+ |
| programs. This option is only available with the NeXT runtime; the |
| \&\s-1GNU\s0 runtime has a different garbage collection implementation that |
| does not require special compiler flags. |
| .IP "\fB\-fobjc\-nilcheck\fR" 4 |
| .IX Item "-fobjc-nilcheck" |
| For the NeXT runtime with version 2 of the \s-1ABI,\s0 check for a nil |
| receiver in method invocations before doing the actual method call. |
| This is the default and can be disabled using |
| \&\fB\-fno\-objc\-nilcheck\fR. Class methods and super calls are never |
| checked for nil in this way no matter what this flag is set to. |
| Currently this flag does nothing when the \s-1GNU\s0 runtime, or an older |
| version of the NeXT runtime \s-1ABI,\s0 is used. |
| .IP "\fB\-fobjc\-std=objc1\fR" 4 |
| .IX Item "-fobjc-std=objc1" |
| Conform to the language syntax of Objective-C 1.0, the language |
| recognized by \s-1GCC 4.0. \s0 This only affects the Objective-C additions to |
| the C/\*(C+ language; it does not affect conformance to C/\*(C+ standards, |
| which is controlled by the separate C/\*(C+ dialect option flags. When |
| this option is used with the Objective-C or Objective\-\*(C+ compiler, |
| any Objective-C syntax that is not recognized by \s-1GCC 4.0\s0 is rejected. |
| This is useful if you need to make sure that your Objective-C code can |
| be compiled with older versions of \s-1GCC.\s0 |
| .IP "\fB\-freplace\-objc\-classes\fR" 4 |
| .IX Item "-freplace-objc-classes" |
| Emit a special marker instructing \fB\f(BIld\fB\|(1)\fR not to statically link in |
| the resulting object file, and allow \fB\f(BIdyld\fB\|(1)\fR to load it in at |
| run time instead. This is used in conjunction with the Fix-and-Continue |
| debugging mode, where the object file in question may be recompiled and |
| dynamically reloaded in the course of program execution, without the need |
| to restart the program itself. Currently, Fix-and-Continue functionality |
| is only available in conjunction with the NeXT runtime on Mac \s-1OS X 10.3\s0 |
| and later. |
| .IP "\fB\-fzero\-link\fR" 4 |
| .IX Item "-fzero-link" |
| When compiling for the NeXT runtime, the compiler ordinarily replaces calls |
| to \f(CW\*(C`objc_getClass("...")\*(C'\fR (when the name of the class is known at |
| compile time) with static class references that get initialized at load time, |
| which improves run-time performance. Specifying the \fB\-fzero\-link\fR flag |
| suppresses this behavior and causes calls to \f(CW\*(C`objc_getClass("...")\*(C'\fR |
| to be retained. This is useful in Zero-Link debugging mode, since it allows |
| for individual class implementations to be modified during program execution. |
| The \s-1GNU\s0 runtime currently always retains calls to \f(CW\*(C`objc_get_class("...")\*(C'\fR |
| regardless of command-line options. |
| .IP "\fB\-gen\-decls\fR" 4 |
| .IX Item "-gen-decls" |
| Dump interface declarations for all classes seen in the source file to a |
| file named \fI\fIsourcename\fI.decl\fR. |
| .IP "\fB\-Wassign\-intercept\fR (Objective-C and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wassign-intercept (Objective-C and Objective- only)" |
| Warn whenever an Objective-C assignment is being intercepted by the |
| garbage collector. |
| .IP "\fB\-Wno\-protocol\fR (Objective-C and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wno-protocol (Objective-C and Objective- only)" |
| If a class is declared to implement a protocol, a warning is issued for |
| every method in the protocol that is not implemented by the class. The |
| default behavior is to issue a warning for every method not explicitly |
| implemented in the class, even if a method implementation is inherited |
| from the superclass. If you use the \fB\-Wno\-protocol\fR option, then |
| methods inherited from the superclass are considered to be implemented, |
| and no warning is issued for them. |
| .IP "\fB\-Wselector\fR (Objective-C and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wselector (Objective-C and Objective- only)" |
| Warn if multiple methods of different types for the same selector are |
| found during compilation. The check is performed on the list of methods |
| in the final stage of compilation. Additionally, a check is performed |
| for each selector appearing in a \f(CW\*(C`@selector(...)\*(C'\fR |
| expression, and a corresponding method for that selector has been found |
| during compilation. Because these checks scan the method table only at |
| the end of compilation, these warnings are not produced if the final |
| stage of compilation is not reached, for example because an error is |
| found during compilation, or because the \fB\-fsyntax\-only\fR option is |
| being used. |
| .IP "\fB\-Wstrict\-selector\-match\fR (Objective-C and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wstrict-selector-match (Objective-C and Objective- only)" |
| Warn if multiple methods with differing argument and/or return types are |
| found for a given selector when attempting to send a message using this |
| selector to a receiver of type \f(CW\*(C`id\*(C'\fR or \f(CW\*(C`Class\*(C'\fR. When this flag |
| is off (which is the default behavior), the compiler omits such warnings |
| if any differences found are confined to types that share the same size |
| and alignment. |
| .IP "\fB\-Wundeclared\-selector\fR (Objective-C and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wundeclared-selector (Objective-C and Objective- only)" |
| Warn if a \f(CW\*(C`@selector(...)\*(C'\fR expression referring to an |
| undeclared selector is found. A selector is considered undeclared if no |
| method with that name has been declared before the |
| \&\f(CW\*(C`@selector(...)\*(C'\fR expression, either explicitly in an |
| \&\f(CW@interface\fR or \f(CW@protocol\fR declaration, or implicitly in |
| an \f(CW@implementation\fR section. This option always performs its |
| checks as soon as a \f(CW\*(C`@selector(...)\*(C'\fR expression is found, |
| while \fB\-Wselector\fR only performs its checks in the final stage of |
| compilation. This also enforces the coding style convention |
| that methods and selectors must be declared before being used. |
| .IP "\fB\-print\-objc\-runtime\-info\fR" 4 |
| .IX Item "-print-objc-runtime-info" |
| Generate C header describing the largest structure that is passed by |
| value, if any. |
| .SS "Options to Control Diagnostic Messages Formatting" |
| .IX Subsection "Options to Control Diagnostic Messages Formatting" |
| Traditionally, diagnostic messages have been formatted irrespective of |
| the output device's aspect (e.g. its width, ...). You can use the |
| options described below |
| to control the formatting algorithm for diagnostic messages, |
| e.g. how many characters per line, how often source location |
| information should be reported. Note that some language front ends may not |
| honor these options. |
| .IP "\fB\-fmessage\-length=\fR\fIn\fR" 4 |
| .IX Item "-fmessage-length=n" |
| Try to format error messages so that they fit on lines of about \fIn\fR |
| characters. The default is 72 characters for \fBg++\fR and 0 for the rest of |
| the front ends supported by \s-1GCC. \s0 If \fIn\fR is zero, then no |
| line-wrapping is done; each error message appears on a single |
| line. |
| .IP "\fB\-fdiagnostics\-show\-location=once\fR" 4 |
| .IX Item "-fdiagnostics-show-location=once" |
| Only meaningful in line-wrapping mode. Instructs the diagnostic messages |
| reporter to emit source location information \fIonce\fR; that is, in |
| case the message is too long to fit on a single physical line and has to |
| be wrapped, the source location won't be emitted (as prefix) again, |
| over and over, in subsequent continuation lines. This is the default |
| behavior. |
| .IP "\fB\-fdiagnostics\-show\-location=every\-line\fR" 4 |
| .IX Item "-fdiagnostics-show-location=every-line" |
| Only meaningful in line-wrapping mode. Instructs the diagnostic |
| messages reporter to emit the same source location information (as |
| prefix) for physical lines that result from the process of breaking |
| a message which is too long to fit on a single line. |
| .IP "\fB\-fdiagnostics\-color[=\fR\fI\s-1WHEN\s0\fR\fB]\fR" 4 |
| .IX Item "-fdiagnostics-color[=WHEN]" |
| .PD 0 |
| .IP "\fB\-fno\-diagnostics\-color\fR" 4 |
| .IX Item "-fno-diagnostics-color" |
| .PD |
| Use color in diagnostics. \fI\s-1WHEN\s0\fR is \fBnever\fR, \fBalways\fR, |
| or \fBauto\fR. The default is \fBnever\fR if \fB\s-1GCC_COLORS\s0\fR environment |
| variable isn't present in the environment, and \fBauto\fR otherwise. |
| \&\fBauto\fR means to use color only when the standard error is a terminal. |
| The forms \fB\-fdiagnostics\-color\fR and \fB\-fno\-diagnostics\-color\fR are |
| aliases for \fB\-fdiagnostics\-color=always\fR and |
| \&\fB\-fdiagnostics\-color=never\fR, respectively. |
| .Sp |
| The colors are defined by the environment variable \fB\s-1GCC_COLORS\s0\fR. |
| Its value is a colon-separated list of capabilities and Select Graphic |
| Rendition (\s-1SGR\s0) substrings. \s-1SGR\s0 commands are interpreted by the |
| terminal or terminal emulator. (See the section in the documentation |
| of your text terminal for permitted values and their meanings as |
| character attributes.) These substring values are integers in decimal |
| representation and can be concatenated with semicolons. |
| Common values to concatenate include |
| \&\fB1\fR for bold, |
| \&\fB4\fR for underline, |
| \&\fB5\fR for blink, |
| \&\fB7\fR for inverse, |
| \&\fB39\fR for default foreground color, |
| \&\fB30\fR to \fB37\fR for foreground colors, |
| \&\fB90\fR to \fB97\fR for 16\-color mode foreground colors, |
| \&\fB38;5;0\fR to \fB38;5;255\fR |
| for 88\-color and 256\-color modes foreground colors, |
| \&\fB49\fR for default background color, |
| \&\fB40\fR to \fB47\fR for background colors, |
| \&\fB100\fR to \fB107\fR for 16\-color mode background colors, |
| and \fB48;5;0\fR to \fB48;5;255\fR |
| for 88\-color and 256\-color modes background colors. |
| .Sp |
| The default \fB\s-1GCC_COLORS\s0\fR is |
| \&\fBerror=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01\fR |
| where \fB01;31\fR is bold red, \fB01;35\fR is bold magenta, |
| \&\fB01;36\fR is bold cyan, \fB01;32\fR is bold green and |
| \&\fB01\fR is bold. Setting \fB\s-1GCC_COLORS\s0\fR to the empty |
| string disables colors. |
| Supported capabilities are as follows. |
| .RS 4 |
| .ie n .IP """error=""" 4 |
| .el .IP "\f(CWerror=\fR" 4 |
| .IX Item "error=" |
| \&\s-1SGR\s0 substring for error: markers. |
| .ie n .IP """warning=""" 4 |
| .el .IP "\f(CWwarning=\fR" 4 |
| .IX Item "warning=" |
| \&\s-1SGR\s0 substring for warning: markers. |
| .ie n .IP """note=""" 4 |
| .el .IP "\f(CWnote=\fR" 4 |
| .IX Item "note=" |
| \&\s-1SGR\s0 substring for note: markers. |
| .ie n .IP """caret=""" 4 |
| .el .IP "\f(CWcaret=\fR" 4 |
| .IX Item "caret=" |
| \&\s-1SGR\s0 substring for caret line. |
| .ie n .IP """locus=""" 4 |
| .el .IP "\f(CWlocus=\fR" 4 |
| .IX Item "locus=" |
| \&\s-1SGR\s0 substring for location information, \fBfile:line\fR or |
| \&\fBfile:line:column\fR etc. |
| .ie n .IP """quote=""" 4 |
| .el .IP "\f(CWquote=\fR" 4 |
| .IX Item "quote=" |
| \&\s-1SGR\s0 substring for information printed within quotes. |
| .RE |
| .RS 4 |
| .RE |
| .IP "\fB\-fno\-diagnostics\-show\-option\fR" 4 |
| .IX Item "-fno-diagnostics-show-option" |
| By default, each diagnostic emitted includes text indicating the |
| command-line option that directly controls the diagnostic (if such an |
| option is known to the diagnostic machinery). Specifying the |
| \&\fB\-fno\-diagnostics\-show\-option\fR flag suppresses that behavior. |
| .IP "\fB\-fno\-diagnostics\-show\-caret\fR" 4 |
| .IX Item "-fno-diagnostics-show-caret" |
| By default, each diagnostic emitted includes the original source line |
| and a caret '^' indicating the column. This option suppresses this |
| information. |
| .SS "Options to Request or Suppress Warnings" |
| .IX Subsection "Options to Request or Suppress Warnings" |
| Warnings are diagnostic messages that report constructions that |
| are not inherently erroneous but that are risky or suggest there |
| may have been an error. |
| .PP |
| The following language-independent options do not enable specific |
| warnings but control the kinds of diagnostics produced by \s-1GCC.\s0 |
| .IP "\fB\-fsyntax\-only\fR" 4 |
| .IX Item "-fsyntax-only" |
| Check the code for syntax errors, but don't do anything beyond that. |
| .IP "\fB\-fmax\-errors=\fR\fIn\fR" 4 |
| .IX Item "-fmax-errors=n" |
| Limits the maximum number of error messages to \fIn\fR, at which point |
| \&\s-1GCC\s0 bails out rather than attempting to continue processing the source |
| code. If \fIn\fR is 0 (the default), there is no limit on the number |
| of error messages produced. If \fB\-Wfatal\-errors\fR is also |
| specified, then \fB\-Wfatal\-errors\fR takes precedence over this |
| option. |
| .IP "\fB\-w\fR" 4 |
| .IX Item "-w" |
| Inhibit all warning messages. |
| .IP "\fB\-Werror\fR" 4 |
| .IX Item "-Werror" |
| Make all warnings into errors. |
| .IP "\fB\-Werror=\fR" 4 |
| .IX Item "-Werror=" |
| Make the specified warning into an error. The specifier for a warning |
| is appended; for example \fB\-Werror=switch\fR turns the warnings |
| controlled by \fB\-Wswitch\fR into errors. This switch takes a |
| negative form, to be used to negate \fB\-Werror\fR for specific |
| warnings; for example \fB\-Wno\-error=switch\fR makes |
| \&\fB\-Wswitch\fR warnings not be errors, even when \fB\-Werror\fR |
| is in effect. |
| .Sp |
| The warning message for each controllable warning includes the |
| option that controls the warning. That option can then be used with |
| \&\fB\-Werror=\fR and \fB\-Wno\-error=\fR as described above. |
| (Printing of the option in the warning message can be disabled using the |
| \&\fB\-fno\-diagnostics\-show\-option\fR flag.) |
| .Sp |
| Note that specifying \fB\-Werror=\fR\fIfoo\fR automatically implies |
| \&\fB\-W\fR\fIfoo\fR. However, \fB\-Wno\-error=\fR\fIfoo\fR does not |
| imply anything. |
| .IP "\fB\-Wfatal\-errors\fR" 4 |
| .IX Item "-Wfatal-errors" |
| This option causes the compiler to abort compilation on the first error |
| occurred rather than trying to keep going and printing further error |
| messages. |
| .PP |
| You can request many specific warnings with options beginning with |
| \&\fB\-W\fR, for example \fB\-Wimplicit\fR to request warnings on |
| implicit declarations. Each of these specific warning options also |
| has a negative form beginning \fB\-Wno\-\fR to turn off warnings; for |
| example, \fB\-Wno\-implicit\fR. This manual lists only one of the |
| two forms, whichever is not the default. For further |
| language-specific options also refer to \fB\*(C+ Dialect Options\fR and |
| \&\fBObjective-C and Objective\-\*(C+ Dialect Options\fR. |
| .PP |
| When an unrecognized warning option is requested (e.g., |
| \&\fB\-Wunknown\-warning\fR), \s-1GCC\s0 emits a diagnostic stating |
| that the option is not recognized. However, if the \fB\-Wno\-\fR form |
| is used, the behavior is slightly different: no diagnostic is |
| produced for \fB\-Wno\-unknown\-warning\fR unless other diagnostics |
| are being produced. This allows the use of new \fB\-Wno\-\fR options |
| with old compilers, but if something goes wrong, the compiler |
| warns that an unrecognized option is present. |
| .IP "\fB\-Wpedantic\fR" 4 |
| .IX Item "-Wpedantic" |
| .PD 0 |
| .IP "\fB\-pedantic\fR" 4 |
| .IX Item "-pedantic" |
| .PD |
| Issue all the warnings demanded by strict \s-1ISO C\s0 and \s-1ISO \*(C+\s0; |
| reject all programs that use forbidden extensions, and some other |
| programs that do not follow \s-1ISO C\s0 and \s-1ISO \*(C+. \s0 For \s-1ISO C,\s0 follows the |
| version of the \s-1ISO C\s0 standard specified by any \fB\-std\fR option used. |
| .Sp |
| Valid \s-1ISO C\s0 and \s-1ISO \*(C+\s0 programs should compile properly with or without |
| this option (though a rare few require \fB\-ansi\fR or a |
| \&\fB\-std\fR option specifying the required version of \s-1ISO C\s0). However, |
| without this option, certain \s-1GNU\s0 extensions and traditional C and \*(C+ |
| features are supported as well. With this option, they are rejected. |
| .Sp |
| \&\fB\-Wpedantic\fR does not cause warning messages for use of the |
| alternate keywords whose names begin and end with \fB_\|_\fR. Pedantic |
| warnings are also disabled in the expression that follows |
| \&\f(CW\*(C`_\|_extension_\|_\*(C'\fR. However, only system header files should use |
| these escape routes; application programs should avoid them. |
| .Sp |
| Some users try to use \fB\-Wpedantic\fR to check programs for strict \s-1ISO |
| C\s0 conformance. They soon find that it does not do quite what they want: |
| it finds some non-ISO practices, but not all\-\-\-only those for which |
| \&\s-1ISO C \s0\fIrequires\fR a diagnostic, and some others for which |
| diagnostics have been added. |
| .Sp |
| A feature to report any failure to conform to \s-1ISO C\s0 might be useful in |
| some instances, but would require considerable additional work and would |
| be quite different from \fB\-Wpedantic\fR. We don't have plans to |
| support such a feature in the near future. |
| .Sp |
| Where the standard specified with \fB\-std\fR represents a \s-1GNU\s0 |
| extended dialect of C, such as \fBgnu90\fR or \fBgnu99\fR, there is a |
| corresponding \fIbase standard\fR, the version of \s-1ISO C\s0 on which the \s-1GNU\s0 |
| extended dialect is based. Warnings from \fB\-Wpedantic\fR are given |
| where they are required by the base standard. (It does not make sense |
| for such warnings to be given only for features not in the specified \s-1GNU |
| C\s0 dialect, since by definition the \s-1GNU\s0 dialects of C include all |
| features the compiler supports with the given option, and there would be |
| nothing to warn about.) |
| .IP "\fB\-pedantic\-errors\fR" 4 |
| .IX Item "-pedantic-errors" |
| Like \fB\-Wpedantic\fR, except that errors are produced rather than |
| warnings. |
| .IP "\fB\-Wall\fR" 4 |
| .IX Item "-Wall" |
| This enables all the warnings about constructions that some users |
| consider questionable, and that are easy to avoid (or modify to |
| prevent the warning), even in conjunction with macros. This also |
| enables some language-specific warnings described in \fB\*(C+ Dialect |
| Options\fR and \fBObjective-C and Objective\-\*(C+ Dialect Options\fR. |
| .Sp |
| \&\fB\-Wall\fR turns on the following warning flags: |
| .Sp |
| \&\fB\-Waddress |
| \&\-Warray\-bounds\fR (only with\fB \fR\fB\-O2\fR) |
| \&\fB\-Wc++11\-compat |
| \&\-Wchar\-subscripts |
| \&\-Wenum\-compare\fR (in C/ObjC; this is on by default in \*(C+) |
| \&\fB\-Wimplicit\-int\fR (C and Objective-C only) |
| \&\fB\-Wimplicit\-function\-declaration\fR (C and Objective-C only) |
| \&\fB\-Wcomment |
| \&\-Wformat |
| \&\-Wmain\fR (only for C/ObjC and unless\fB \fR\fB\-ffreestanding\fR) |
| \&\fB\-Wmaybe\-uninitialized |
| \&\-Wmissing\-braces\fR (only for C/ObjC) |
| \&\fB\-Wnonnull |
| \&\-Wopenmp\-simd |
| \&\-Wparentheses |
| \&\-Wpointer\-sign |
| \&\-Wreorder |
| \&\-Wreturn\-type |
| \&\-Wsequence\-point |
| \&\-Wsign\-compare\fR (only in \*(C+) |
| \&\fB\-Wstrict\-aliasing |
| \&\-Wstrict\-overflow=1 |
| \&\-Wswitch |
| \&\-Wtrigraphs |
| \&\-Wuninitialized |
| \&\-Wunknown\-pragmas |
| \&\-Wunused\-function |
| \&\-Wunused\-label |
| \&\-Wunused\-value |
| \&\-Wunused\-variable |
| \&\-Wvolatile\-register\-var\fR |
| .Sp |
| Note that some warning flags are not implied by \fB\-Wall\fR. Some of |
| them warn about constructions that users generally do not consider |
| questionable, but which occasionally you might wish to check for; |
| others warn about constructions that are necessary or hard to avoid in |
| some cases, and there is no simple way to modify the code to suppress |
| the warning. Some of them are enabled by \fB\-Wextra\fR but many of |
| them must be enabled individually. |
| .IP "\fB\-Wextra\fR" 4 |
| .IX Item "-Wextra" |
| This enables some extra warning flags that are not enabled by |
| \&\fB\-Wall\fR. (This option used to be called \fB\-W\fR. The older |
| name is still supported, but the newer name is more descriptive.) |
| .Sp |
| \&\fB\-Wclobbered |
| \&\-Wempty\-body |
| \&\-Wignored\-qualifiers |
| \&\-Wmissing\-field\-initializers |
| \&\-Wmissing\-parameter\-type\fR (C only) |
| \&\fB\-Wold\-style\-declaration\fR (C only) |
| \&\fB\-Woverride\-init |
| \&\-Wsign\-compare |
| \&\-Wtype\-limits |
| \&\-Wuninitialized |
| \&\-Wunused\-parameter\fR (only with\fB \fR\fB\-Wunused\fR\fB \fRor\fB \fR\fB\-Wall\fR) |
| \&\fB\-Wunused\-but\-set\-parameter\fR (only with\fB \fR\fB\-Wunused\fR\fB \fRor\fB \fR\fB\-Wall\fR) \fB \fR |
| .Sp |
| The option \fB\-Wextra\fR also prints warning messages for the |
| following cases: |
| .RS 4 |
| .IP "\(bu" 4 |
| A pointer is compared against integer zero with \fB<\fR, \fB<=\fR, |
| \&\fB>\fR, or \fB>=\fR. |
| .IP "\(bu" 4 |
| (\*(C+ only) An enumerator and a non-enumerator both appear in a |
| conditional expression. |
| .IP "\(bu" 4 |
| (\*(C+ only) Ambiguous virtual bases. |
| .IP "\(bu" 4 |
| (\*(C+ only) Subscripting an array that has been declared \fBregister\fR. |
| .IP "\(bu" 4 |
| (\*(C+ only) Taking the address of a variable that has been declared |
| \&\fBregister\fR. |
| .IP "\(bu" 4 |
| (\*(C+ only) A base class is not initialized in a derived class's copy |
| constructor. |
| .RE |
| .RS 4 |
| .RE |
| .IP "\fB\-Wchar\-subscripts\fR" 4 |
| .IX Item "-Wchar-subscripts" |
| Warn if an array subscript has type \f(CW\*(C`char\*(C'\fR. This is a common cause |
| of error, as programmers often forget that this type is signed on some |
| machines. |
| This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wcomment\fR" 4 |
| .IX Item "-Wcomment" |
| Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR |
| comment, or whenever a Backslash-Newline appears in a \fB//\fR comment. |
| This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wno\-coverage\-mismatch\fR" 4 |
| .IX Item "-Wno-coverage-mismatch" |
| Warn if feedback profiles do not match when using the |
| \&\fB\-fprofile\-use\fR option. |
| If a source file is changed between compiling with \fB\-fprofile\-gen\fR and |
| with \fB\-fprofile\-use\fR, the files with the profile feedback can fail |
| to match the source file and \s-1GCC\s0 cannot use the profile feedback |
| information. By default, this warning is enabled and is treated as an |
| error. \fB\-Wno\-coverage\-mismatch\fR can be used to disable the |
| warning or \fB\-Wno\-error=coverage\-mismatch\fR can be used to |
| disable the error. Disabling the error for this warning can result in |
| poorly optimized code and is useful only in the |
| case of very minor changes such as bug fixes to an existing code-base. |
| Completely disabling the warning is not recommended. |
| .IP "\fB\-Wno\-cpp\fR" 4 |
| .IX Item "-Wno-cpp" |
| (C, Objective-C, \*(C+, Objective\-\*(C+ and Fortran only) |
| .Sp |
| Suppress warning messages emitted by \f(CW\*(C`#warning\*(C'\fR directives. |
| .IP "\fB\-Wdouble\-promotion\fR (C, \*(C+, Objective-C and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wdouble-promotion (C, , Objective-C and Objective- only)" |
| Give a warning when a value of type \f(CW\*(C`float\*(C'\fR is implicitly |
| promoted to \f(CW\*(C`double\*(C'\fR. CPUs with a 32\-bit \*(L"single-precision\*(R" |
| floating-point unit implement \f(CW\*(C`float\*(C'\fR in hardware, but emulate |
| \&\f(CW\*(C`double\*(C'\fR in software. On such a machine, doing computations |
| using \f(CW\*(C`double\*(C'\fR values is much more expensive because of the |
| overhead required for software emulation. |
| .Sp |
| It is easy to accidentally do computations with \f(CW\*(C`double\*(C'\fR because |
| floating-point literals are implicitly of type \f(CW\*(C`double\*(C'\fR. For |
| example, in: |
| .Sp |
| .Vb 4 |
| \& float area(float radius) |
| \& { |
| \& return 3.14159 * radius * radius; |
| \& } |
| .Ve |
| .Sp |
| the compiler performs the entire computation with \f(CW\*(C`double\*(C'\fR |
| because the floating-point literal is a \f(CW\*(C`double\*(C'\fR. |
| .IP "\fB\-Wformat\fR" 4 |
| .IX Item "-Wformat" |
| .PD 0 |
| .IP "\fB\-Wformat=\fR\fIn\fR" 4 |
| .IX Item "-Wformat=n" |
| .PD |
| Check calls to \f(CW\*(C`printf\*(C'\fR and \f(CW\*(C`scanf\*(C'\fR, etc., to make sure that |
| the arguments supplied have types appropriate to the format string |
| specified, and that the conversions specified in the format string make |
| sense. This includes standard functions, and others specified by format |
| attributes, in the \f(CW\*(C`printf\*(C'\fR, |
| \&\f(CW\*(C`scanf\*(C'\fR, \f(CW\*(C`strftime\*(C'\fR and \f(CW\*(C`strfmon\*(C'\fR (an X/Open extension, |
| not in the C standard) families (or other target-specific families). |
| Which functions are checked without format attributes having been |
| specified depends on the standard version selected, and such checks of |
| functions without the attribute specified are disabled by |
| \&\fB\-ffreestanding\fR or \fB\-fno\-builtin\fR. |
| .Sp |
| The formats are checked against the format features supported by \s-1GNU\s0 |
| libc version 2.2. These include all \s-1ISO C90\s0 and C99 features, as well |
| as features from the Single Unix Specification and some \s-1BSD\s0 and \s-1GNU\s0 |
| extensions. Other library implementations may not support all these |
| features; \s-1GCC\s0 does not support warning about features that go beyond a |
| particular library's limitations. However, if \fB\-Wpedantic\fR is used |
| with \fB\-Wformat\fR, warnings are given about format features not |
| in the selected standard version (but not for \f(CW\*(C`strfmon\*(C'\fR formats, |
| since those are not in any version of the C standard). |
| .RS 4 |
| .IP "\fB\-Wformat=1\fR" 4 |
| .IX Item "-Wformat=1" |
| .PD 0 |
| .IP "\fB\-Wformat\fR" 4 |
| .IX Item "-Wformat" |
| .PD |
| Option \fB\-Wformat\fR is equivalent to \fB\-Wformat=1\fR, and |
| \&\fB\-Wno\-format\fR is equivalent to \fB\-Wformat=0\fR. Since |
| \&\fB\-Wformat\fR also checks for null format arguments for several |
| functions, \fB\-Wformat\fR also implies \fB\-Wnonnull\fR. Some |
| aspects of this level of format checking can be disabled by the |
| options: \fB\-Wno\-format\-contains\-nul\fR, |
| \&\fB\-Wno\-format\-extra\-args\fR, and \fB\-Wno\-format\-zero\-length\fR. |
| \&\fB\-Wformat\fR is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wno\-format\-contains\-nul\fR" 4 |
| .IX Item "-Wno-format-contains-nul" |
| If \fB\-Wformat\fR is specified, do not warn about format strings that |
| contain \s-1NUL\s0 bytes. |
| .IP "\fB\-Wno\-format\-extra\-args\fR" 4 |
| .IX Item "-Wno-format-extra-args" |
| If \fB\-Wformat\fR is specified, do not warn about excess arguments to a |
| \&\f(CW\*(C`printf\*(C'\fR or \f(CW\*(C`scanf\*(C'\fR format function. The C standard specifies |
| that such arguments are ignored. |
| .Sp |
| Where the unused arguments lie between used arguments that are |
| specified with \fB$\fR operand number specifications, normally |
| warnings are still given, since the implementation could not know what |
| type to pass to \f(CW\*(C`va_arg\*(C'\fR to skip the unused arguments. However, |
| in the case of \f(CW\*(C`scanf\*(C'\fR formats, this option suppresses the |
| warning if the unused arguments are all pointers, since the Single |
| Unix Specification says that such unused arguments are allowed. |
| .IP "\fB\-Wno\-format\-zero\-length\fR" 4 |
| .IX Item "-Wno-format-zero-length" |
| If \fB\-Wformat\fR is specified, do not warn about zero-length formats. |
| The C standard specifies that zero-length formats are allowed. |
| .IP "\fB\-Wformat=2\fR" 4 |
| .IX Item "-Wformat=2" |
| Enable \fB\-Wformat\fR plus additional format checks. Currently |
| equivalent to \fB\-Wformat \-Wformat\-nonliteral \-Wformat\-security |
| \&\-Wformat\-y2k\fR. |
| .IP "\fB\-Wformat\-nonliteral\fR" 4 |
| .IX Item "-Wformat-nonliteral" |
| If \fB\-Wformat\fR is specified, also warn if the format string is not a |
| string literal and so cannot be checked, unless the format function |
| takes its format arguments as a \f(CW\*(C`va_list\*(C'\fR. |
| .IP "\fB\-Wformat\-security\fR" 4 |
| .IX Item "-Wformat-security" |
| If \fB\-Wformat\fR is specified, also warn about uses of format |
| functions that represent possible security problems. At present, this |
| warns about calls to \f(CW\*(C`printf\*(C'\fR and \f(CW\*(C`scanf\*(C'\fR functions where the |
| format string is not a string literal and there are no format arguments, |
| as in \f(CW\*(C`printf (foo);\*(C'\fR. This may be a security hole if the format |
| string came from untrusted input and contains \fB\f(CB%n\fB\fR. (This is |
| currently a subset of what \fB\-Wformat\-nonliteral\fR warns about, but |
| in future warnings may be added to \fB\-Wformat\-security\fR that are not |
| included in \fB\-Wformat\-nonliteral\fR.) |
| .IP "\fB\-Wformat\-y2k\fR" 4 |
| .IX Item "-Wformat-y2k" |
| If \fB\-Wformat\fR is specified, also warn about \f(CW\*(C`strftime\*(C'\fR |
| formats that may yield only a two-digit year. |
| .RE |
| .RS 4 |
| .RE |
| .IP "\fB\-Wnonnull\fR" 4 |
| .IX Item "-Wnonnull" |
| Warn about passing a null pointer for arguments marked as |
| requiring a non-null value by the \f(CW\*(C`nonnull\*(C'\fR function attribute. |
| .Sp |
| \&\fB\-Wnonnull\fR is included in \fB\-Wall\fR and \fB\-Wformat\fR. It |
| can be disabled with the \fB\-Wno\-nonnull\fR option. |
| .IP "\fB\-Winit\-self\fR (C, \*(C+, Objective-C and Objective\-\*(C+ only)" 4 |
| .IX Item "-Winit-self (C, , Objective-C and Objective- only)" |
| Warn about uninitialized variables that are initialized with themselves. |
| Note this option can only be used with the \fB\-Wuninitialized\fR option. |
| .Sp |
| For example, \s-1GCC\s0 warns about \f(CW\*(C`i\*(C'\fR being uninitialized in the |
| following snippet only when \fB\-Winit\-self\fR has been specified: |
| .Sp |
| .Vb 5 |
| \& int f() |
| \& { |
| \& int i = i; |
| \& return i; |
| \& } |
| .Ve |
| .Sp |
| This warning is enabled by \fB\-Wall\fR in \*(C+. |
| .IP "\fB\-Wimplicit\-int\fR (C and Objective-C only)" 4 |
| .IX Item "-Wimplicit-int (C and Objective-C only)" |
| Warn when a declaration does not specify a type. |
| This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wimplicit\-function\-declaration\fR (C and Objective-C only)" 4 |
| .IX Item "-Wimplicit-function-declaration (C and Objective-C only)" |
| Give a warning whenever a function is used before being declared. In |
| C99 mode (\fB\-std=c99\fR or \fB\-std=gnu99\fR), this warning is |
| enabled by default and it is made into an error by |
| \&\fB\-pedantic\-errors\fR. This warning is also enabled by |
| \&\fB\-Wall\fR. |
| .IP "\fB\-Wimplicit\fR (C and Objective-C only)" 4 |
| .IX Item "-Wimplicit (C and Objective-C only)" |
| Same as \fB\-Wimplicit\-int\fR and \fB\-Wimplicit\-function\-declaration\fR. |
| This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wignored\-qualifiers\fR (C and \*(C+ only)" 4 |
| .IX Item "-Wignored-qualifiers (C and only)" |
| Warn if the return type of a function has a type qualifier |
| such as \f(CW\*(C`const\*(C'\fR. For \s-1ISO C\s0 such a type qualifier has no effect, |
| since the value returned by a function is not an lvalue. |
| For \*(C+, the warning is only emitted for scalar types or \f(CW\*(C`void\*(C'\fR. |
| \&\s-1ISO C\s0 prohibits qualified \f(CW\*(C`void\*(C'\fR return types on function |
| definitions, so such return types always receive a warning |
| even without this option. |
| .Sp |
| This warning is also enabled by \fB\-Wextra\fR. |
| .IP "\fB\-Wmain\fR" 4 |
| .IX Item "-Wmain" |
| Warn if the type of \fBmain\fR is suspicious. \fBmain\fR should be |
| a function with external linkage, returning int, taking either zero |
| arguments, two, or three arguments of appropriate types. This warning |
| is enabled by default in \*(C+ and is enabled by either \fB\-Wall\fR |
| or \fB\-Wpedantic\fR. |
| .IP "\fB\-Wmissing\-braces\fR" 4 |
| .IX Item "-Wmissing-braces" |
| Warn if an aggregate or union initializer is not fully bracketed. In |
| the following example, the initializer for \fBa\fR is not fully |
| bracketed, but that for \fBb\fR is fully bracketed. This warning is |
| enabled by \fB\-Wall\fR in C. |
| .Sp |
| .Vb 2 |
| \& int a[2][2] = { 0, 1, 2, 3 }; |
| \& int b[2][2] = { { 0, 1 }, { 2, 3 } }; |
| .Ve |
| .Sp |
| This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wmissing\-include\-dirs\fR (C, \*(C+, Objective-C and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wmissing-include-dirs (C, , Objective-C and Objective- only)" |
| Warn if a user-supplied include directory does not exist. |
| .IP "\fB\-Wparentheses\fR" 4 |
| .IX Item "-Wparentheses" |
| Warn if parentheses are omitted in certain contexts, such |
| as when there is an assignment in a context where a truth value |
| is expected, or when operators are nested whose precedence people |
| often get confused about. |
| .Sp |
| Also warn if a comparison like \fBx<=y<=z\fR appears; this is |
| equivalent to \fB(x<=y ? 1 : 0) <= z\fR, which is a different |
| interpretation from that of ordinary mathematical notation. |
| .Sp |
| Also warn about constructions where there may be confusion to which |
| \&\f(CW\*(C`if\*(C'\fR statement an \f(CW\*(C`else\*(C'\fR branch belongs. Here is an example of |
| such a case: |
| .Sp |
| .Vb 7 |
| \& { |
| \& if (a) |
| \& if (b) |
| \& foo (); |
| \& else |
| \& bar (); |
| \& } |
| .Ve |
| .Sp |
| In C/\*(C+, every \f(CW\*(C`else\*(C'\fR branch belongs to the innermost possible |
| \&\f(CW\*(C`if\*(C'\fR statement, which in this example is \f(CW\*(C`if (b)\*(C'\fR. This is |
| often not what the programmer expected, as illustrated in the above |
| example by indentation the programmer chose. When there is the |
| potential for this confusion, \s-1GCC\s0 issues a warning when this flag |
| is specified. To eliminate the warning, add explicit braces around |
| the innermost \f(CW\*(C`if\*(C'\fR statement so there is no way the \f(CW\*(C`else\*(C'\fR |
| can belong to the enclosing \f(CW\*(C`if\*(C'\fR. The resulting code |
| looks like this: |
| .Sp |
| .Vb 9 |
| \& { |
| \& if (a) |
| \& { |
| \& if (b) |
| \& foo (); |
| \& else |
| \& bar (); |
| \& } |
| \& } |
| .Ve |
| .Sp |
| Also warn for dangerous uses of the \s-1GNU\s0 extension to |
| \&\f(CW\*(C`?:\*(C'\fR with omitted middle operand. When the condition |
| in the \f(CW\*(C`?\*(C'\fR: operator is a boolean expression, the omitted value is |
| always 1. Often programmers expect it to be a value computed |
| inside the conditional expression instead. |
| .Sp |
| This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wsequence\-point\fR" 4 |
| .IX Item "-Wsequence-point" |
| Warn about code that may have undefined semantics because of violations |
| of sequence point rules in the C and \*(C+ standards. |
| .Sp |
| The C and \*(C+ standards define the order in which expressions in a C/\*(C+ |
| program are evaluated in terms of \fIsequence points\fR, which represent |
| a partial ordering between the execution of parts of the program: those |
| executed before the sequence point, and those executed after it. These |
| occur after the evaluation of a full expression (one which is not part |
| of a larger expression), after the evaluation of the first operand of a |
| \&\f(CW\*(C`&&\*(C'\fR, \f(CW\*(C`||\*(C'\fR, \f(CW\*(C`? :\*(C'\fR or \f(CW\*(C`,\*(C'\fR (comma) operator, before a |
| function is called (but after the evaluation of its arguments and the |
| expression denoting the called function), and in certain other places. |
| Other than as expressed by the sequence point rules, the order of |
| evaluation of subexpressions of an expression is not specified. All |
| these rules describe only a partial order rather than a total order, |
| since, for example, if two functions are called within one expression |
| with no sequence point between them, the order in which the functions |
| are called is not specified. However, the standards committee have |
| ruled that function calls do not overlap. |
| .Sp |
| It is not specified when between sequence points modifications to the |
| values of objects take effect. Programs whose behavior depends on this |
| have undefined behavior; the C and \*(C+ standards specify that \*(L"Between |
| the previous and next sequence point an object shall have its stored |
| value modified at most once by the evaluation of an expression. |
| Furthermore, the prior value shall be read only to determine the value |
| to be stored.\*(R". If a program breaks these rules, the results on any |
| particular implementation are entirely unpredictable. |
| .Sp |
| Examples of code with undefined behavior are \f(CW\*(C`a = a++;\*(C'\fR, \f(CW\*(C`a[n] |
| = b[n++]\*(C'\fR and \f(CW\*(C`a[i++] = i;\*(C'\fR. Some more complicated cases are not |
| diagnosed by this option, and it may give an occasional false positive |
| result, but in general it has been found fairly effective at detecting |
| this sort of problem in programs. |
| .Sp |
| The standard is worded confusingly, therefore there is some debate |
| over the precise meaning of the sequence point rules in subtle cases. |
| Links to discussions of the problem, including proposed formal |
| definitions, may be found on the \s-1GCC\s0 readings page, at |
| <\fBhttp://gcc.gnu.org/readings.html\fR>. |
| .Sp |
| This warning is enabled by \fB\-Wall\fR for C and \*(C+. |
| .IP "\fB\-Wno\-return\-local\-addr\fR" 4 |
| .IX Item "-Wno-return-local-addr" |
| Do not warn about returning a pointer (or in \*(C+, a reference) to a |
| variable that goes out of scope after the function returns. |
| .IP "\fB\-Wreturn\-type\fR" 4 |
| .IX Item "-Wreturn-type" |
| Warn whenever a function is defined with a return type that defaults |
| to \f(CW\*(C`int\*(C'\fR. Also warn about any \f(CW\*(C`return\*(C'\fR statement with no |
| return value in a function whose return type is not \f(CW\*(C`void\*(C'\fR |
| (falling off the end of the function body is considered returning |
| without a value), and about a \f(CW\*(C`return\*(C'\fR statement with an |
| expression in a function whose return type is \f(CW\*(C`void\*(C'\fR. |
| .Sp |
| For \*(C+, a function without return type always produces a diagnostic |
| message, even when \fB\-Wno\-return\-type\fR is specified. The only |
| exceptions are \fBmain\fR and functions defined in system headers. |
| .Sp |
| This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wswitch\fR" 4 |
| .IX Item "-Wswitch" |
| Warn whenever a \f(CW\*(C`switch\*(C'\fR statement has an index of enumerated type |
| and lacks a \f(CW\*(C`case\*(C'\fR for one or more of the named codes of that |
| enumeration. (The presence of a \f(CW\*(C`default\*(C'\fR label prevents this |
| warning.) \f(CW\*(C`case\*(C'\fR labels outside the enumeration range also |
| provoke warnings when this option is used (even if there is a |
| \&\f(CW\*(C`default\*(C'\fR label). |
| This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wswitch\-default\fR" 4 |
| .IX Item "-Wswitch-default" |
| Warn whenever a \f(CW\*(C`switch\*(C'\fR statement does not have a \f(CW\*(C`default\*(C'\fR |
| case. |
| .IP "\fB\-Wswitch\-enum\fR" 4 |
| .IX Item "-Wswitch-enum" |
| Warn whenever a \f(CW\*(C`switch\*(C'\fR statement has an index of enumerated type |
| and lacks a \f(CW\*(C`case\*(C'\fR for one or more of the named codes of that |
| enumeration. \f(CW\*(C`case\*(C'\fR labels outside the enumeration range also |
| provoke warnings when this option is used. The only difference |
| between \fB\-Wswitch\fR and this option is that this option gives a |
| warning about an omitted enumeration code even if there is a |
| \&\f(CW\*(C`default\*(C'\fR label. |
| .IP "\fB\-Wsync\-nand\fR (C and \*(C+ only)" 4 |
| .IX Item "-Wsync-nand (C and only)" |
| Warn when \f(CW\*(C`_\|_sync_fetch_and_nand\*(C'\fR and \f(CW\*(C`_\|_sync_nand_and_fetch\*(C'\fR |
| built-in functions are used. These functions changed semantics in \s-1GCC 4.4.\s0 |
| .IP "\fB\-Wtrigraphs\fR" 4 |
| .IX Item "-Wtrigraphs" |
| Warn if any trigraphs are encountered that might change the meaning of |
| the program (trigraphs within comments are not warned about). |
| This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wunused\-but\-set\-parameter\fR" 4 |
| .IX Item "-Wunused-but-set-parameter" |
| Warn whenever a function parameter is assigned to, but otherwise unused |
| (aside from its declaration). |
| .Sp |
| To suppress this warning use the \fBunused\fR attribute. |
| .Sp |
| This warning is also enabled by \fB\-Wunused\fR together with |
| \&\fB\-Wextra\fR. |
| .IP "\fB\-Wunused\-but\-set\-variable\fR" 4 |
| .IX Item "-Wunused-but-set-variable" |
| Warn whenever a local variable is assigned to, but otherwise unused |
| (aside from its declaration). |
| This warning is enabled by \fB\-Wall\fR. |
| .Sp |
| To suppress this warning use the \fBunused\fR attribute. |
| .Sp |
| This warning is also enabled by \fB\-Wunused\fR, which is enabled |
| by \fB\-Wall\fR. |
| .IP "\fB\-Wunused\-function\fR" 4 |
| .IX Item "-Wunused-function" |
| Warn whenever a static function is declared but not defined or a |
| non-inline static function is unused. |
| This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wunused\-label\fR" 4 |
| .IX Item "-Wunused-label" |
| Warn whenever a label is declared but not used. |
| This warning is enabled by \fB\-Wall\fR. |
| .Sp |
| To suppress this warning use the \fBunused\fR attribute. |
| .IP "\fB\-Wunused\-local\-typedefs\fR (C, Objective-C, \*(C+ and Objective\-\*(C+ only)" 4 |
| .IX Item "-Wunused-local-typedefs (C, Objective-C, and Objective- only)" |
| Warn when a typedef locally defined in a function is not used. |
| This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wunused\-parameter\fR" 4 |
| .IX Item "-Wunused-parameter" |
| Warn whenever a function parameter is unused aside from its declaration. |
| .Sp |
| To suppress this warning use the \fBunused\fR attribute. |
| .IP "\fB\-Wno\-unused\-result\fR" 4 |
| .IX Item "-Wno-unused-result" |
| Do not warn if a caller of a function marked with attribute |
| \&\f(CW\*(C`warn_unused_result\*(C'\fR does not use |
| its return value. The default is \fB\-Wunused\-result\fR. |
| .IP "\fB\-Wunused\-variable\fR" 4 |
| .IX Item "-Wunused-variable" |
| Warn whenever a local variable or non-constant static variable is unused |
| aside from its declaration. |
| This warning is enabled by \fB\-Wall\fR. |
| .Sp |
| To suppress this warning use the \fBunused\fR attribute. |
| .IP "\fB\-Wunused\-value\fR" 4 |
| .IX Item "-Wunused-value" |
| Warn whenever a statement computes a result that is explicitly not |
| used. To suppress this warning cast the unused expression to |
| \&\fBvoid\fR. This includes an expression-statement or the left-hand |
| side of a comma expression that contains no side effects. For example, |
| an expression such as \fBx[i,j]\fR causes a warning, while |
| \&\fBx[(void)i,j]\fR does not. |
| .Sp |
| This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wunused\fR" 4 |
| .IX Item "-Wunused" |
| All the above \fB\-Wunused\fR options combined. |
| .Sp |
| In order to get a warning about an unused function parameter, you must |
| either specify \fB\-Wextra \-Wunused\fR (note that \fB\-Wall\fR implies |
| \&\fB\-Wunused\fR), or separately specify \fB\-Wunused\-parameter\fR. |
| .IP "\fB\-Wuninitialized\fR" 4 |
| .IX Item "-Wuninitialized" |
| Warn if an automatic variable is used without first being initialized |
| or if a variable may be clobbered by a \f(CW\*(C`setjmp\*(C'\fR call. In \*(C+, |
| warn if a non-static reference or non-static \fBconst\fR member |
| appears in a class without constructors. |
| .Sp |
| If you want to warn about code that uses the uninitialized value of the |
| variable in its own initializer, use the \fB\-Winit\-self\fR option. |
| .Sp |
| These warnings occur for individual uninitialized or clobbered |
| elements of structure, union or array variables as well as for |
| variables that are uninitialized or clobbered as a whole. They do |
| not occur for variables or elements declared \f(CW\*(C`volatile\*(C'\fR. Because |
| these warnings depend on optimization, the exact variables or elements |
| for which there are warnings depends on the precise optimization |
| options and version of \s-1GCC\s0 used. |
| .Sp |
| Note that there may be no warning about a variable that is used only |
| to compute a value that itself is never used, because such |
| computations may be deleted by data flow analysis before the warnings |
| are printed. |
| .IP "\fB\-Wmaybe\-uninitialized\fR" 4 |
| .IX Item "-Wmaybe-uninitialized" |
| For an automatic variable, if there exists a path from the function |
| entry to a use of the variable that is initialized, but there exist |
| some other paths for which the variable is not initialized, the compiler |
| emits a warning if it cannot prove the uninitialized paths are not |
| executed at run time. These warnings are made optional because \s-1GCC\s0 is |
| not smart enough to see all the reasons why the code might be correct |
| in spite of appearing to have an error. Here is one example of how |
| this can happen: |
| .Sp |
| .Vb 12 |
| \& { |
| \& int x; |
| \& switch (y) |
| \& { |
| \& case 1: x = 1; |
| \& break; |
| \& case 2: x = 4; |
| \& break; |
| \& case 3: x = 5; |
| \& } |
| \& foo (x); |
| \& } |
| .Ve |
| .Sp |
| If the value of \f(CW\*(C`y\*(C'\fR is always 1, 2 or 3, then \f(CW\*(C`x\*(C'\fR is |
| always initialized, but \s-1GCC\s0 doesn't know this. To suppress the |
| warning, you need to provide a default case with \fIassert\fR\|(0) or |
| similar code. |
| .Sp |
| This option also warns when a non-volatile automatic variable might be |
| changed by a call to \f(CW\*(C`longjmp\*(C'\fR. These warnings as well are possible |
| only in optimizing compilation. |
| .Sp |
| The compiler sees only the calls to \f(CW\*(C`setjmp\*(C'\fR. It cannot know |
| where \f(CW\*(C`longjmp\*(C'\fR will be called; in fact, a signal handler could |
| call it at any point in the code. As a result, you may get a warning |
| even when there is in fact no problem because \f(CW\*(C`longjmp\*(C'\fR cannot |
| in fact be called at the place that would cause a problem. |
| .Sp |
| Some spurious warnings can be avoided if you declare all the functions |
| you use that never return as \f(CW\*(C`noreturn\*(C'\fR. |
| .Sp |
| This warning is enabled by \fB\-Wall\fR or \fB\-Wextra\fR. |
| .IP "\fB\-Wunknown\-pragmas\fR" 4 |
| .IX Item "-Wunknown-pragmas" |
| Warn when a \f(CW\*(C`#pragma\*(C'\fR directive is encountered that is not understood by |
| \&\s-1GCC. \s0 If this command-line option is used, warnings are even issued |
| for unknown pragmas in system header files. This is not the case if |
| the warnings are only enabled by the \fB\-Wall\fR command-line option. |
| .IP "\fB\-Wno\-pragmas\fR" 4 |
| .IX Item "-Wno-pragmas" |
| Do not warn about misuses of pragmas, such as incorrect parameters, |
| invalid syntax, or conflicts between pragmas. See also |
| \&\fB\-Wunknown\-pragmas\fR. |
| .IP "\fB\-Wstrict\-aliasing\fR" 4 |
| .IX Item "-Wstrict-aliasing" |
| This option is only active when \fB\-fstrict\-aliasing\fR is active. |
| It warns about code that might break the strict aliasing rules that the |
| compiler is using for optimization. The warning does not catch all |
| cases, but does attempt to catch the more common pitfalls. It is |
| included in \fB\-Wall\fR. |
| It is equivalent to \fB\-Wstrict\-aliasing=3\fR |
| .IP "\fB\-Wstrict\-aliasing=n\fR" 4 |
| .IX Item "-Wstrict-aliasing=n" |
| This option is only active when \fB\-fstrict\-aliasing\fR is active. |
| It warns about code that might break the strict aliasing rules that the |
| compiler is using for optimization. |
| Higher levels correspond to higher accuracy (fewer false positives). |
| Higher levels also correspond to more effort, similar to the way \fB\-O\fR |
| works. |
| \&\fB\-Wstrict\-aliasing\fR is equivalent to \fB\-Wstrict\-aliasing=3\fR. |
| .Sp |
| Level 1: Most aggressive, quick, least accurate. |
| Possibly useful when higher levels |
| do not warn but \fB\-fstrict\-aliasing\fR still breaks the code, as it has very few |
| false negatives. However, it has many false positives. |
| Warns for all pointer conversions between possibly incompatible types, |
| even if never dereferenced. Runs in the front end only. |
| .Sp |
| Level 2: Aggressive, quick, not too precise. |
| May still have many false positives (not as many as level 1 though), |
| and few false negatives (but possibly more than level 1). |
| Unlike level 1, it only warns when an address is taken. Warns about |
| incomplete types. Runs in the front end only. |
| .Sp |
| Level 3 (default for \fB\-Wstrict\-aliasing\fR): |
| Should have very few false positives and few false |
| negatives. Slightly slower than levels 1 or 2 when optimization is enabled. |
| Takes care of the common pun+dereference pattern in the front end: |
| \&\f(CW\*(C`*(int*)&some_float\*(C'\fR. |
| If optimization is enabled, it also runs in the back end, where it deals |
| with multiple statement cases using flow-sensitive points-to information. |
| Only warns when the converted pointer is dereferenced. |
| Does not warn about incomplete types. |
| .IP "\fB\-Wstrict\-overflow\fR" 4 |
| .IX Item "-Wstrict-overflow" |
| .PD 0 |
| .IP "\fB\-Wstrict\-overflow=\fR\fIn\fR" 4 |
| .IX Item "-Wstrict-overflow=n" |
| .PD |
| This option is only active when \fB\-fstrict\-overflow\fR is active. |
| It warns about cases where the compiler optimizes based on the |
| assumption that signed overflow does not occur. Note that it does not |
| warn about all cases where the code might overflow: it only warns |
| about cases where the compiler implements some optimization. Thus |
| this warning depends on the optimization level. |
| .Sp |
| An optimization that assumes that signed overflow does not occur is |
| perfectly safe if the values of the variables involved are such that |
| overflow never does, in fact, occur. Therefore this warning can |
| easily give a false positive: a warning about code that is not |
| actually a problem. To help focus on important issues, several |
| warning levels are defined. No warnings are issued for the use of |
| undefined signed overflow when estimating how many iterations a loop |
| requires, in particular when determining whether a loop will be |
| executed at all. |
| .RS 4 |
| .IP "\fB\-Wstrict\-overflow=1\fR" 4 |
| .IX Item "-Wstrict-overflow=1" |
| Warn about cases that are both questionable and easy to avoid. For |
| example, with \fB\-fstrict\-overflow\fR, the compiler simplifies |
| \&\f(CW\*(C`x + 1 > x\*(C'\fR to \f(CW1\fR. This level of |
| \&\fB\-Wstrict\-overflow\fR is enabled by \fB\-Wall\fR; higher levels |
| are not, and must be explicitly requested. |
| .IP "\fB\-Wstrict\-overflow=2\fR" 4 |
| .IX Item "-Wstrict-overflow=2" |
| Also warn about other cases where a comparison is simplified to a |
| constant. For example: \f(CW\*(C`abs (x) >= 0\*(C'\fR. This can only be |
| simplified when \fB\-fstrict\-overflow\fR is in effect, because |
| \&\f(CW\*(C`abs (INT_MIN)\*(C'\fR overflows to \f(CW\*(C`INT_MIN\*(C'\fR, which is less than |
| zero. \fB\-Wstrict\-overflow\fR (with no level) is the same as |
| \&\fB\-Wstrict\-overflow=2\fR. |
| .IP "\fB\-Wstrict\-overflow=3\fR" 4 |
| .IX Item "-Wstrict-overflow=3" |
| Also warn about other cases where a comparison is simplified. For |
| example: \f(CW\*(C`x + 1 > 1\*(C'\fR is simplified to \f(CW\*(C`x > 0\*(C'\fR. |
| .IP "\fB\-Wstrict\-overflow=4\fR" 4 |
| .IX Item "-Wstrict-overflow=4" |
| Also warn about other simplifications not covered by the above cases. |
| For example: \f(CW\*(C`(x * 10) / 5\*(C'\fR is simplified to \f(CW\*(C`x * 2\*(C'\fR. |
| .IP "\fB\-Wstrict\-overflow=5\fR" 4 |
| .IX Item "-Wstrict-overflow=5" |
| Also warn about cases where the compiler reduces the magnitude of a |
| constant involved in a comparison. For example: \f(CW\*(C`x + 2 > y\*(C'\fR is |
| simplified to \f(CW\*(C`x + 1 >= y\*(C'\fR. This is reported only at the |
| highest warning level because this simplification applies to many |
| comparisons, so this warning level gives a very large number of |
| false positives. |
| .RE |
| .RS 4 |
| .RE |
| .IP "\fB\-Wsuggest\-attribute=\fR[\fBpure\fR|\fBconst\fR|\fBnoreturn\fR|\fBformat\fR]" 4 |
| .IX Item "-Wsuggest-attribute=[pure|const|noreturn|format]" |
| Warn for cases where adding an attribute may be beneficial. The |
| attributes currently supported are listed below. |
| .RS 4 |
| .IP "\fB\-Wsuggest\-attribute=pure\fR" 4 |
| .IX Item "-Wsuggest-attribute=pure" |
| .PD 0 |
| .IP "\fB\-Wsuggest\-attribute=const\fR" 4 |
| .IX Item "-Wsuggest-attribute=const" |
| .IP "\fB\-Wsuggest\-attribute=noreturn\fR" 4 |
| .IX Item "-Wsuggest-attribute=noreturn" |
| .PD |
| Warn about functions that might be candidates for attributes |
| \&\f(CW\*(C`pure\*(C'\fR, \f(CW\*(C`const\*(C'\fR or \f(CW\*(C`noreturn\*(C'\fR. The compiler only warns for |
| functions visible in other compilation units or (in the case of \f(CW\*(C`pure\*(C'\fR and |
| \&\f(CW\*(C`const\*(C'\fR) if it cannot prove that the function returns normally. A function |
| returns normally if it doesn't contain an infinite loop or return abnormally |
| by throwing, calling \f(CW\*(C`abort()\*(C'\fR or trapping. This analysis requires option |
| \&\fB\-fipa\-pure\-const\fR, which is enabled by default at \fB\-O\fR and |
| higher. Higher optimization levels improve the accuracy of the analysis. |
| .IP "\fB\-Wsuggest\-attribute=format\fR" 4 |
| .IX Item "-Wsuggest-attribute=format" |
| .PD 0 |
| .IP "\fB\-Wmissing\-format\-attribute\fR" 4 |
| .IX Item "-Wmissing-format-attribute" |
| .PD |
| Warn about function pointers that might be candidates for \f(CW\*(C`format\*(C'\fR |
| attributes. Note these are only possible candidates, not absolute ones. |
| \&\s-1GCC\s0 guesses that function pointers with \f(CW\*(C`format\*(C'\fR attributes that |
| are used in assignment, initialization, parameter passing or return |
| statements should have a corresponding \f(CW\*(C`format\*(C'\fR attribute in the |
| resulting type. I.e. the left-hand side of the assignment or |
| initialization, the type of the parameter variable, or the return type |
| of the containing function respectively should also have a \f(CW\*(C`format\*(C'\fR |
| attribute to avoid the warning. |
| .Sp |
| \&\s-1GCC\s0 also warns about function definitions that might be |
| candidates for \f(CW\*(C`format\*(C'\fR attributes. Again, these are only |
| possible candidates. \s-1GCC\s0 guesses that \f(CW\*(C`format\*(C'\fR attributes |
| might be appropriate for any function that calls a function like |
| \&\f(CW\*(C`vprintf\*(C'\fR or \f(CW\*(C`vscanf\*(C'\fR, but this might not always be the |
| case, and some functions for which \f(CW\*(C`format\*(C'\fR attributes are |
| appropriate may not be detected. |
| .RE |
| .RS 4 |
| .RE |
| .IP "\fB\-Warray\-bounds\fR" 4 |
| .IX Item "-Warray-bounds" |
| This option is only active when \fB\-ftree\-vrp\fR is active |
| (default for \fB\-O2\fR and above). It warns about subscripts to arrays |
| that are always out of bounds. This warning is enabled by \fB\-Wall\fR. |
| .IP "\fB\-Wno\-div\-by\-zero\fR" 4 |
| .IX Item "-Wno-div-by-zero" |
| Do not warn about compile-time integer division by zero. Floating-point |
| division by zero is not warned about, as it can be a legitimate way of |
| obtaining infinities and NaNs. |
| .IP "\fB\-Wsystem\-headers\fR" 4 |
| .IX Item "-Wsystem-headers" |
| Print warning messages for constructs found in system header files. |
| Warnings from system headers are normally suppressed, on the assumption |
| that they usually do not indicate real problems and would only make the |
| compiler output harder to read. Using this command-line option tells |
| \&\s-1GCC\s0 to emit warnings from system headers as if they occurred in user |
| code. However, note that using \fB\-Wall\fR in conjunction with this |
| option does \fInot\fR warn about unknown pragmas in system |
| headers\-\-\-for that, \fB\-Wunknown\-pragmas\fR must also be used. |
| .IP "\fB\-Wtrampolines\fR" 4 |
| .IX Item "-Wtrampolines" |
| .Vb 1 |
| \& Warn about trampolines generated for pointers to nested functions. |
| \& |
| \& A trampoline is a small piece of data or code that is created at run |
| \& time on the stack when the address of a nested function is taken, and |
| \& is used to call the nested function indirectly. For some targets, it |
| \& is made up of data only and thus requires no special treatment. But, |
| \& for most targets, it is made up of code and thus requires the stack |
| \& to be made executable in order for the program to work properly. |
| .Ve |
| .IP "\fB\-Wfloat\-equal\fR" 4 |
| .IX Item "-Wfloat-equal" |
| Warn if floating-point values are used in equality comparisons. |
| .Sp |
| The idea behind this is that sometimes it is convenient (for the |
| programmer) to consider floating-point values as approximations to |
| infinitely precise real numbers. If you are doing this, then you need |
| to compute (by analyzing the code, or in some other way) the maximum or |
| likely maximum error that the computation introduces, and allow for it |
| when performing comparisons (and when producing output, but that's a |
| different problem). In particular, instead of testing for equality, you |
| should check to see whether the two values have ranges that overlap; and |
| this is done with the relational operators, so equality comparisons are |
| probably mistaken. |
| .IP "\fB\-Wtraditional\fR (C and Objective-C only)" 4 |
| .IX Item "-Wtraditional (C and Objective-C only)" |
| Warn about certain constructs that behave differently in traditional and |
| \&\s-1ISO C. \s0 Also warn about \s-1ISO C\s0 constructs that have no traditional C |
| equivalent, and/or problematic constructs that should be avoided. |
| .RS 4 |
| .IP "\(bu" 4 |
| Macro parameters that appear within string literals in the macro body. |
| In traditional C macro replacement takes place within string literals, |
| but in \s-1ISO C\s0 it does not. |
| .IP "\(bu" 4 |
| In traditional C, some preprocessor directives did not exist. |
| Traditional preprocessors only considered a line to be a directive |
| if the \fB#\fR appeared in column 1 on the line. Therefore |
| \&\fB\-Wtraditional\fR warns about directives that traditional C |
| understands but ignores because the \fB#\fR does not appear as the |
| first character on the line. It also suggests you hide directives like |
| \&\fB#pragma\fR not understood by traditional C by indenting them. Some |
| traditional implementations do not recognize \fB#elif\fR, so this option |
| suggests avoiding it altogether. |
| .IP "\(bu" 4 |
| A function-like macro that appears without arguments. |
| .IP "\(bu" 4 |
| The unary plus operator. |
| .IP "\(bu" 4 |
| The \fBU\fR integer constant suffix, or the \fBF\fR or \fBL\fR floating-point |
| constant suffixes. (Traditional C does support the \fBL\fR suffix on integer |
| constants.) Note, these suffixes appear in macros defined in the system |
| headers of most modern systems, e.g. the \fB_MIN\fR/\fB_MAX\fR macros in \f(CW\*(C`<limits.h>\*(C'\fR. |
| Use of these macros in user code might normally lead to spurious |
| warnings, however \s-1GCC\s0's integrated preprocessor has enough context to |
| avoid warning in these cases. |
| .IP "\(bu" 4 |
| A function declared external in one block and then used after the end of |
| the block. |
| .IP "\(bu" 4 |
| A \f(CW\*(C`switch\*(C'\fR statement has an operand of type \f(CW\*(C`long\*(C'\fR. |
| .IP "\(bu" 4 |
| A non\-\f(CW\*(C`static\*(C'\fR function declaration follows a \f(CW\*(C`static\*(C'\fR one. |
| This construct is not accepted by some traditional C compilers. |
| .IP "\(bu" 4 |
| The \s-1ISO\s0 type of an integer constant has a different width or |
| signedness from its traditional type. This warning is only issued if |
| the base of the constant is ten. I.e. hexadecimal or octal values, which |
| typically represent bit patterns, are not warned about. |
| .IP "\(bu" 4 |
| Usage of \s-1ISO\s0 string concatenation is detected. |
| .IP "\(bu" 4 |
| Initialization of automatic aggregates. |
| .IP "\(bu" 4 |
| Identifier conflicts with labels. Traditional C lacks a separate |
| namespace for labels. |
| .IP "\(bu" 4 |
| Initialization of unions. If the initializer is zero, the warning is |
| omitted. This is done under the assumption that the zero initializer in |
| user code appears conditioned on e.g. \f(CW\*(C`_\|_STDC_\|_\*(C'\fR to avoid missing |
| initializer warnings and relies on default initialization to zero in the |
| traditional C case. |
| .IP "\(bu" 4 |
| Conversions by prototypes between fixed/floating\-point values and vice |
| versa. The absence of these prototypes when compiling with traditional |
| C causes serious problems. This is a subset of the possible |
| conversion warnings; for the full set use \fB\-Wtraditional\-conversion\fR. |
| .IP "\(bu" 4 |
| Use of \s-1ISO C\s0 style function definitions. This warning intentionally is |
|