blob: 96c682457841a5ddfec37963c78436fdb1f546e5 [file] [log] [blame]
.\" 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 "2013-04-12" "gcc-4.6.4" "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\-pedantic\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 would be \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\-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\-fno\-asm \-fno\-builtin \-fno\-builtin\-\fR\fIfunction\fR
\&\fB\-fhosted \-ffreestanding \-fopenmp \-fms\-extensions \-fplan9\-extensions
\&\-trigraphs \-no\-integrated\-cpp \-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
\&\-fconserve\-space \-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\-depth=\fR\fIn\fR
\&\fB\-fno\-threadsafe\-statics \-fuse\-cxa\-atexit \-fno\-weak \-nostdinc++
\&\-fno\-default\-inline \-fvisibility\-inlines\-hidden
\&\-fvisibility\-ms\-compat
\&\-Wabi \-Wconversion\-null \-Wctor\-dtor\-privacy
\&\-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\-fno\-diagnostics\-show\-option\fR
.IP "\fIWarning Options\fR" 4
.IX Item "Warning Options"
\&\fB\-fsyntax\-only \-fmax\-errors=\fR\fIn\fR \fB\-pedantic
\&\-pedantic\-errors
\&\-w \-Wextra \-Wall \-Waddress \-Waggregate\-return \-Warray\-bounds
\&\-Wno\-attributes \-Wno\-builtin\-macro\-redefined
\&\-Wc++\-compat \-Wc++0x\-compat \-Wcast\-align \-Wcast\-qual
\&\-Wchar\-subscripts \-Wclobbered \-Wcomment
\&\-Wconversion \-Wcoverage\-mismatch \-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\-Wjump\-misses\-init \-Wignored\-qualifiers
\&\-Wimplicit \-Wimplicit\-function\-declaration \-Wimplicit\-int
\&\-Winit\-self \-Winline
\&\-Wno\-int\-to\-pointer\-cast \-Wno\-invalid\-offsetof
\&\-Winvalid\-pch \-Wlarger\-than=\fR\fIlen\fR \fB\-Wunsafe\-loop\-optimizations
\&\-Wlogical\-op \-Wlong\-long
\&\-Wmain \-Wmissing\-braces \-Wmissing\-field\-initializers
\&\-Wmissing\-format\-attribute \-Wmissing\-include\-dirs
\&\-Wno\-mudflap
\&\-Wno\-multichar \-Wnonnull \-Wno\-overflow
\&\-Woverlength\-strings \-Wpacked \-Wpacked\-bitfield\-compat \-Wpadded
\&\-Wparentheses \-Wpedantic\-ms\-format \-Wno\-pedantic\-ms\-format
\&\-Wpointer\-arith \-Wno\-pointer\-to\-int\-cast
\&\-Wredundant\-decls
\&\-Wreturn\-type \-Wsequence\-point \-Wshadow
\&\-Wsign\-compare \-Wsign\-conversion \-Wstack\-protector
\&\-Wstrict\-aliasing \-Wstrict\-aliasing=n
\&\-Wstrict\-overflow \-Wstrict\-overflow=\fR\fIn\fR
\&\fB\-Wsuggest\-attribute=\fR[\fBpure\fR|\fBconst\fR|\fBnoreturn\fR]
\&\fB\-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\-parameter \-Wno\-unused\-result \-Wunused\-value
\&\-Wunused\-variable \-Wunused\-but\-set\-parameter \-Wunused\-but\-set\-variable
\&\-Wvariadic\-macros \-Wvla \-Wvolatile\-register\-var \-Wwrite\-strings\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
\&\-fdbg\-cnt\-list \-fdbg\-cnt=\fR\fIcounter-value-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\-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\-vcg \-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\-mudflap\fR[\fB\-\fR\fIn\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\-vrp\fR[\fB\-\fR\fIn\fR]
\&\fB\-ftree\-vectorizer\-verbose=\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 \-feliminate\-unused\-debug\-types
\&\-feliminate\-unused\-debug\-symbols \-femit\-class\-debug\-always
\&\-fenable\-icf\-debug
\&\-fmem\-report \-fpre\-ipa\-mem\-report \-fpost\-ipa\-mem\-report \-fprofile\-arcs
\&\-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 \-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\-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 \-fdce \-fdelayed\-branch
\&\-fdelete\-null\-pointer\-checks \-fdse \-fdevirtualize \-fdse
\&\-fearly\-inlining \-fipa\-sra \-fexpensive\-optimizations \-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 \-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\-matrix\-reorg
\&\-fipa\-pta \-fipa\-profile \-fipa\-pure\-const \-fipa\-reference
\&\-fipa\-struct\-reorg \-fira\-algorithm=\fR\fIalgorithm\fR
\&\fB\-fira\-region=\fR\fIregion\fR
\&\fB\-fira\-loop\-pressure \-fno\-ira\-share\-save\-slots
\&\-fno\-ira\-share\-spill\-slots \-fira\-verbose=\fR\fIn\fR
\&\fB\-fivopts \-fkeep\-inline\-functions \-fkeep\-static\-consts
\&\-floop\-block \-floop\-flatten \-floop\-interchange \-floop\-strip\-mine
\&\-floop\-parallelize\-all \-flto \-flto\-compression\-level
\&\-flto\-partition=\fR\fIalg\fR \fB\-flto\-report \-fmerge\-all\-constants
\&\-fmerge\-constants \-fmodulo\-sched \-fmodulo\-sched\-allow\-regmoves
\&\-fmove\-loop\-invariants fmudflap \-fmudflapir \-fmudflapth \-fno\-branch\-count\-reg
\&\-fno\-default\-inline
\&\-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\-register\-move \-foptimize\-sibling\-calls
\&\-fpartial\-inlining \-fpeel\-loops \-fpredictive\-commoning
\&\-fprefetch\-loop\-arrays
\&\-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
\&\-freciprocal\-math \-fregmove \-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
\&\-fsignaling\-nans \-fsingle\-precision\-constant \-fsplit\-ivs\-in\-unroller
\&\-fsplit\-wide\-types \-fstack\-protector \-fstack\-protector\-all
\&\-fstrict\-aliasing \-fstrict\-overflow \-fthread\-jumps \-ftracer
\&\-ftree\-bit\-ccp
\&\-ftree\-builtin\-call\-dce \-ftree\-ccp \-ftree\-ch \-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\-parallelize\-loops=\fR\fIn\fR \fB\-ftree\-pre \-ftree\-pta \-ftree\-reassoc
\&\-ftree\-sink \-ftree\-sra \-ftree\-switch\-conversion
\&\-ftree\-ter \-ftree\-vect\-loop\-version \-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\-linker\-plugin
\&\-\-param\fR \fIname\fR\fB=\fR\fIvalue\fR
\&\fB\-O \-O0 \-O1 \-O2 \-O3 \-Os \-Ofast\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 \-fworking\-directory \-remap
\&\-trigraphs \-undef \-U\fR\fImacro\fR \fB\-Wp,\fR\fIoption\fR
\&\fB\-Xpreprocessor\fR \fIoption\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++ \-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
\&\-iquote\fIdir\fR \-L\fIdir\fR \-specs=\fIfile\fR \-I\-
\&\-\-sysroot=\fIdir\fR
.IP "\fIMachine Dependent Options\fR" 4
.IX Item "Machine Dependent Options"
\&\fI\s-1ARC\s0 Options\fR
\&\fB\-EB \-EL
\&\-mmangle\-cpu \-mcpu=\fR\fIcpu\fR \fB\-mtext=\fR\fItext-section\fR
\&\fB\-mdata=\fR\fIdata-section\fR \fB\-mrodata=\fR\fIreadonly-data-section\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\-msoft\-float \-mhard\-float \-mfpe
\&\-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
\&\-mcirrus\-fix\-invalid\-insns \-mno\-cirrus\-fix\-invalid\-insns
\&\-mpoke\-function\-name
\&\-mthumb \-marm
\&\-mtpcs\-frame \-mtpcs\-leaf\-frame
\&\-mcaller\-super\-interworking \-mcallee\-super\-interworking
\&\-mtp=\fR\fIname\fR
\&\fB\-mword\-relocations
\&\-mfix\-cortex\-m3\-ldrd\fR
.Sp
\&\fI\s-1AVR\s0 Options\fR
\&\fB\-mmcu=\fR\fImcu\fR \fB\-mno\-interrupts
\&\-mcall\-prologues \-mtiny\-stack \-mint8\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
\&\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-1CRX\s0 Options\fR
\&\fB\-mmac \-mpush\-args\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 \-malpha\-as \-mgas
\&\-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-1DEC\s0 Alpha/VMS Options\fR
\&\fB\-mvms\-return\-codes \-mdebug\-main=\fR\fIprefix\fR \fB\-mmalloc64\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 \-mint32 \-malign\-300\fR
.Sp
\&\fI\s-1HPPA\s0 Options\fR
\&\fB\-march=\fR\fIarchitecture-type\fR
\&\fB\-mbig\-switch \-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\-big\-switch \-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\-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
\&\-mvzeroupper \-mprefer\-avx128
\&\-mmmx \-msse \-msse2 \-msse3 \-mssse3 \-msse4.1 \-msse4.2 \-msse4 \-mavx
\&\-maes \-mpclmul \-mfsgsbase \-mrdrnd \-mf16c \-mfused\-madd
\&\-msse4a \-m3dnow \-mpopcnt \-mabm \-mbmi \-mtbm \-mfma4 \-mxop \-mlwp
\&\-mthreads \-mno\-align\-stringops \-minline\-all\-stringops
\&\-minline\-stringops\-dynamically \-mstringop\-strategy=\fR\fIalg\fR
\&\fB\-mpush\-args \-maccumulate\-outgoing\-args \-m128bit\-long\-double
\&\-m96bit\-long\-double \-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\-m32 \-m64 \-mlarge\-data\-threshold=\fR\fInum\fR
\&\fB\-msse2avx \-mfentry \-m8bit\-idiv
\&\-mavx256\-split\-unaligned\-load \-mavx256\-split\-unaligned\-store\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-1IA\-64/VMS\s0 Options\fR
\&\fB\-mvms\-return\-codes \-mdebug\-main=\fR\fIprefix\fR \fB\-mmalloc64\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
\&\fIM68hc1x Options\fR
\&\fB\-m6811 \-m6812 \-m68hc11 \-m68hc12 \-m68hcs12
\&\-mauto\-incdec \-minmax \-mlong\-calls \-mshort
\&\-msoft\-reg\-count=\fR\fIcount\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
\&\-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\-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
\&\-msingle\-float \-mdouble\-float \-mdsp \-mno\-dsp \-mdspr2 \-mno\-dspr2
\&\-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 \-mfused\-madd \-mno\-fused\-madd \-nocpp
\&\-mfix\-r4000 \-mno\-fix\-r4000 \-mfix\-r4400 \-mno\-fix\-r4400
\&\-mfix\-r10000 \-mno\-fix\-r10000 \-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\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-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\-mpower \-mno\-power \-mpower2 \-mno\-power2
\&\-mpowerpc \-mpowerpc64 \-mno\-powerpc
\&\-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
\&\-mnew\-mnemonics \-mold\-mnemonics
\&\-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\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=
\&\-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\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\-madjust\-unroll \-mindexed\-addressing \-mgettrcost=\fR\fInumber\fR \fB\-mpt\-fixed
\&\-maccumulate\-outgoing\-args \-minvalid\-symbols\fR
.Sp
\&\fISolaris 2 Options\fR
\&\fB\-mimpure\-text \-mno\-impure\-text
\&\-threads \-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\-m32 \-m64 \-mapp\-regs \-mno\-app\-regs
\&\-mfaster\-structs \-mno\-faster\-structs
\&\-mfpu \-mno\-fpu \-mhard\-float \-msoft\-float
\&\-mhard\-quad\-float \-msoft\-quad\-float
\&\-mlittle\-endian
\&\-mstack\-bias \-mno\-stack\-bias
\&\-munaligned\-doubles \-mno\-unaligned\-doubles
\&\-mv8plus \-mno\-v8plus \-mvis \-mno\-vis
\&\-mfix\-at697f\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
\&\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 \-mbig\-switch\fR
.Sp
\&\fI\s-1VAX\s0 Options\fR
\&\fB\-mg \-mgnu \-munix\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 \-funwind\-tables
\&\-fasynchronous\-unwind\-tables
\&\-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\-ftrapv \-fwrapv \-fbounds\-check
\&\-fvisibility \-fstrict\-volatile\-bitfields\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 which must be preprocessed.
.IP "\fIfile\fR\fB.i\fR" 4
.IX Item "file.i"
C source code which should not be preprocessed.
.IP "\fIfile\fR\fB.ii\fR" 4
.IX Item "file.ii"
\&\*(C+ source code which 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 which 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 which 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 which 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 which must be preprocessed.
.IP "\fIfile\fR\fB.mii\fR" 4
.IX Item "file.mii"
Objective\-\*(C+ source code which 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 which 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 which 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 which 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 which 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 which 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 which 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 will exit 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 will instead return with
numerically highest error produced by any phase that returned an error
indication. The C, \*(C+, and Fortran frontends 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 which 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 regardless 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 will also be 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 which
have no documentation associated with them will also be 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"
This will display all of the optimization options supported by the
compiler.
.IP "\fBwarnings\fR" 4
.IX Item "warnings"
This will display all of the options controlling warning messages
produced by the compiler.
.IP "\fBtarget\fR" 4
.IX Item "target"
This will display target-specific options. Unlike the
\&\fB\-\-target\-help\fR option however, target-specific options of the
linker and assembler will not be displayed. This is because those
tools do not currently support the extended \fB\-\-help=\fR syntax.
.IP "\fBparams\fR" 4
.IX Item "params"
This will display the values recognized by the \fB\-\-param\fR
option.
.IP "\fIlanguage\fR" 4
.IX Item "language"
This will 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"
This will 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 which are undocumented.
.IP "\fBjoined\fR" 4
.IX Item "joined"
Display options which take 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 which take 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 the following can be used:
.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), which have a description the following can be used:
.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 by so much that there is nothing to display. One
case where it does work however is when one of the classes is
\&\fItarget\fR. So for example to display all the target-specific
optimization options the following can be used:
.Sp
.Vb 1
\& \-\-help=target,optimizers
.Ve
.Sp
The \fB\-\-help=\fR option can be repeated on the command line. Each
successive use will display 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 will invoke all subprograms of \fBgcc\fR under
\&\fBgdb \-\-args\fR, thus the invocation of \fBcc1\fR will be
\&\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\-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 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, and automatically specifies linking
against the \*(C+ library. 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\-pedantic\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 would normally be 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. By specifying a base standard, the
compiler will accept all programs following that standard and 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, by specifying a \s-1GNU\s0 dialect of a
standard, all features the compiler support are enabled, even when
those features change the meaning of the base standard and some
strict-conforming programs may be rejected. The particular standard
is used by \fB\-pedantic\fR to identify which features are \s-1GNU\s0
extensions given that version of the standard. For example
\&\fB\-std=gnu90 \-pedantic\fR would warn about \*(C+ style \fB//\fR
comments, while \fB\-std=gnu99 \-pedantic\fR would 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 Note that this standard is not yet fully supported; see
<\fBhttp://gcc.gnu.org/gcc\-4.6/c99status.html\fR> for more information. The
names \fBc9x\fR and \fBiso9899:199x\fR are deprecated.
.IP "\fBc1x\fR" 4
.IX Item "c1x"
\&\s-1ISO C1X,\s0 the draft of the next revision of the \s-1ISO C\s0 standard.
Support is limited and experimental and features enabled by this
option may be changed or removed if changed in or removed from the
standard draft.
.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 When \s-1ISO C99\s0 is fully implemented in \s-1GCC,\s0
this will become the default. The name \fBgnu9x\fR is deprecated.
.IP "\fBgnu1x\fR" 4
.IX Item "gnu1x"
\&\s-1GNU\s0 dialect of \s-1ISO C1X. \s0 Support is limited and experimental and
features enabled by this option may be changed or removed if changed
in or removed from the standard draft.
.IP "\fBc++98\fR" 4
.IX Item "c++98"
The 1998 \s-1ISO \*(C+\s0 standard plus amendments. Same as \fB\-ansi\fR for
\&\*(C+ code.
.IP "\fBgnu++98\fR" 4
.IX Item "gnu++98"
\&\s-1GNU\s0 dialect of \fB\-std=c++98\fR. This is the default for
\&\*(C+ code.
.IP "\fBc++0x\fR" 4
.IX Item "c++0x"
The working draft of the upcoming \s-1ISO\s0 \*(C+0x standard. This option
enables experimental features that are likely to be included in
\&\*(C+0x. The working draft is constantly changing, and any feature that is
enabled by this flag may be removed from future versions of \s-1GCC\s0 if it is
not part of the \*(C+0x standard.
.IP "\fBgnu++0x\fR" 4
.IX Item "gnu++0x"
\&\s-1GNU\s0 dialect of \fB\-std=c++0x\fR. This option enables
experimental features that may be removed in future versions of \s-1GCC.\s0
.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\-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 that 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 takes place in 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 takes place in 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 v3.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.
.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.
.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 which 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\-no\-integrated\-cpp\fR" 4
.IX Item "-no-integrated-cpp"
Performs a compilation in two passes: preprocessing and compiling. This
option allows a user supplied \*(L"cc1\*(R", \*(L"cc1plus\*(R", or \*(L"cc1obj\*(R" via the
\&\fB\-B\fR option. The user supplied compilation step can then add in
an additional preprocessing step after normal preprocessing but before
compiling. The default is to use the integrated cpp (internal cpp)
.Sp
The semantics of this option will change if \*(L"cc1\*(R", \*(L"cc1plus\*(R", and
\&\*(L"cc1obj\*(R" are merged.
.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; but 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 Version 2 is the version of the
\&\*(C+ \s-1ABI\s0 that first appeared in G++ 3.4. Version 1 is the version of
the \*(C+ \s-1ABI\s0 that first appeared in G++ 3.2. Version 0 will always be
the version that conforms most closely to the \*(C+ \s-1ABI\s0 specification.
Therefore, the \s-1ABI\s0 obtained using version 0 will change as \s-1ABI\s0 bugs
are fixed.
.Sp
The default is version 2.
.Sp
Version 3 corrects an error in mangling a constant address as a
template argument.
.Sp
Version 4 implements a standard mangling for vector types.
.Sp
Version 5 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
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 will only return \f(CW0\fR if it is declared
\&\fB\f(BIthrow()\fB\fR, in which case the compiler will always check 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\-fconserve\-space\fR" 4
.IX Item "-fconserve-space"
Put uninitialized or runtime-initialized global variables into the
common segment, as C does. This saves space in the executable at the
cost of not diagnosing duplicate definitions. If you compile with this
flag and your program mysteriously crashes after \f(CW\*(C`main()\*(C'\fR has
completed, you may have an object that is being destroyed twice because
two definitions were merged.
.Sp
This option is no longer useful on most targets, now that support has
been added for putting variables into \s-1BSS\s0 without making them common.
.IP "\fB\-fconstexpr\-depth=\fR\fIn\fR" 4
.IX Item "-fconstexpr-depth=n"
Set the maximum nested evaluation depth for \*(C+0x 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\-fno\-deduce\-init\-list\fR" 4
.IX Item "-fno-deduce-init-list"
Disable deduction of a template type parameter as
std::initializer_list 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 option is present because this deduction is an extension to the
current specification in the \*(C+0x working draft, and there was
some concern about potential overload resolution problems.
.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 which 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
which 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 runtime. 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
will still optimize based on the specifications, so throwing an
unexpected exception will result in undefined behavior.
.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
The default if neither flag is given 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 which 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 will 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 will cause linker
errors if these functions are not inlined everywhere they are called.
.IP "\fB\-fms\-extensions\fR" 4
.IX Item "-fms-extensions"
Disable pedantic 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 though 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 will actually make 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 will result 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 will allow 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 will normally print 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 will omit any template arguments which match
the default template arguments for that template. If either of these
behaviors make it harder to understand the error message rather than
easier, using \fB\-fno\-pretty\-templates\fR will 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+ runtime 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 it will generate it as
needed. The \fBdynamic_cast\fR operator can still be used for casts that
do not require runtime 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
enumeration type can only be one of the values of the enumeration (as
defined in the \*(C+ standard; basically, a value which 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 enumeration type.
.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+0x).
.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 will only work 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
will cause \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 methods where the addresses of the two functions
were 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 will have 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 which are defined in more than one different
shared object: those declarations are permitted if they would have
been permitted when this option was not used.
.RE
.RS 4
.Sp
In new code it is better to use \fB\-fvisibility=hidden\fR and
export those classes which 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 will be different, so changing one will 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\-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++ will use weak symbols if they are available. This
option exists only for testing, and should not be used by end-users;
it will result 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\-fno\-default\-inline\fR" 4
.IX Item "-fno-default-inline"
Do not assume \fBinline\fR for functions defined inside a class scope.
Note that these
functions will have linkage like inline functions; they just won't be
inlined by default.
.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
will be 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++ will place \f(CW\*(C`B::f2\*(C'\fR into the same byte
as\f(CW\*(C`A::f1\*(C'\fR; other compilers will 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 will cause G++ and other compilers to
layout \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++ will not place \f(CW\*(C`B\*(C'\fR into the tail-padding for
\&\f(CW\*(C`A\*(C'\fR; other compilers will. 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 will cause G++ and other
compilers to layout \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++ will make 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++ will place 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 psABI related changes. The known psABI changes at this
point include:
.IP "\(bu" 4
For SYSV/x86\-64, when passing union with long double, it is changed to
pass 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 will always be 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.
.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 accessible non-virtual
destructor, in which case it would be possible but unsafe to delete
an instance of a derived class through a pointer to the base class.
This warning is also enabled if \-Weffc++ 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 will rearrange 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.
.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 book:
.RS 4
.IP "\(bu" 4
Item 11: Define a copy constructor and an assignment operator for classes
with dynamically allocated memory.
.IP "\(bu" 4
Item 12: Prefer initialization to assignment in constructors.
.IP "\(bu" 4
Item 14: Make destructors virtual in base classes.
.IP "\(bu" 4
Item 15: Have \f(CW\*(C`operator=\*(C'\fR return a reference to \f(CW*this\fR.
.IP "\(bu" 4
Item 23: Don't try to return a reference when you must return an object.
.RE
.RS 4
.Sp
Also warn about violations of the following style guidelines from
Scott Meyers' \fIMore Effective \*(C+\fR book:
.IP "\(bu" 4
Item 6: Distinguish between prefix and postfix forms of increment and
decrement operators.
.IP "\(bu" 4
Item 7: Never overload \f(CW\*(C`&&\*(C'\fR, \f(CW\*(C`||\*(C'\fR, or \f(CW\*(C`,\*(C'\fR.
.RE
.RS 4
.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 also 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 not 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
will fail 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++ would try to preserve
unsignedness, but the standard mandates the current behavior.
.Sp
.Vb 4
\& struct A {
\& operator int ();
\& A& operator = (int);
\& };
\&
\& main ()
\& {
\& A a,b;
\& a = b;
\& }
.Ve
.Sp
In this example, G++ will synthesize a default \fBA& operator =
(const A&);\fR, while cfront will use the user-defined \fBoperator =\fR.
.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, but 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, will override 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 that will run
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 that will run
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 will 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 will be invoked
by the runtime immediately after a new object instance is allocated;
the \f(CW\*(C`\- (void) .cxx_destruct\*(C'\fR methods will be 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 will omit such warnings
if any differences found are confined to types which 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, ...). The options described
below can be used to control the diagnostic messages formatting
algorithm, e.g. how many characters per line, how often source location
information should be reported. Right now, only the \*(C+ front end can
honor these options. However it is expected, in the near future, that
the remaining front ends would be able to digest them correctly.
.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 will be done; each error message will appear 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 \fIonce\fR source location information; 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\-fno\-diagnostics\-show\-option\fR" 4
.IX Item "-fno-diagnostics-show-option"
By default, each diagnostic emitted includes text which indicates 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\-Wcoverage\-mismatch\fR" 4
.IX Item "-Wcoverage-mismatch"
Warn if feedback profiles do not match when using the
\&\fB\-fprofile\-use\fR option.
If a source file was changed between \fB\-fprofile\-gen\fR and
\&\fB\-fprofile\-use\fR, the files with the profile feedback can fail
to match the source file and \s-1GCC\s0 can not 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. Disable the error for this warning can result in
poorly optimized code, so disabling the error 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.
.SS "Options to Request or Suppress Warnings"
.IX Subsection "Options to Request or Suppress Warnings"
Warnings are diagnostic messages that report constructions which
are not inherently erroneous but which 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 which 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
\&\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 will emit 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 will be
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 will
warn that an unrecognized option was used.
.IP "\fB\-pedantic\fR" 4
.IX Item "-pedantic"
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 will 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\-pedantic\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\-pedantic\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\-pedantic\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\-pedantic\fR are given
where they are required by the base standard. (It would 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\-pedantic\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++0x\-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\-Wmissing\-braces
\&\-Wnonnull
\&\-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 which has been declared \fBregister\fR.
.IP "\(bu" 4
(\*(C+ only) Taking the address of a variable which has been declared
\&\fBregister\fR.
.IP "\(bu" 4
(\*(C+ only) A base class is not initialized in a derived class' 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\-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 will perform 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"
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\-pedantic\fR is used
with \fB\-Wformat\fR, warnings will be 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).
.Sp
Since \fB\-Wformat\fR also checks for null format arguments for
several functions, \fB\-Wformat\fR also implies \fB\-Wnonnull\fR.
.Sp
\&\fB\-Wformat\fR is included in \fB\-Wall\fR. For more control over some
aspects of format checking, the options \fB\-Wformat\-y2k\fR,
\&\fB\-Wno\-format\-extra\-args\fR, \fB\-Wno\-format\-zero\-length\fR,
\&\fB\-Wformat\-nonliteral\fR, \fB\-Wformat\-security\fR, and
\&\fB\-Wformat=2\fR are available, but are not included in \fB\-Wall\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 which may yield only a two-digit year.
.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 will suppress 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 (C and Objective-C only)" 4
.IX Item "-Wno-format-zero-length (C and Objective-C only)"
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\-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=2\fR" 4
.IX Item "-Wformat=2"
Enable \fB\-Wformat\fR plus format checks not included in
\&\fB\-Wformat\fR. Currently equivalent to \fB\-Wformat
\&\-Wformat\-nonliteral \-Wformat\-security \-Wformat\-y2k\fR.
.IP "\fB\-Wnonnull\fR (C and Objective-C only)" 4
.IX Item "-Wnonnull (C and Objective-C only)"
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 which are initialized with themselves.
Note this option can only be used with the \fB\-Wuninitialized\fR option.
.Sp
For example, \s-1GCC\s0 will warn 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
.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\-pedantic\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.
.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 will issue 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
could belong to the enclosing \f(CW\*(C`if\*(C'\fR. The resulting code would
look like this:
.Sp
.Vb 9
\& {
\& if (a)
\& {
\& if (b)
\& foo ();
\& else
\& bar ();
\& }
\& }
.Ve
.Sp
Also warn for dangerous uses of the
?: with omitted middle operand \s-1GNU\s0 extension. When the condition
in the ?: operator is a boolean expression the omitted value will
be always 1. Often the user expects 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 defines 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\-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\-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 will cause a warning, while
\&\fBx[(void)i,j]\fR will 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 which 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 which 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 will depend 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.
.Sp
These warnings are made optional because \s-1GCC\s0 is not smart
enough to see all the reasons why the code might be correct
despite 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. Here is
another common case:
.Sp
.Vb 6
\& {
\& int save_y;
\& if (change_y) save_y = y, y = new_y;
\& ...
\& if (change_y) y = save_y;
\& }
.Ve
.Sp
This has no bug because \f(CW\*(C`save_y\*(C'\fR is used only if it is set.
.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 which 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 #pragma directive is encountered which is not understood by
\&\s-1GCC. \s0 If this command line option is used, warnings will even be issued
for unknown pragmas in system header files. This is not the case if
the warnings were 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 which 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 which 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 \-O works.
\&\fB\-Wstrict\-aliasing\fR is equivalent to \fB\-Wstrict\-aliasing=n\fR,
with n=3.
.Sp
Level 1: Most aggressive, quick, least accurate.
Possibly useful when higher levels
do not warn but \-fstrict\-aliasing 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 frontend 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 frontend 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 frontend:
\&\f(CW\*(C`*(int*)&some_float\*(C'\fR.
If optimization is enabled, it also runs in the backend, 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 which 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 which 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
will require, 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 which are both questionable and easy to avoid. For
example: \f(CW\*(C`x + 1 > x\*(C'\fR; with \fB\-fstrict\-overflow\fR, the
compiler will simplify this 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 will be 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 will be 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 will
be 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 will give a very large number of
false positives.
.RE
.RS 4
.RE
.IP "\fB\-Wsuggest\-attribute=\fR[\fBpure\fR|\fBconst\fR|\fBnoreturn\fR]" 4
.IX Item "-Wsuggest-attribute=[pure|const|noreturn]"
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 which 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 nor returns 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.
.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 will \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
would 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 which 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 does not in \s-1ISO C.\s0
.IP "\(bu" 4
In traditional C, some preprocessor directives did not exist.
Traditional preprocessors would only consider 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 would ignore 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 would not recognize \fB#elif\fR, so it
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 would cause 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
\&\fInot\fR issued for prototype declarations or variadic functions
because these \s-1ISO C\s0 features will appear in your code when using
libiberty's traditional C compatibility macros, \f(CW\*(C`PARAMS\*(C'\fR and
\&\f(CW\*(C`VPARAMS\*(C'\fR. This warning is also bypassed for nested functions
because that feature is already a \s-1GCC\s0 extension and thus not relevant to
traditional C compatibility.
.RE
.RS 4
.RE
.IP "\fB\-Wtraditional\-conversion\fR (C and Objective-C only)" 4
.IX Item "-Wtraditional-conversion (C and Objective-C only)"
Warn if a prototype causes a type conversion that is different from what
would happen to the same argument in the absence of a prototype. This
includes conversions of fixed point to floating and vice versa, and
conversions changing the width or signedness of a fixed point argument
except when the same as the default promotion.
.IP "\fB\-Wdeclaration\-after\-statement\fR (C and Objective-C only)" 4
.IX Item "-Wdeclaration-after-statement (C and Objective-C only)"
Warn when a declaration is found after a statement in a block. This
construct, known from \*(C+, was introduced with \s-1ISO C99\s0 and is by default
allowed in \s-1GCC. \s0 It is not supported by \s-1ISO C90\s0 and was not supported by
\&\s-1GCC\s0 versions before \s-1GCC 3.0. \s0
.IP "\fB\-Wundef\fR" 4
.IX Item "-Wundef"
Warn if an undefined identifier is evaluated in an \fB#if\fR directive.
.IP "\fB\-Wno\-endif\-labels\fR" 4
.IX Item "-Wno-endif-labels"
Do not warn whenever an \fB#else\fR or an \fB#endif\fR are followed by text.
.IP "\fB\-Wshadow\fR" 4
.IX Item "-Wshadow"
Warn whenever a local variable or type declaration shadows another variable,
parameter, type, or class member (in \*(C+), or whenever a built-in function
is shadowed. Note that in \*(C+, the compiler will not warn if a local variable
shadows a struct/class/enum, but will warn if it shadows an explicit typedef.
.IP "\fB\-Wlarger\-than=\fR\fIlen\fR" 4
.IX Item "-Wlarger-than=len"
Warn whenever an object of larger than \fIlen\fR bytes is defined.
.IP "\fB\-Wframe\-larger\-than=\fR\fIlen\fR" 4
.IX Item "-Wframe-larger-than=len"
Warn if the size of a function frame is larger than \fIlen\fR bytes.
The computation done to determine the stack frame size is approximate
and not conservative.
The actual requirements may be somewhat greater than \fIlen\fR
even if you do not get a warning. In addition, any space allocated
via \f(CW\*(C`alloca\*(C'\fR, variable-length arrays, or related constructs
is not included by the compiler when determining
whether or not to issue a warning.
.IP "\fB\-Wunsafe\-loop\-optimizations\fR" 4
.IX Item "-Wunsafe-loop-optimizations"
Warn if the loop cannot be optimized because the compiler could not
assume anything on the bounds of the loop indices. With
\&\fB\-funsafe\-loop\-optimizations\fR warn if the compiler made
such assumptions.
.IP "\fB\-Wno\-pedantic\-ms\-format\fR (MinGW targets only)" 4
.IX Item "-Wno-pedantic-ms-format (MinGW targets only)"
Disables the warnings about non-ISO \f(CW\*(C`printf\*(C'\fR / \f(CW\*(C`scanf\*(C'\fR format
width specifiers \f(CW\*(C`I32\*(C'\fR, \f(CW\*(C`I64\*(C'\fR, and \f(CW\*(C`I\*(C'\fR used on Windows targets
depending on the \s-1MS\s0 runtime, when you are using the options \fB\-Wformat\fR
and \fB\-pedantic\fR without gnu-extensions.
.IP "\fB\-Wpointer\-arith\fR" 4
.IX Item "-Wpointer-arith"
Warn about anything that depends on the \*(L"size of\*(R" a function type or
of \f(CW\*(C`void\*(C'\fR. \s-1GNU C\s0 assigns these types a size of 1, for
convenience in calculations with \f(CW\*(C`void *\*(C'\fR pointers and pointers
to functions. In \*(C+, warn also when an arithmetic operation involves
\&\f(CW\*(C`NULL\*(C'\fR. This warning is also enabled by \fB\-pedantic\fR.
.IP "\fB\-Wtype\-limits\fR" 4
.IX Item "-Wtype-limits"
Warn if a comparison is always true or always false due to the limited
range of the data type, but do not warn for constant expressions. For
example, warn if an unsigned variable is compared against zero with
\&\fB<\fR or \fB>=\fR. This warning is also enabled by
\&\fB\-Wextra\fR.
.IP "\fB\-Wbad\-function\-cast\fR (C and Objective-C only)" 4
.IX Item "-Wbad-function-cast (C and Objective-C only)"
Warn whenever a function call is cast to a non-matching type.
For example, warn if \f(CW\*(C`int malloc()\*(C'\fR is cast to \f(CW\*(C`anything *\*(C'\fR.
.IP "\fB\-Wc++\-compat\fR (C and Objective-C only)" 4
.IX Item "-Wc++-compat (C and Objective-C only)"
Warn about \s-1ISO C\s0 constructs that are outside of the common subset of
\&\s-1ISO C\s0 and \s-1ISO \*(C+,\s0 e.g. request for implicit conversion from
\&\f(CW\*(C`void *\*(C'\fR to a pointer to non\-\f(CW\*(C`void\*(C'\fR type.
.IP "\fB\-Wc++0x\-compat\fR (\*(C+ and Objective\-\*(C+ only)" 4
.IX Item "-Wc++0x-compat ( and Objective- only)"
Warn about \*(C+ constructs whose meaning differs between \s-1ISO \*(C+ 1998\s0 and
\&\s-1ISO \*(C+\s0 200x, e.g., identifiers in \s-1ISO \*(C+ 1998\s0 that will become keywords
in \s-1ISO \*(C+\s0 200x. This warning is enabled by \fB\-Wall\fR.
.IP "\fB\-Wcast\-qual\fR" 4
.IX Item "-Wcast-qual"
Warn whenever a pointer is cast so as to remove a type qualifier from
the target type. For example, warn if a \f(CW\*(C`const char *\*(C'\fR is cast
to an ordinary \f(CW\*(C`char *\*(C'\fR.
.Sp
Also warn when making a cast which introduces a type qualifier in an
unsafe way. For example, casting \f(CW\*(C`char **\*(C'\fR to \f(CW\*(C`const char **\*(C'\fR
is unsafe, as in this example:
.Sp
.Vb 6
\& /* p is char ** value. */
\& const char **q = (const char **) p;
\& /* Assignment of readonly string to const char * is OK. */
\& *q = "string";
\& /* Now char** pointer points to read\-only memory. */
\& **p = \*(Aqb\*(Aq;
.Ve
.IP "\fB\-Wcast\-align\fR" 4
.IX Item "-Wcast-align"
Warn whenever a pointer is cast such that the required alignment of the
target is increased. For example, warn if a \f(CW\*(C`char *\*(C'\fR is cast to
an \f(CW\*(C`int *\*(C'\fR on machines where integers can only be accessed at
two\- or four-byte boundaries.
.IP "\fB\-Wwrite\-strings\fR" 4
.IX Item "-Wwrite-strings"
When compiling C, give string constants the type \f(CW\*(C`const
char[\f(CIlength\f(CW]\*(C'\fR so that copying the address of one into a
non\-\f(CW\*(C`const\*(C'\fR \f(CW\*(C`char *\*(C'\fR pointer will get a warning. These
warnings will help you find at compile time code that can try to write
into a string constant, but only if you have been very careful about
using \f(CW\*(C`const\*(C'\fR in declarations and prototypes. Otherwise, it will
just be a nuisance. This is why we did not make \fB\-Wall\fR request
these warnings.
.Sp
When compiling \*(C+, warn about the deprecated conversion from string
literals to \f(CW\*(C`char *\*(C'\fR. This warning is enabled by default for \*(C+
programs.
.IP "\fB\-Wclobbered\fR" 4
.IX Item "-Wclobbered"
Warn for variables that might be changed by \fBlongjmp\fR or
\&\fBvfork\fR. This warning is also enabled by \fB\-Wextra\fR.
.IP "\fB\-Wconversion\fR" 4
.IX Item "-Wconversion"
Warn for implicit conversions that may alter a value. This includes
conversions between real and integer, like \f(CW\*(C`abs (x)\*(C'\fR when
\&\f(CW\*(C`x\*(C'\fR is \f(CW\*(C`double\*(C'\fR; conversions between signed and unsigned,
like \f(CW\*(C`unsigned ui = \-1\*(C'\fR; and conversions to smaller types, like
\&\f(CW\*(C`sqrtf (M_PI)\*(C'\fR. Do not warn for explicit casts like \f(CW\*(C`abs
((int) x)\*(C'\fR and \f(CW\*(C`ui = (unsigned) \-1\*(C'\fR, or if the value is not
changed by the conversion like in \f(CW\*(C`abs (2.0)\*(C'\fR. Warnings about
conversions between signed and unsigned integers can be disabled by
using \fB\-Wno\-sign\-conversion\fR.
.Sp
For \*(C+, also warn for confusing overload resolution for user-defined
conversions; and conversions that will never use a type conversion
operator: conversions to \f(CW\*(C`void\*(C'\fR, the same type, a base class or a
reference to them. Warnings about conversions between signed and
unsigned integers are disabled by default in \*(C+ unless
\&\fB\-Wsign\-conversion\fR is explicitly enabled.
.IP "\fB\-Wno\-conversion\-null\fR (\*(C+ and Objective\-\*(C+ only)" 4
.IX Item "-Wno-conversion-null ( and Objective- only)"
Do not warn for conversions between \f(CW\*(C`NULL\*(C'\fR and non-pointer
types. \fB\-Wconversion\-null\fR is enabled by default.
.IP "\fB\-Wempty\-body\fR" 4
.IX Item "-Wempty-body"
Warn if an empty body occurs in an \fBif\fR, \fBelse\fR or \fBdo
while\fR statement. This warning is also enabled by \fB\-Wextra\fR.
.IP "\fB\-Wenum\-compare\fR" 4
.IX Item "-Wenum-compare"
Warn about a comparison between values of different enum types. In \*(C+
this warning is enabled by default. In C this warning is enabled by
\&\fB\-Wall\fR.
.IP "\fB\-Wjump\-misses\-init\fR (C, Objective-C only)" 4
.IX Item "-Wjump-misses-init (C, Objective-C only)"
Warn if a \f(CW\*(C`goto\*(C'\fR statement or a \f(CW\*(C`switch\*(C'\fR statement jumps
forward across the initialization of a variable, or jumps backward to a
label after the variable has been initialized. This only warns about
variables which are initialized when they are declared. This warning is
only supported for C and Objective C; in \*(C+ this sort of branch is an
error in any case.
.Sp
\&\fB\-Wjump\-misses\-init\fR is included in \fB\-Wc++\-compat\fR. It
can be disabled with the \fB\-Wno\-jump\-misses\-init\fR option.
.IP "\fB\-Wsign\-compare\fR" 4
.IX Item "-Wsign-compare"
Warn when a comparison between signed and unsigned values could produce
an incorrect result when the signed value is converted to unsigned.
This warning is also enabled by \fB\-Wextra\fR; to get the other warnings
of \fB\-Wextra\fR without this warning, use \fB\-Wextra \-Wno\-sign\-compare\fR.
.IP "\fB\-Wsign\-conversion\fR" 4
.IX Item "-Wsign-conversion"
Warn for implicit conversions that may change the sign of an integer
value, like assigning a signed integer expression to an unsigned
integer variable. An explicit cast silences the warning. In C, this
option is enabled also by \fB\-Wconversion\fR.
.IP "\fB\-Waddress\fR" 4
.IX Item "-Waddress"
Warn about suspicious uses of memory addresses. These include using
the address of a function in a conditional expression, such as
\&\f(CW\*(C`void func(void); if (func)\*(C'\fR, and comparisons against the memory
address of a string literal, such as \f(CW\*(C`if (x == "abc")\*(C'\fR. Such
uses typically indicate a programmer error: the address of a function
always evaluates to true, so their use in a conditional usually
indicate that the programmer forgot the parentheses in a function
call; and comparisons against string literals result in unspecified
behavior and are not portable in C, so they usually indicate that the
programmer intended to use \f(CW\*(C`strcmp\*(C'\fR. This warning is enabled by
\&\fB\-Wall\fR.
.IP "\fB\-Wlogical\-op\fR" 4
.IX Item "-Wlogical-op"
Warn about suspicious uses of logical operators in expressions.
This includes using logical operators in contexts where a
bit-wise operator is likely to be expected.
.IP "\fB\-Waggregate\-return\fR" 4
.IX Item "-Waggregate-return"
Warn if any functions that return structures or unions are defined or
called. (In languages where you can return an array, this also elicits
a warning.)
.IP "\fB\-Wno\-attributes\fR" 4
.IX Item "-Wno-attributes"
Do not warn if an unexpected \f(CW\*(C`_\|_attribute_\|_\*(C'\fR is used, such as
unrecognized attributes, function attributes applied to variables,
etc. This will not stop errors for incorrect use of supported
attributes.
.IP "\fB\-Wno\-builtin\-macro\-redefined\fR" 4
.IX Item "-Wno-builtin-macro-redefined"
Do not warn if certain built-in macros are redefined. This suppresses
warnings for redefinition of \f(CW\*(C`_\|_TIMESTAMP_\|_\*(C'\fR, \f(CW\*(C`_\|_TIME_\|_\*(C'\fR,
\&\f(CW\*(C`_\|_DATE_\|_\*(C'\fR, \f(CW\*(C`_\|_FILE_\|_\*(C'\fR, and \f(CW\*(C`_\|_BASE_FILE_\|_\*(C'\fR.
.IP "\fB\-Wstrict\-prototypes\fR (C and Objective-C only)" 4
.IX Item "-Wstrict-prototypes (C and Objective-C only)"
Warn if a function is declared or defined without specifying the
argument types. (An old-style function definition is permitted without
a warning if preceded by a declaration which specifies the argument
types.)
.IP "\fB\-Wold\-style\-declaration\fR (C and Objective-C only)" 4
.IX Item "-Wold-style-declaration (C and Objective-C only)"
Warn for obsolescent usages, according to the C Standard, in a
declaration. For example, warn if storage-class specifiers like
\&\f(CW\*(C`static\*(C'\fR are not the first things in a declaration. This warning
is also enabled by \fB\-Wextra\fR.
.IP "\fB\-Wold\-style\-definition\fR (C and Objective-C only)" 4
.IX Item "-Wold-style-definition (C and Objective-C only)"
Warn if an old-style function definition is used. A warning is given
even if there is a previous prototype.
.IP "\fB\-Wmissing\-parameter\-type\fR (C and Objective-C only)" 4
.IX Item "-Wmissing-parameter-type (C and Objective-C only)"
A function parameter is declared without a type specifier in K&R\-style
functions:
.Sp
.Vb 1
\& void foo(bar) { }
.Ve
.Sp
This warning is also enabled by \fB\-Wextra\fR.
.IP "\fB\-Wmissing\-prototypes\fR (C and Objective-C only)" 4
.IX Item "-Wmissing-prototypes (C and Objective-C only)"
Warn if a global function is defined without a previous prototype
declaration. This warning is issued even if the definition itself
provides a prototype. The aim is to detect global functions that fail
to be declared in header files.
.IP "\fB\-Wmissing\-declarations\fR" 4
.IX Item "-Wmissing-declarations"
Warn if a global function is defined without a previous declaration.
Do so even if the definition itself provides a prototype.
Use this option to detect global functions that are not declared in
header files. In \*(C+, no warnings are issued for function templates,
or for inline functions, or for functions in anonymous namespaces.
.IP "\fB\-Wmissing\-field\-initializers\fR" 4
.IX Item "-Wmissing-field-initializers"
Warn if a structure's initializer has some fields missing. For
example, the following code would cause such a warning, because
\&\f(CW\*(C`x.h\*(C'\fR is implicitly zero:
.Sp
.Vb 2
\& struct s { int f, g, h; };
\& struct s x = { 3, 4 };
.Ve
.Sp
This option does not warn about designated initializers, so the following
modification would not trigger a warning:
.Sp
.Vb 2
\& struct s { int f, g, h; };
\& struct s x = { .f = 3, .g = 4 };
.Ve
.Sp
This warning is included in \fB\-Wextra\fR. To get other \fB\-Wextra\fR
warnings without this one, use \fB\-Wextra \-Wno\-missing\-field\-initializers\fR.
.IP "\fB\-Wmissing\-format\-attribute\fR" 4
.IX Item "-Wmissing-format-attribute"
Warn about function pointers which might be candidates for \f(CW\*(C`format\*(C'\fR
attributes. Note these are only possible candidates, not absolute ones.
\&\s-1GCC\s0 will guess 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 will also warn about function definitions which might be
candidates for \f(CW\*(C`format\*(C'\fR attributes. Again, these are only
possible candidates. \s-1GCC\s0 will guess 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.
.IP "\fB\-Wno\-multichar\fR" 4
.IX Item "-Wno-multichar"
Do not warn if a multicharacter constant (\fB'\s-1FOOF\s0'\fR) is used.
Usually they indicate a typo in the user's code, as they have
implementation-defined values, and should not be used in portable code.
.IP "\fB\-Wnormalized=<none|id|nfc|nfkc>\fR" 4
.IX Item "-Wnormalized=<none|id|nfc|nfkc>"
In \s-1ISO C\s0 and \s-1ISO \*(C+,\s0 two identifiers are different if they are
different sequences of characters. However, sometimes when characters
outside the basic \s-1ASCII\s0 character set are used, you can have two
different character sequences that look the same. To avoid confusion,
the \s-1ISO 10646\s0 standard sets out some \fInormalization rules\fR which
when applied ensure that two sequences that look the same are turned into
the same sequence. \s-1GCC\s0 can warn you if you are using identifiers which
have not been normalized; this option controls that warning.
.Sp
There are four levels of warning that \s-1GCC\s0 supports. The default is
\&\fB\-Wnormalized=nfc\fR, which warns about any identifier which is
not in the \s-1ISO 10646 \*(L"C\*(R"\s0 normalized form, \fI\s-1NFC\s0\fR. \s-1NFC\s0 is the
recommended form for most uses.
.Sp
Unfortunately, there are some characters which \s-1ISO C\s0 and \s-1ISO \*(C+\s0 allow
in identifiers that when turned into \s-1NFC\s0 aren't allowable as
identifiers. That is, there's no way to use these symbols in portable
\&\s-1ISO C\s0 or \*(C+ and have all your identifiers in \s-1NFC.
\&\s0\fB\-Wnormalized=id\fR suppresses the warning for these characters.
It is hoped that future versions of the standards involved will correct
this, which is why this option is not the default.
.Sp
You can switch the warning off for all characters by writing
\&\fB\-Wnormalized=none\fR. You would only want to do this if you
were using some other normalization scheme (like \*(L"D\*(R"), because
otherwise you can easily create bugs that are literally impossible to see.
.Sp
Some characters in \s-1ISO 10646\s0 have distinct meanings but look identical
in some fonts or display methodologies, especially once formatting has
been applied. For instance \f(CW\*(C`\eu207F\*(C'\fR, \*(L"\s-1SUPERSCRIPT LATIN SMALL
LETTER N\*(R",\s0 will display just like a regular \f(CW\*(C`n\*(C'\fR which has been
placed in a superscript. \s-1ISO 10646\s0 defines the \fI\s-1NFKC\s0\fR
normalization scheme to convert all these into a standard form as
well, and \s-1GCC\s0 will warn if your code is not in \s-1NFKC\s0 if you use
\&\fB\-Wnormalized=nfkc\fR. This warning is comparable to warning
about every identifier that contains the letter O because it might be
confused with the digit 0, and so is not the default, but may be
useful as a local coding convention if the programming environment is
unable to be fixed to display these characters distinctly.
.IP "\fB\-Wno\-deprecated\fR" 4
.IX Item "-Wno-deprecated"
Do not warn about usage of deprecated features.
.IP "\fB\-Wno\-deprecated\-declarations\fR" 4
.IX Item "-Wno-deprecated-declarations"
Do not warn about uses of functions,
variables, and types marked as deprecated by using the \f(CW\*(C`deprecated\*(C'\fR
attribute.
.IP "\fB\-Wno\-overflow\fR" 4
.IX Item "-Wno-overflow"
Do not warn about compile-time overflow in constant expressions.
.IP "\fB\-Woverride\-init\fR (C and Objective-C only)" 4
.IX Item "-Woverride-init (C and Objective-C only)"
Warn if an initialized field without side effects is overridden when
using designated initializers.
.Sp
This warning is included in \fB\-Wextra\fR. To get other
\&\fB\-Wextra\fR warnings without this one, use \fB\-Wextra
\&\-Wno\-override\-init\fR.
.IP "\fB\-Wpacked\fR" 4
.IX Item "-Wpacked"
Warn if a structure is given the packed attribute, but the packed
attribute has no effect on the layout or size of the structure.
Such structures may be mis-aligned for little benefit. For
instance, in this code, the variable \f(CW\*(C`f.x\*(C'\fR in \f(CW\*(C`struct bar\*(C'\fR
will be misaligned even though \f(CW\*(C`struct bar\*(C'\fR does not itself
have the packed attribute:
.Sp
.Vb 8
\& struct foo {
\& int x;
\& char a, b, c, d;
\& } _\|_attribute_\|_((packed));
\& struct bar {
\& char z;
\& struct foo f;
\& };
.Ve
.IP "\fB\-Wpacked\-bitfield\-compat\fR" 4
.IX Item "-Wpacked-bitfield-compat"
The 4.1, 4.2 and 4.3 series of \s-1GCC\s0 ignore the \f(CW\*(C`packed\*(C'\fR attribute
on bit-fields of type \f(CW\*(C`char\*(C'\fR. This has been fixed in \s-1GCC 4.4\s0 but
the change can lead to differences in the structure layout. \s-1GCC\s0
informs you when the offset of such a field has changed in \s-1GCC 4.4.\s0
For example there is no longer a 4\-bit padding between field \f(CW\*(C`a\*(C'\fR
and \f(CW\*(C`b\*(C'\fR in this structure:
.Sp
.Vb 5
\& struct foo
\& {
\& char a:4;
\& char b:8;
\& } _\|_attribute_\|_ ((packed));
.Ve
.Sp
This warning is enabled by default. Use
\&\fB\-Wno\-packed\-bitfield\-compat\fR to disable this warning.
.IP "\fB\-Wpadded\fR" 4
.IX Item "-Wpadded"
Warn if padding is included in a structure, either to align an element
of the structure or to align the whole structure. Sometimes when this
happens it is possible to rearrange the fields of the structure to
reduce the padding and so make the structure smaller.
.IP "\fB\-Wredundant\-decls\fR" 4
.IX Item "-Wredundant-decls"
Warn if anything is declared more than once in the same scope, even in
cases where multiple declaration is valid and changes nothing.
.IP "\fB\-Wnested\-externs\fR (C and Objective-C only)" 4
.IX Item "-Wnested-externs (C and Objective-C only)"
Warn if an \f(CW\*(C`extern\*(C'\fR declaration is encountered within a function.
.IP "\fB\-Winline\fR" 4
.IX Item "-Winline"
Warn if a function can not be inlined and it was declared as inline.
Even with this option, the compiler will not warn about failures to
inline functions declared in system headers.
.Sp
The compiler uses a variety of heuristics to determine whether or not
to inline a function. For example, the compiler takes into account
the size of the function being inlined and the amount of inlining
that has already been done in the current function. Therefore,
seemingly insignificant changes in the source program can cause the
warnings produced by \fB\-Winline\fR to appear or disappear.
.IP "\fB\-Wno\-invalid\-offsetof\fR (\*(C+ and Objective\-\*(C+ only)" 4
.IX Item "-Wno-invalid-offsetof ( and Objective- only)"
Suppress warnings from applying the \fBoffsetof\fR macro to a non-POD
type. According to the 1998 \s-1ISO \*(C+\s0 standard, applying \fBoffsetof\fR
to a non-POD type is undefined. In existing \*(C+ implementations,
however, \fBoffsetof\fR typically gives meaningful results even when
applied to certain kinds of non-POD types. (Such as a simple
\&\fBstruct\fR that fails to be a \s-1POD\s0 type only by virtue of having a
constructor.) This flag is for users who are aware that they are
writing nonportable code and who have deliberately chosen to ignore the
warning about it.