[Main]
Title=Options to Request or Suppress Warnings

[Top]
Warnings are diagnostic messages that report constructions which
are not inherently erroneous but which are risky or suggest there
may have been an error.
<BR><BR>
You can request many specific warnings with options beginning <B>'-W'</B>,
for example <B>'-Wimplicit'</B> to request warnings on implicit
declarations.  Each of these specific warning options also has a
negative form beginning <B>'-Wno-'</B> to turn off warnings;
for example, <B>'-Wno-implicit'</B>.  This manual lists only one of the
two forms, whichever is not the default.
<BR><BR>
The following options control the amount and kinds of warnings produced
by GCC.
<DL>
<DT><B>-fsyntax-only</B>
<DD>Check the code for syntax errors, but don't do anything beyond that.
<BR><BR>
<DT><B>-pedantic</B>
<DD>Issue all the warnings demanded by strict ISO C;
reject all programs that use forbidden extensions, and some other
programs that do not follow ISO C.  This option follows the
version of the ISO C standard specified by any <B>'-std'</B> option used.
<BR><BR>
Valid ISO C programs should compile properly with or without
this option (though a rare few will require <B>'-ansi'</B> or a
<B>'-std'</B> option specifying the required version of ISO C).  However,
without this option, certain GNU extensions and traditional C
features are supported as well.  With this option, they are rejected.
<BR><BR>
<B>'-pedantic'</B> does not cause warning messages for use of the
alternate keywords whose names begin and end with <CODE>__</CODE>.  Pedantic
warnings are also disabled in the expression that follows
<CODE>__extension__</CODE>.  However, only system header files should use
these escape routes; application programs should avoid them.
See <A HREF="$$INFOLINK(gnuexts/SEC100)">Alternate Keywords</A>.
<BR><BR>
Some users try to use <B>'-pedantic'</B> to check programs for strict ISO
C 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
ISO C <I>requires</I> a diagnostic, and some others for which
diagnostics have been added.
<BR><BR>
A feature to report any failure to conform to ISO C might be useful in
some instances, but would require considerable additional work and would
be quite different from <B>'-pedantic'</B>.  The GNU team doesn't have plans to
support such a feature in the near future.
<BR><BR>
Where the standard specified with <B>'-std'</B> represents a GNU
extended dialect of C, such as <CODE>gnu89</CODE> or <CODE>gnu99</CODE>, there is a
corresponding <U>base standard</U>, the version of ISO C on which the GNU
extended dialect is based.  Warnings from <B>'-pedantic'</B> 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 GNU
C dialect, since by definition the GNU dialects of C include all
features the compiler supports with the given option, and there would be
nothing to warn about.)
<BR><BR>
<DT><B>-pedantic-errors</B>
<DD>Like <B>'-pedantic'</B>, except that errors are produced rather than
warnings.
<BR><BR>
<DT><B>-w</B>
<DD>Inhibit all warning messages.
<BR><BR>
<DT><B>-Wno-import</B>
<DD>Inhibit warning messages about the use of <CODE><A HREF="$$INFOLINK(cpp/SEC84)">#import</A></CODE>.
<BR><BR>
<DT><B>-Wchar-subscripts</B>
<DD>Warn if an array subscript has type <CODE><A HREF="$$INFOLINK(keywords/char)">char</A></CODE>.  This is a common cause
of error, as programmers often forget that this type is signed on some
machines.
<BR><BR>
<DT><B>-Wcomment</B>
<DD>Warn whenever a comment-start sequence <CODE>/*</CODE> appears in a <CODE>/*</CODE>
comment, or whenever a Backslash-Newline appears in a <CODE>//</CODE> comment.
<BR><BR>
<DT><B>-Wformat</B>
<DD>Check calls to <A HREF="$$LINK(stdio.h/printf)">printf</A> and <A HREF="$$LINK(stdio.h/scanf)">scanf</A>, 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 (see <A HREF="$$INFOLINK(gnuexts/SEC85_format)">format</A>).
<BR><BR>
Since <B>'-Wformat'</B> also checks for null format arguments for
several functions, <B>'-Wformat'</B> also implies <B>'-Wnonnull'</B>.
<BR><BR>
<B>'-Wformat'</B> is included in <B>'-Wall'</B>.  For more control over some
aspects of format checking, the options
<B>'-Wno-format-extra-args'</B>, <B>'-Wno-format-zero-length'</B>,
<B>'-Wformat-nonliteral'</B>, <B>'-Wformat-security'</B>, and
<B>'-Wformat=2'</B> are available, but are not included in <B>'-Wall'</B>.
<BR><BR>
<DT><B>-Wno-format-extra-args</B>
<DD>If <B>'-Wformat'</B> is specified, do not warn about excess arguments to a
<A HREF="$$LINK(stdio.h/printf)">printf</A> or <A HREF="$$LINK(stdio.h/scanf)">scanf</A> format function.  The C standard specifies
that such arguments are ignored.
<BR><BR>
<DT><B>-Wno-format-zero-length</B>
<DD>If <B>'-Wformat'</B> is specified, do not warn about zero-length formats.
The C standard specifies that zero-length formats are allowed.
<BR><BR>
<DT><B>-Wformat-nonliteral</B>
<DD>If <B>'-Wformat'</B> 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 <A HREF="$$LINK(stdarg.h/va_list)">va_list</A>.
<BR><BR>
<DT><B>-Wformat-security</B>
<DD>If <B>'-Wformat'</B> is specified, also warn about uses of format
functions that represent possible security problems.  At present, this
warns about calls to <A HREF="$$LINK(stdio.h/printf)">printf</A> and <A HREF="$$LINK(stdio.h/scanf)">scanf</A> functions where the
format string is not a string literal and there are no format arguments,
as in <CODE>printf&nbsp;(foo);</CODE>.  This may be a security hole if the format
string came from untrusted input and contains <CODE>%n</CODE>.  (This is
currently a subset of what <B>'-Wformat-nonliteral'</B> warns about, but
in future warnings may be added to <B>'-Wformat-security'</B> that are not
included in <B>'-Wformat-nonliteral'</B>.)
<BR><BR>
<DT><B>-Wformat=2</B>
<DD>Enable <B>'-Wformat'</B> plus format checks not included in
<B>'-Wformat'</B>.  Currently equivalent to <B>'-Wformat
-Wformat-nonliteral -Wformat-security'</B>.
<BR><BR>
<DT><B>-Wnonnull</B>
<DD>Enable warning about passing a null pointer for arguments marked as
requiring a non-null value by the <CODE>nonnull</CODE> function attribute.
<BR><BR>
<B>'-Wnonnull'</B> is included in <B>'-Wall'</B> and <B>'-Wformat'</B>.  It
can be disabled with the <B>'-Wno-nonnull'</B> option.
<BR><BR>
<DT><B>-Wimplicit-int</B>
<DD>Warn when a declaration does not specify a type.
<BR><BR>
<DT><B>-Wimplicit-function-declaration</B>
<BR><B>-Werror-implicit-function-declaration</B>
<DD>Give a warning (or error) whenever a function is used before being
declared.
<BR><BR>
<DT><B>-Wimplicit</B>
<DD>Same as <B>'-Wimplicit-int -Wimplicit-function-declaration'</B>.
<BR><BR>
<DT><B>-Wmissing-braces</B>
<DD>Warn if an aggregate or union initializer is not fully bracketed.  In
the following example, the initializer for <CODE>a</CODE> is not fully
bracketed, but that for <CODE>b</CODE> is fully bracketed.
<PRE>int a[2][2] = { 0, 1, 2, 3 };
int b[2][2] = { { 0, 1 }, { 2, 3 } };
</PRE>
<DT><B>-Wparentheses</B>
<DD>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.
<BR><BR>
Also warn about constructions where there may be confusion to which
<CODE><A HREF="$$INFOLINK(keywords/if)">if</A></CODE> statement an <CODE><A HREF="$$INFOLINK(keywords/else)">else</A></CODE> branch belongs.  Here is an example of
such a case:
<PRE>{
  if (a)
    if (b)
      foo ();
  else
    bar ();
}
</PRE>
In C, every <CODE>else</CODE> branch belongs to the innermost possible <CODE>if</CODE>
statement, which in this example is <CODE>if&nbsp;(b)</CODE>.  This is often not
what the programmer expected, as illustrated in the above example by the
indentation the programmer chose.  When there is the potential for this
confusion, GCC will issue a warning when this flag is specified.
To eliminate the warning, add explicit braces around the innermost
<CODE>if</CODE> statement so there is no way the <CODE>else</CODE> could belong to
the enclosing <CODE>if</CODE>.  The resulting code would look like this:
<PRE>{
  if (a)
    {
      if (b)
        foo ();
      else
        bar ();
    }
}
</PRE>
<DT><B>-Wsequence-point</B>
<DD>Warn about code that may have undefined semantics because of violations
of sequence point rules in the C standard.
<BR><BR>
The C standard defines the order in which expressions in a C program are
evaluated in terms of <U>sequence points</U>, 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
<CODE>&amp;&amp;</CODE>, <CODE>||</CODE>, <CODE>?&nbsp;:</CODE> or <CODE>,</CODE> (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.
<BR><BR>
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 standard specifies that &quot;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.&quot;.  If a program breaks these rules, the results on any
particular implementation are entirely unpredictable.
<BR><BR>
Examples of code with undefined behavior are <CODE>a&nbsp;=&nbsp;a++;</CODE>, <CODE>a[n]
=&nbsp;b[n++]</CODE> and <CODE>a[i++]&nbsp;=&nbsp;i;</CODE>.  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.
<BR><BR>
The C 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 GCC readings page, at
<A HREF="http://gcc.gnu.org/readings.html">http://gcc.gnu.org/readings.html</A>.
<BR><BR>
<DT><B>-Wreturn-type</B>
<DD>Warn whenever a function is defined with a return-type that defaults to
<CODE><A HREF="$$INFOLINK(keywords/int)">int</A></CODE>.  Also warn about any <CODE>return</CODE> statement with no
return-value in a function whose return-type is not <CODE><A HREF="$$INFOLINK(keywords/void)">void</A></CODE>.
<BR><BR>
<DT><B>-Wswitch</B>
<DD>Warn whenever a <CODE><A HREF="$$INFOLINK(keywords/switch)">switch</A></CODE> statement has an index of enumeral type
and lacks a <CODE><A HREF="$$INFOLINK(keywords/case)">case</A></CODE> for one or more of the named codes of that
enumeration.  (The presence of a <CODE>default</CODE> label prevents this
warning.)  <CODE>case</CODE> labels outside the enumeration range also
provoke warnings when this option is used.
<BR><BR>
<DT><B>-Wswitch-default</B>
<DD>Warn whenever a <CODE>switch</CODE> statement does not have a <CODE>default</CODE>
case.
<BR><BR>
<DT><B>-Wswitch-enum</B>
<DD>Warn whenever a <CODE>switch</CODE> statement has an index of enumeral type
and lacks a <CODE>case</CODE> for one or more of the named codes of that
enumeration.  <CODE>case</CODE> labels outside the enumeration range also
provoke warnings when this option is used.
<BR><BR>
<DT><B>-Wtrigraphs</B>
<DD>Warn if any trigraphs are encountered that might change the meaning of
the program (trigraphs within comments are not warned about).
For more information about trigraphs, see <A HREF="$$LINK(SEC11)">Options Controlling the Preprocessor</A>.
<BR><BR>
<DT><B>-Wunused-function</B>
<DD>Warn whenever a static function is declared but not defined or a
non\-inline static function is unused.
<BR><BR>
To suppress this warning, use the <CODE><A HREF="$$INFOLINK(gnuexts/SEC85_unused)">unused</A></CODE> attribute.
<BR><BR>
<DT><B>-Wunused-label</B>
<DD>Warn whenever a label is declared but not used.
<BR><BR>
To suppress this warning, use the <CODE><A HREF="$$INFOLINK(gnuexts/SEC91_unused)">unused</A></CODE> attribute.
<BR><BR>
<DT><B>-Wunused-parameter</B>
<DD>Warn whenever a function parameter is unused aside from its declaration.
<BR><BR>
To suppress this warning, use the <CODE><A HREF="$$INFOLINK(gnuexts/SEC91_unused)">unused</A></CODE> attribute.
<BR><BR>
<DT><B>-Wunused-variable</B>
<DD>Warn whenever a local variable or non-constant static variable is unused
aside from its declaration
<BR><BR>
To suppress this warning, use the <CODE><A HREF="$$INFOLINK(gnuexts/SEC91_unused)">unused</A></CODE> attribute.
<BR><BR>
<DT><B>-Wunused-value</B>
<DD>Warn whenever a statement computes a result that is explicitly not used.
<BR><BR>
To suppress this warning, cast the expression to <CODE><A HREF="$$INFOLINK(keywords/void)">void</A></CODE>.
<BR><BR>
<DT><B>-Wunused</B>
<DD>All the above <B>'-Wunused'</B> options combined.
<BR><BR>
In order to get a warning about an unused function parameter, you must
either specify <B>'-W -Wunused'</B> or separately specify
<B>'-Wunused-parameter'</B>.
<BR><BR>
<DT><B>-Wuninitialized</B>
<DD>Warn if an automatic variable is used without first being initialized or
if a variable may be clobbered by a <A HREF="$$LINK(setjmp.h/setjmp)">setjmp</A> call
(I am not sure whether <A HREF="$$LINK(setjmp.h/setjmp)">setjmp</A> problems may be detected in TIGCC).
<BR><BR>
These warnings are possible only in optimizing compilation,
because they require data flow information that is computed only
when optimizing.  If you don't specify <B>'-O'</B>, you simply won't
get these warnings.
<BR><BR>
These warnings occur only for variables that are candidates for
register allocation.  Therefore, they do not occur for a variable that
is declared <CODE><A HREF="$$INFOLINK(keywords/volatile)">volatile</A></CODE>, or whose address is taken, or whose size
is other than 1, 2, 4 or 8 bytes.  Also, they do not occur for
structures, unions or arrays, even when they are in registers.
<BR><BR>
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.
<BR><BR>
These warnings are made optional because GCC 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:
<PRE>{
  int x;
  switch (y)
    {
    case 1: x = 1;
      break;
    case 2: x = 4;
      break;
    case 3: x = 5;
    }
  foo (x);
}
</PRE>
If the value of <I>y</I> is always 1, 2 or 3, then <I>x</I> is
always initialized, but GCC doesn't know this.  Here is
another common case:
<PRE>{
  int save_y;
  if (change_y) save_y = y, y = new_y;
  ...
  if (change_y) y = save_y;
}
</PRE>
This has no bug because <I>save_y</I> is used only if it is set.
<BR><BR>
This option also warns when a non-volatile automatic variable might be
changed by a call to <A HREF="$$LINK(setjmp.h/longjmp)">longjmp</A>.  These warnings as well are possible
only in optimizing compilation
(although I am not sure whether they can be caught at all in TIGCC).
<BR><BR>
The compiler sees only the calls to <A HREF="$$LINK(setjmp.h/setjmp)">setjmp</A>.  It cannot know
where <A HREF="$$LINK(setjmp.h/longjmp)">longjmp</A> will be called; in fact, an interrupt 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 <A HREF="$$LINK(setjmp.h/longjmp)">longjmp</A> cannot
in fact be called at the place which would cause a problem.
<BR><BR>
Some spurious warnings can be avoided if you declare all the functions
you use that never return as <A HREF="$$INFOLINK(gnuexts/SEC85_noreturn)">noreturn</A>.
<BR><BR>
<DT><B>-Wunknown-pragmas</B>
<DD>Warn when a <CODE><A HREF="$$INFOLINK(cpp/SEC46)">#pragma</A></CODE> directive is encountered which is not understood by
GCC.  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 <B>'-Wall'</B> command line option.
<BR><BR>
<DT><B>-Wstrict-aliasing</B>
<DD>This option is only active when <B>'-fstrict-aliasing'</B> 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 <B>'-Wall'</B>.
<BR><BR>
<DT><B>-Wall</B>
<DD>All of the above <B>'-W'</B> options combined.  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.
</DL>
The following <B>'-W...'</B> options are not implied by <B>'-Wall'</B>.
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.
<DL>
<DT><B>-W</B>
<DD>Print extra warning messages for these events:
<UL>
<LI>
A function can return either with or without a value.  (Falling
off the end of the function body is considered returning without
a value.)  For example, this function would evoke such a
warning:
<PRE>foo (a)
{
  if (a &gt; 0)
    return a;
}
</PRE>
</LI>
<LI>
An expression-statement or the left-hand side of a comma expression
contains no side effects.
To suppress the warning, cast the unused expression to void.
For example, an expression such as <CODE>x[i,j]</CODE> will cause a warning,
but <CODE>x[(void)i,j]</CODE> will not.
<BR><BR>
</LI>
<LI>
An unsigned value is compared against zero with <CODE>&lt;</CODE> or <CODE>&lt;=</CODE>.
<BR><BR>
</LI>
<LI>
A comparison like <CODE>x&lt;=y&lt;=z</CODE> appears; this is equivalent to
<CODE>(x&lt;=y&nbsp;?&nbsp;1&nbsp;:&nbsp;0)&nbsp;&lt;=&nbsp;z</CODE>, which is a different interpretation from
that of ordinary mathematical notation.
<BR><BR>
</LI>
<LI>
Storage-class specifiers like <CODE>static</CODE> are not the first things in
a declaration.  According to the C Standard, this usage is obsolescent.
<BR><BR>
</LI>
<LI>
The return type of a function has a type qualifier such as <CODE>const</CODE>.
Such a type qualifier has no effect, since the value returned by a
function is not an lvalue.  (But don't warn about the GNU extension of
<CODE>volatile&nbsp;void</CODE> return types.  That extension will be warned about
if <B>'-pedantic'</B> is specified.)
<BR><BR>
</LI>
<LI>
If <B>'-Wall'</B> or <B>'-Wunused'</B> is also specified, warn about unused
arguments.
<BR><BR>
</LI>
<LI>
A comparison between signed and unsigned values could produce an
incorrect result when the signed value is converted to unsigned.
(But don't warn if <B>'-Wno-sign-compare'</B> is also specified.)
<BR><BR>
</LI>
<LI>
An aggregate has a partly bracketed initializer.
For example, the following code would evoke such a warning,
because braces are missing around the initializer for <I>x</I>.<I>h</I>:
<PRE>struct s { int f, g; };
struct t { struct s h; int i; };
struct t x = { 1, 2, 3 };
</PRE>
</LI>
<LI>
An aggregate has an initializer which does not initialize all members.
For example, the following code would cause such a warning, because
<I>x</I>.<I>h</I> would be implicitly initialized to zero:
<PRE>struct s { int f, g, h; };
struct s x = { 3, 4 };
</PRE>
</LI>
</UL>
<DT><B>-Wno-div-by-zero</B>
<DD>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.
<BR><BR>
<DT><B>-Wsystem-headers</B>
<DD>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
GCC to emit warnings from system headers as if they occurred in user
code.  However, note that using <B>'-Wall'</B> in conjunction with this
option will <I>not</I> warn about unknown pragmas in system
headers - for that, <B>'-Wunknown-pragmas'</B> must also be used.
<BR><BR>
Note that the TIGCC Library header files are not included as system header
files.
<BR><BR>
<DT><B>-Wfloat-equal</B>
<DD>Warn if floating point values are used in equality comparisons.
<BR><BR>
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.
<BR><BR>
<DT><B>-Wtraditional</B>
<DD>Warn about certain constructs that behave differently in traditional and
ISO C.  Also warn about ISO C constructs that have no traditional C
equivalent, and/or problematic constructs which should be avoided.
<UL>
<LI>
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 ISO C.
<BR><BR>
</LI>
<LI>
In traditional C, some preprocessor directives did not exist.
Traditional preprocessors would only consider a line to be a directive
if the <CODE>#</CODE> appeared in column 1 on the line.  Therefore
<B>'-Wtraditional'</B> warns about directives that traditional C
understands but would ignore because the <CODE>#</CODE> does not appear as the
first character on the line.  It also suggests you hide directives like
<CODE><A HREF="$$INFOLINK(cpp/SEC46)">#pragma</A></CODE> not understood by traditional C by indenting them.  Some
traditional implementations would not recognize <CODE><A HREF="$$INFOLINK(cpp/SEC36)">#elif</A></CODE>, so it
suggests avoiding it altogether.
<BR><BR>
</LI>
<LI>
A function-like macro that appears without arguments.
<BR><BR>
</LI>
<LI>
The unary plus operator.
<BR><BR>
</LI>
<LI>
The <CODE>U</CODE> integer constant suffix, or the <CODE>F</CODE> or <CODE>L</CODE> floating point
constant suffixes.  (Traditional C does support the <CODE>L</CODE> suffix on integer
constants.)  Note, these suffixes appear in macros defined in <A HREF="$$LINK(limits.h/)">limits.h</A>,
for example.
<BR><BR>
</LI>
<LI>
A function declared external in one block and then used after the end of
the block.
<BR><BR>
</LI>
<LI>
A <CODE><A HREF="$$INFOLINK(keywords/switch)">switch</A></CODE> statement has an operand of type <CODE><A HREF="$$INFOLINK(keywords/long)">long</A></CODE>.
<BR><BR>
</LI>
<LI>
A non-<CODE><A HREF="$$INFOLINK(keywords/static)">static</A></CODE> function declaration follows a <CODE>static</CODE> one.
This construct is not accepted by some traditional C compilers.
<BR><BR>
</LI>
<LI>
The ISO 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 10, i.e. hexadecimal or octal values, which
typically represent bit patterns, are not warned about.
<BR><BR>
</LI>
<LI>
Usage of ISO string concatenation is detected.
<BR><BR>
</LI>
<LI>
Initialization of automatic aggregates.
<BR><BR>
</LI>
<LI>
Identifier conflicts with labels.  Traditional C lacks a separate
namespace for labels.
<BR><BR>
</LI>
<LI>
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. <A HREF="$$INFOLINK(cpp/SEC15_STDC)">__STDC__</A> to avoid missing
initializer warnings and relies on default initialization to zero in the
traditional C case.
<BR><BR>
</LI>
<LI>
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 <B>'-Wconversion'</B>.
<BR><BR>
</LI>
<LI>
Use of ISO C style function definitions.  This warning intentionally is
<I>not</I> issued for prototype declarations or variadic functions
because these ISO C features will appear in your code when using
libiberty's traditional C compatibility macros, <CODE>PARAMS</CODE> and
<CODE>VPARAMS</CODE>.  This warning is also bypassed for nested functions
because that feature is already a gcc extension and thus not relevant to
traditional C compatibility.
</LI>
</UL>
<DT><B>-Wundef</B>
<DD>Warn if an undefined identifier is evaluated in an <CODE>#if</CODE> directive.
<BR><BR>
<DT><B>-Wendif-labels</B>
<DD>Warn whenever an <CODE>#else</CODE> or an <CODE>#endif</CODE> are followed by text.
<BR><BR>
<DT><B>-Wshadow</B>
<DD>Warn whenever a local variable shadows another local variable, parameter or
global variable or whenever a built-in function is shadowed.
<BR><BR>
<DT><B>-Wlarger-than-<I>len</I></B>
<DD>Warn whenever an object of larger than <I>len</I> bytes is defined.
<BR><BR>
<DT><B>-Wpointer-arith</B>
<DD>Warn about anything that depends on the &quot;size of&quot; a function type or
of <CODE><A HREF="$$INFOLINK(keywords/void)">void</A></CODE>.  GNU C assigns these types a size of 1, for
convenience in calculations with <CODE>void*</CODE> pointers and pointers
to functions.
<BR><BR>
<DT><B>-Wbad-function-cast</B>
<DD>Warn whenever a function call is cast to a non-matching type.
For example, warn if <CODE>int&nbsp;malloc()</CODE> is cast to <CODE>anything&nbsp;*</CODE>.
<BR><BR>
<DT><B>-Wcast-qual</B>
<DD>Warn whenever a pointer is cast so as to remove a type qualifier from
the target type.  For example, warn if a <CODE>const&nbsp;char&nbsp;*</CODE> is cast
to an ordinary <CODE>char&nbsp;*</CODE>.
<BR><BR>
<DT><B>-Wcast-align</B>
<DD>Warn whenever a pointer is cast such that the required alignment of the
target is increased.  For example, warn if a <CODE>char&nbsp;*</CODE> is cast to
an <CODE>int&nbsp;*</CODE> on machines where integers can only be accessed at
two- or four-byte boundaries.
<BR><BR>
<DT><B>-Wwrite-strings</B>
<DD>When compiling C, give string constants the type <CODE>const
char[<I>length</I>]</CODE> so that
copying the address of one into a non-<CODE>const</CODE> <CODE>char&nbsp;*</CODE>
pointer will get a warning; when compiling C++, warn about the
deprecated conversion from string constants to <CODE>char&nbsp;*</CODE>.
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 <CODE>const</CODE> in
declarations and prototypes.  Otherwise, it will just be a nuisance;
this is why we did not make <B>'-Wall'</B> request these warnings.
<BR><BR>
<DT><B>-Wconversion</B>
<DD>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.
<BR><BR>
Also, warn if a negative integer constant expression is implicitly
converted to an unsigned type.  For example, warn about the assignment
<CODE>x&nbsp;=&nbsp;-1</CODE> if <CODE>x</CODE> is unsigned.  But do not warn about explicit
casts like <CODE>(unsigned)&nbsp;-1</CODE>.
<BR><BR>
<DT><B>-Wsign-compare</B>
<DD>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 enabled by <B>'-W'</B>, and by <B>'-Wall'</B>
in C++ only.
<BR><BR>
<DT><B>-Waggregate-return</B>
<DD>Warn if any functions that return structures or unions are defined or
called.
<BR><BR>
<DT><B>-Wstrict-prototypes</B>
<DD>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.)
<BR><BR>
<DT><B>-Wmissing-prototypes</B>
<DD>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.
<BR><BR>
<DT><B>-Wmissing-declarations (C only)</B>
<DD>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.
<BR><BR>
<DT><B>-Wmissing-noreturn</B>
<DD>Warn about functions which might be candidates for attribute <A HREF="$$INFOLINK(gnuexts/SEC85_noreturn)">noreturn</A>.
Note these are only possible candidates, not absolute ones.  Care should
be taken to manually verify functions actually do not ever return before
adding the <A HREF="$$INFOLINK(gnuexts/SEC85_noreturn)">noreturn</A> attribute, otherwise subtle code generation
bugs could be introduced.
<BR><BR>
<DT><B>-Wmissing-format-attribute</B>
<DD>If <B>'-Wformat'</B> is enabled, also warn about functions which might be
candidates for <A HREF="$$INFOLINK(gnuexts/SEC85_format)">format</A> attributes.  Note these are only possible
candidates, not absolute ones.  GCC will guess that <A HREF="$$INFOLINK(gnuexts/SEC85_format)">format</A>
attributes might be appropriate for any function that calls a function
like <A HREF="$$LINK(stdio.h/vprintf)">vprintf</A> or <A HREF="$$LINK(stdio.h/vscanf)">vscanf</A>, but this might not always be the
case, and some functions for which <A HREF="$$INFOLINK(gnuexts/SEC85_format)">format</A> attributes are
appropriate may not be detected.  This option has no effect unless
<B>'-Wformat'</B> is enabled (possibly by <B>'-Wall'</B>).
<BR><BR>
<DT><B>-Wno-multichar</B>
<DD>Do not warn if a multicharacter constant (<CODE>'FOOF'</CODE>) 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.
<BR><BR>
<DT><B>-Wno-deprecated-declarations</B>
<DD>Do not warn about uses of functions, variables, and types marked as
deprecated by using the <A HREF="$$INFOLINK(gnuexts/SEC85_deprecated)">deprecated</A> attribute.
<BR><BR>
<DT><B>-Wpacked</B>
<DD>Warn if a structure is given the <A HREF="$$INFOLINK(gnuexts/SEC92_packed)">packed</A> attribute, but the <A HREF="$$INFOLINK(gnuexts/SEC92_packed)">packed</A>
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 <I>f</I>.<I>x</I> in <CODE>struct&nbsp;bar</CODE>
will be misaligned even though <CODE>struct&nbsp;bar</CODE> does not itself
have the packed attribute:
<PRE>struct foo {
  int x;
  char a, b, c, d;
} __attribute__((packed));
struct bar {
  char z;
  struct foo f;
};
</PRE>
<DT><B>-Wpadded</B>
<DD>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.
<BR><BR>
<DT><B>-Wredundant-decls</B>
<DD>Warn if anything is declared more than once in the same scope, even in
cases where multiple declaration is valid and changes nothing.
<BR><BR>
<DT><B>-Wnested-externs</B>
<DD>Warn if an <CODE><A HREF="$$INFOLINK(keywords/extern)">extern</A></CODE> declaration is encountered within a function.
<BR><BR>
<DT><B>-Wunreachable-code</B>
<DD>Warn if the compiler detects that code will never be executed.
<BR><BR>
This option is intended to warn when the compiler detects that at
least a whole line of source code will never be executed, because
some condition is never satisfied or because it is after a
procedure that never returns.
<BR><BR>
It is possible for this option to produce a warning even though there
are circumstances under which part of the affected line can be executed,
so care should be taken when removing apparently-unreachable code.
<BR><BR>
For instance, when a function is inlined, a warning may mean that the
line is unreachable in only one inlined copy of the function.
<BR><BR>
This option is not made part of <B>'-Wall'</B> because in a debugging
version of a program there is often substantial code which checks
correct functioning of the program and is, hopefully, unreachable
because the program does work.  Another common use of unreachable
code is to provide behavior which is selectable at compile-time.
<BR><BR>
<DT><B>-Winline</B>
<DD>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.
<BR><BR>
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 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 <B>'-Winline'</B> to appear or disappear.
<BR><BR>
<DT><B>-Wlong-long</B>
<DD>Warn if <CODE>long&nbsp;long</CODE> type is used.  This is default.  To inhibit
the warning messages, use <B>'-Wno-long-long'</B>.  Flags
<B>'-Wlong-long'</B> and <B>'-Wno-long-long'</B> are taken into account
only when <B>'-pedantic'</B> flag is used.
<BR><BR>
<DT><B>-Wdisabled-optimization</B>
<DD>Warn if a requested optimization pass is disabled.  This warning does
not generally indicate that there is anything wrong with your code; it
merely indicates that GCC's optimizers were unable to handle the code
effectively.  Often, the problem is that your code is too big or too
complex; GCC will refuse to optimize programs when the optimization
itself is likely to take inordinate amounts of time.
<BR><BR>
<DT><B>-Werror</B>
<DD>Make all warnings into errors.
</DL>
