Commit ccd4e386 by Ralf Wildenhues Committed by Gerald Pfeifer

re PR driver/30330 (-Wdeprecated is not documented)

	PR documentation/30330
	* doc/invoke.texi (C++ Dialect Options)
	(Objective-C and Objective-C++ Dialect Options, Warning Options):
	For each warning option -Wfoo that allows -Wno-foo, ensure both
	-Wfoo and -Wno-foo are listed in the option index.  Fix index
	entry of -Wswitch-default, index -Wnormalized= including the
	`=', and -Wlarger-than-@var{len} including @var{len}.

From-SVN: r132131
parent 4e6a492c
2008-02-06 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR documentation/30330
* doc/invoke.texi (C++ Dialect Options)
(Objective-C and Objective-C++ Dialect Options, Warning Options):
For each warning option -Wfoo that allows -Wno-foo, ensure both
-Wfoo and -Wno-foo are listed in the option index. Fix index
entry of -Wswitch-default, index -Wnormalized= including the
`=', and -Wlarger-than-@var{len} including @var{len}.
2008-02-05 Uros Bizjak <ubizjak@gmail.com> 2008-02-05 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (floatunssisf2): Use * config/i386/i386.md (floatunssisf2): Use
......
...@@ -1908,6 +1908,7 @@ inlined by default. ...@@ -1908,6 +1908,7 @@ inlined by default.
@item -Wabi @r{(C++ only)} @item -Wabi @r{(C++ only)}
@opindex Wabi @opindex Wabi
@opindex Wno-abi
Warn when G++ generates code that is probably not compatible with the Warn when G++ generates code that is probably not compatible with the
vendor-neutral C++ ABI@. Although an effort has been made to warn about vendor-neutral C++ ABI@. Although an effort has been made to warn about
all such cases, there are probably some cases that are not warned about, all such cases, there are probably some cases that are not warned about,
...@@ -2007,12 +2008,14 @@ Instantiations of these templates may be mangled incorrectly. ...@@ -2007,12 +2008,14 @@ Instantiations of these templates may be mangled incorrectly.
@item -Wctor-dtor-privacy @r{(C++ only)} @item -Wctor-dtor-privacy @r{(C++ only)}
@opindex Wctor-dtor-privacy @opindex Wctor-dtor-privacy
@opindex Wno-ctor-dtor-privacy
Warn when a class seems unusable because all the constructors or Warn when a class seems unusable because all the constructors or
destructors in that class are private, and it has neither friends nor destructors in that class are private, and it has neither friends nor
public static member functions. public static member functions.
@item -Wnon-virtual-dtor @r{(C++ only)} @item -Wnon-virtual-dtor @r{(C++ only)}
@opindex Wnon-virtual-dtor @opindex Wnon-virtual-dtor
@opindex Wno-non-virtual-dtor
Warn when a class has virtual functions and accessible non-virtual Warn when a class has virtual functions and accessible non-virtual
destructor, in which case it would be possible but unsafe to delete 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. an instance of a derived class through a pointer to the base class.
...@@ -2020,6 +2023,7 @@ This warning is also enabled if -Weffc++ is specified. ...@@ -2020,6 +2023,7 @@ This warning is also enabled if -Weffc++ is specified.
@item -Wreorder @r{(C++ only)} @item -Wreorder @r{(C++ only)}
@opindex Wreorder @opindex Wreorder
@opindex Wno-reorder
@cindex reordering, warning @cindex reordering, warning
@cindex warning for reordering of member initializers @cindex warning for reordering of member initializers
Warn when the order of member initializers given in the code does not Warn when the order of member initializers given in the code does not
...@@ -2043,6 +2047,7 @@ The following @option{-W@dots{}} options are not affected by @option{-Wall}. ...@@ -2043,6 +2047,7 @@ The following @option{-W@dots{}} options are not affected by @option{-Wall}.
@table @gcctabopt @table @gcctabopt
@item -Weffc++ @r{(C++ only)} @item -Weffc++ @r{(C++ only)}
@opindex Weffc++ @opindex Weffc++
@opindex Wno-effc++
Warn about violations of the following style guidelines from Scott Meyers' Warn about violations of the following style guidelines from Scott Meyers'
@cite{Effective C++} book: @cite{Effective C++} book:
...@@ -2084,10 +2089,12 @@ to filter out those warnings. ...@@ -2084,10 +2089,12 @@ to filter out those warnings.
@item -Wno-deprecated @r{(C++ only)} @item -Wno-deprecated @r{(C++ only)}
@opindex Wno-deprecated @opindex Wno-deprecated
@opindex Wdeprecated
Do not warn about usage of deprecated features. @xref{Deprecated Features}. Do not warn about usage of deprecated features. @xref{Deprecated Features}.
@item -Wstrict-null-sentinel @r{(C++ only)} @item -Wstrict-null-sentinel @r{(C++ only)}
@opindex Wstrict-null-sentinel @opindex Wstrict-null-sentinel
@opindex Wno-strict-null-sentinel
Warn also about the use of an uncasted @code{NULL} as sentinel. When Warn also about the use of an uncasted @code{NULL} as sentinel. When
compiling only with GCC this is a valid sentinel, as @code{NULL} is defined compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
to @code{__null}. Although it is a null pointer constant not a null pointer, to @code{__null}. Although it is a null pointer constant not a null pointer,
...@@ -2096,6 +2103,7 @@ not portable across different compilers. ...@@ -2096,6 +2103,7 @@ not portable across different compilers.
@item -Wno-non-template-friend @r{(C++ only)} @item -Wno-non-template-friend @r{(C++ only)}
@opindex Wno-non-template-friend @opindex Wno-non-template-friend
@opindex Wnon-template-friend
Disable warnings when non-templatized friend functions are declared Disable warnings when non-templatized friend functions are declared
within a template. Since the advent of explicit template specification 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., support in G++, if the name of the friend is an unqualified-id (i.e.,
...@@ -2112,6 +2120,7 @@ but disables the helpful warning. ...@@ -2112,6 +2120,7 @@ but disables the helpful warning.
@item -Wold-style-cast @r{(C++ only)} @item -Wold-style-cast @r{(C++ only)}
@opindex Wold-style-cast @opindex Wold-style-cast
@opindex Wno-old-style-cast
Warn if an old-style (C-style) cast to a non-void type is used within Warn if an old-style (C-style) cast to a non-void type is used within
a C++ program. The new-style casts (@samp{dynamic_cast}, a C++ program. The new-style casts (@samp{dynamic_cast},
@samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
...@@ -2119,6 +2128,7 @@ less vulnerable to unintended effects and much easier to search for. ...@@ -2119,6 +2128,7 @@ less vulnerable to unintended effects and much easier to search for.
@item -Woverloaded-virtual @r{(C++ only)} @item -Woverloaded-virtual @r{(C++ only)}
@opindex Woverloaded-virtual @opindex Woverloaded-virtual
@opindex Wno-overloaded-virtual
@cindex overloaded virtual fn, warning @cindex overloaded virtual fn, warning
@cindex warning for overloaded virtual fn @cindex warning for overloaded virtual fn
Warn when a function declaration hides virtual functions from a Warn when a function declaration hides virtual functions from a
...@@ -2146,11 +2156,13 @@ will fail to compile. ...@@ -2146,11 +2156,13 @@ will fail to compile.
@item -Wno-pmf-conversions @r{(C++ only)} @item -Wno-pmf-conversions @r{(C++ only)}
@opindex Wno-pmf-conversions @opindex Wno-pmf-conversions
@opindex Wpmf-conversions
Disable the diagnostic for converting a bound pointer to member function Disable the diagnostic for converting a bound pointer to member function
to a plain pointer. to a plain pointer.
@item -Wsign-promo @r{(C++ only)} @item -Wsign-promo @r{(C++ only)}
@opindex Wsign-promo @opindex Wsign-promo
@opindex Wno-sign-promo
Warn when overload resolution chooses a promotion from unsigned or Warn when overload resolution chooses a promotion from unsigned or
enumerated type to a signed type, over a conversion to an unsigned type of 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 the same size. Previous versions of G++ would try to preserve
...@@ -2390,11 +2402,13 @@ file named @file{@var{sourcename}.decl}. ...@@ -2390,11 +2402,13 @@ file named @file{@var{sourcename}.decl}.
@item -Wassign-intercept @item -Wassign-intercept
@opindex Wassign-intercept @opindex Wassign-intercept
@opindex Wno-assign-intercept
Warn whenever an Objective-C assignment is being intercepted by the Warn whenever an Objective-C assignment is being intercepted by the
garbage collector. garbage collector.
@item -Wno-protocol @item -Wno-protocol
@opindex Wno-protocol @opindex Wno-protocol
@opindex Wprotocol
If a class is declared to implement a protocol, a warning is issued for 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 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 default behavior is to issue a warning for every method not explicitly
...@@ -2405,6 +2419,7 @@ and no warning is issued for them. ...@@ -2405,6 +2419,7 @@ and no warning is issued for them.
@item -Wselector @item -Wselector
@opindex Wselector @opindex Wselector
@opindex Wno-selector
Warn if multiple methods of different types for the same selector are Warn if multiple methods of different types for the same selector are
found during compilation. The check is performed on the list of methods found during compilation. The check is performed on the list of methods
in the final stage of compilation. Additionally, a check is performed in the final stage of compilation. Additionally, a check is performed
...@@ -2418,6 +2433,7 @@ being used. ...@@ -2418,6 +2433,7 @@ being used.
@item -Wstrict-selector-match @item -Wstrict-selector-match
@opindex Wstrict-selector-match @opindex Wstrict-selector-match
@opindex Wno-strict-selector-match
Warn if multiple methods with differing argument and/or return types are 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 found for a given selector when attempting to send a message using this
selector to a receiver of type @code{id} or @code{Class}. When this flag selector to a receiver of type @code{id} or @code{Class}. When this flag
...@@ -2427,6 +2443,7 @@ and alignment. ...@@ -2427,6 +2443,7 @@ and alignment.
@item -Wundeclared-selector @item -Wundeclared-selector
@opindex Wundeclared-selector @opindex Wundeclared-selector
@opindex Wno-undeclared-selector
Warn if a @code{@@selector(@dots{})} expression referring to an Warn if a @code{@@selector(@dots{})} expression referring to an
undeclared selector is found. A selector is considered undeclared if no undeclared selector is found. A selector is considered undeclared if no
method with that name has been declared before the method with that name has been declared before the
...@@ -2532,10 +2549,12 @@ Inhibit all warning messages. ...@@ -2532,10 +2549,12 @@ Inhibit all warning messages.
@item -Werror @item -Werror
@opindex Werror @opindex Werror
@opindex Wno-error
Make all warnings into errors. Make all warnings into errors.
@item -Werror= @item -Werror=
@opindex Werror= @opindex Werror=
@opindex Wno-error=
Make the specified warning into an error. The specifier for a warning Make the specified warning into an error. The specifier for a warning
is appended, for example @option{-Werror=switch} turns the warnings is appended, for example @option{-Werror=switch} turns the warnings
controlled by @option{-Wswitch} into errors. This switch takes a controlled by @option{-Wswitch} into errors. This switch takes a
...@@ -2552,6 +2571,7 @@ imply anything. ...@@ -2552,6 +2571,7 @@ imply anything.
@item -Wfatal-errors @item -Wfatal-errors
@opindex Wfatal-errors @opindex Wfatal-errors
@opindex Wno-fatal-errors
This option causes the compiler to abort compilation on the first error This option causes the compiler to abort compilation on the first error
occurred rather than trying to keep going and printing further error occurred rather than trying to keep going and printing further error
messages. messages.
...@@ -2616,6 +2636,7 @@ warnings. ...@@ -2616,6 +2636,7 @@ warnings.
@item -Wall @item -Wall
@opindex Wall @opindex Wall
@opindex Wno-all
This enables all the warnings about constructions that some users This enables all the warnings about constructions that some users
consider questionable, and that are easy to avoid (or modify to consider questionable, and that are easy to avoid (or modify to
prevent the warning), even in conjunction with macros. This also prevent the warning), even in conjunction with macros. This also
...@@ -2664,6 +2685,7 @@ them must be enabled individually. ...@@ -2664,6 +2685,7 @@ them must be enabled individually.
@item -Wextra @item -Wextra
@opindex W @opindex W
@opindex Wextra @opindex Wextra
@opindex Wno-extra
This enables some extra warning flags that are not enabled by This enables some extra warning flags that are not enabled by
@option{-Wall}. (This option used to be called @option{-W}. The older @option{-Wall}. (This option used to be called @option{-W}. The older
name is still supported, but the newer name is more descriptive.) name is still supported, but the newer name is more descriptive.)
...@@ -2716,10 +2738,12 @@ constructor. ...@@ -2716,10 +2738,12 @@ constructor.
@item -Wno-import @item -Wno-import
@opindex Wno-import @opindex Wno-import
@opindex Wimport
Inhibit warning messages about the use of @samp{#import}. Inhibit warning messages about the use of @samp{#import}.
@item -Wchar-subscripts @item -Wchar-subscripts
@opindex Wchar-subscripts @opindex Wchar-subscripts
@opindex Wno-char-subscripts
Warn if an array subscript has type @code{char}. This is a common cause Warn if an array subscript has type @code{char}. This is a common cause
of error, as programmers often forget that this type is signed on some of error, as programmers often forget that this type is signed on some
machines. machines.
...@@ -2727,12 +2751,14 @@ This warning is enabled by @option{-Wall}. ...@@ -2727,12 +2751,14 @@ This warning is enabled by @option{-Wall}.
@item -Wcomment @item -Wcomment
@opindex Wcomment @opindex Wcomment
@opindex Wno-comment
Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*} Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
comment, or whenever a Backslash-Newline appears in a @samp{//} comment. comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
This warning is enabled by @option{-Wall}. This warning is enabled by @option{-Wall}.
@item -Wformat @item -Wformat
@opindex Wformat @opindex Wformat
@opindex Wno-format
@opindex ffreestanding @opindex ffreestanding
@opindex fno-builtin @opindex fno-builtin
Check calls to @code{printf} and @code{scanf}, etc., to make sure that Check calls to @code{printf} and @code{scanf}, etc., to make sure that
...@@ -2769,11 +2795,13 @@ aspects of format checking, the options @option{-Wformat-y2k}, ...@@ -2769,11 +2795,13 @@ aspects of format checking, the options @option{-Wformat-y2k},
@item -Wformat-y2k @item -Wformat-y2k
@opindex Wformat-y2k @opindex Wformat-y2k
@opindex Wno-format-y2k
If @option{-Wformat} is specified, also warn about @code{strftime} If @option{-Wformat} is specified, also warn about @code{strftime}
formats which may yield only a two-digit year. formats which may yield only a two-digit year.
@item -Wno-format-extra-args @item -Wno-format-extra-args
@opindex Wno-format-extra-args @opindex Wno-format-extra-args
@opindex Wformat-extra-args
If @option{-Wformat} is specified, do not warn about excess arguments to a If @option{-Wformat} is specified, do not warn about excess arguments to a
@code{printf} or @code{scanf} format function. The C standard specifies @code{printf} or @code{scanf} format function. The C standard specifies
that such arguments are ignored. that such arguments are ignored.
...@@ -2788,17 +2816,20 @@ Unix Specification says that such unused arguments are allowed. ...@@ -2788,17 +2816,20 @@ Unix Specification says that such unused arguments are allowed.
@item -Wno-format-zero-length @item -Wno-format-zero-length
@opindex Wno-format-zero-length @opindex Wno-format-zero-length
@opindex Wformat-zero-length
If @option{-Wformat} is specified, do not warn about zero-length formats. If @option{-Wformat} is specified, do not warn about zero-length formats.
The C standard specifies that zero-length formats are allowed. The C standard specifies that zero-length formats are allowed.
@item -Wformat-nonliteral @item -Wformat-nonliteral
@opindex Wformat-nonliteral @opindex Wformat-nonliteral
@opindex Wno-format-nonliteral
If @option{-Wformat} is specified, also warn if the format string is not a If @option{-Wformat} is specified, also warn if the format string is not a
string literal and so cannot be checked, unless the format function string literal and so cannot be checked, unless the format function
takes its format arguments as a @code{va_list}. takes its format arguments as a @code{va_list}.
@item -Wformat-security @item -Wformat-security
@opindex Wformat-security @opindex Wformat-security
@opindex Wno-format-security
If @option{-Wformat} is specified, also warn about uses of format If @option{-Wformat} is specified, also warn about uses of format
functions that represent possible security problems. At present, this functions that represent possible security problems. At present, this
warns about calls to @code{printf} and @code{scanf} functions where the warns about calls to @code{printf} and @code{scanf} functions where the
...@@ -2811,12 +2842,14 @@ included in @option{-Wformat-nonliteral}.) ...@@ -2811,12 +2842,14 @@ included in @option{-Wformat-nonliteral}.)
@item -Wformat=2 @item -Wformat=2
@opindex Wformat=2 @opindex Wformat=2
@opindex Wno-format=2
Enable @option{-Wformat} plus format checks not included in Enable @option{-Wformat} plus format checks not included in
@option{-Wformat}. Currently equivalent to @samp{-Wformat @option{-Wformat}. Currently equivalent to @samp{-Wformat
-Wformat-nonliteral -Wformat-security -Wformat-y2k}. -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
@item -Wnonnull @item -Wnonnull
@opindex Wnonnull @opindex Wnonnull
@opindex Wno-nonnull
Warn about passing a null pointer for arguments marked as Warn about passing a null pointer for arguments marked as
requiring a non-null value by the @code{nonnull} function attribute. requiring a non-null value by the @code{nonnull} function attribute.
...@@ -2825,6 +2858,7 @@ can be disabled with the @option{-Wno-nonnull} option. ...@@ -2825,6 +2858,7 @@ can be disabled with the @option{-Wno-nonnull} option.
@item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)} @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
@opindex Winit-self @opindex Winit-self
@opindex Wno-init-self
Warn about uninitialized variables which are initialized with themselves. Warn about uninitialized variables which are initialized with themselves.
Note this option can only be used with the @option{-Wuninitialized} option, Note this option can only be used with the @option{-Wuninitialized} option,
which in turn only works with @option{-O1} and above. which in turn only works with @option{-O1} and above.
...@@ -2843,6 +2877,7 @@ int f() ...@@ -2843,6 +2877,7 @@ int f()
@item -Wimplicit-int @item -Wimplicit-int
@opindex Wimplicit-int @opindex Wimplicit-int
@opindex Wno-implicit-int
Warn when a declaration does not specify a type. Warn when a declaration does not specify a type.
This warning is enabled by @option{-Wall}. This warning is enabled by @option{-Wall}.
...@@ -2857,6 +2892,7 @@ enabled by default and it is made into an error by ...@@ -2857,6 +2892,7 @@ enabled by default and it is made into an error by
@item -Wimplicit @item -Wimplicit
@opindex Wimplicit @opindex Wimplicit
@opindex Wno-implicit
Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}. Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
This warning is enabled by @option{-Wall}. This warning is enabled by @option{-Wall}.
...@@ -2875,6 +2911,7 @@ This warning is also enabled by @option{-Wextra}. ...@@ -2875,6 +2911,7 @@ This warning is also enabled by @option{-Wextra}.
@item -Wmain @item -Wmain
@opindex Wmain @opindex Wmain
@opindex Wno-main
Warn if the type of @samp{main} is suspicious. @samp{main} should be a Warn if the type of @samp{main} is suspicious. @samp{main} should be a
function with external linkage, returning int, taking either zero function with external linkage, returning int, taking either zero
arguments, two, or three arguments of appropriate types. arguments, two, or three arguments of appropriate types.
...@@ -2882,6 +2919,7 @@ This warning is enabled by @option{-Wall}. ...@@ -2882,6 +2919,7 @@ This warning is enabled by @option{-Wall}.
@item -Wmissing-braces @item -Wmissing-braces
@opindex Wmissing-braces @opindex Wmissing-braces
@opindex Wno-missing-braces
Warn if an aggregate or union initializer is not fully bracketed. In Warn if an aggregate or union initializer is not fully bracketed. In
the following example, the initializer for @samp{a} is not fully the following example, the initializer for @samp{a} is not fully
bracketed, but that for @samp{b} is fully bracketed. bracketed, but that for @samp{b} is fully bracketed.
...@@ -2895,10 +2933,12 @@ This warning is enabled by @option{-Wall}. ...@@ -2895,10 +2933,12 @@ This warning is enabled by @option{-Wall}.
@item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)} @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
@opindex Wmissing-include-dirs @opindex Wmissing-include-dirs
@opindex Wno-missing-include-dirs
Warn if a user-supplied include directory does not exist. Warn if a user-supplied include directory does not exist.
@item -Wparentheses @item -Wparentheses
@opindex Wparentheses @opindex Wparentheses
@opindex Wno-parentheses
Warn if parentheses are omitted in certain contexts, such Warn if parentheses are omitted in certain contexts, such
as when there is an assignment in a context where a truth value as when there is an assignment in a context where a truth value
is expected, or when operators are nested whose precedence people is expected, or when operators are nested whose precedence people
...@@ -2952,6 +2992,7 @@ This warning is enabled by @option{-Wall}. ...@@ -2952,6 +2992,7 @@ This warning is enabled by @option{-Wall}.
@item -Wsequence-point @item -Wsequence-point
@opindex Wsequence-point @opindex Wsequence-point
@opindex Wno-sequence-point
Warn about code that may have undefined semantics because of violations Warn about code that may have undefined semantics because of violations
of sequence point rules in the C and C++ standards. of sequence point rules in the C and C++ standards.
...@@ -3013,6 +3054,7 @@ This warning is enabled by @option{-Wall}. ...@@ -3013,6 +3054,7 @@ This warning is enabled by @option{-Wall}.
@item -Wswitch @item -Wswitch
@opindex Wswitch @opindex Wswitch
@opindex Wno-switch
Warn whenever a @code{switch} statement has an index of enumerated type Warn whenever a @code{switch} statement has an index of enumerated type
and lacks a @code{case} for one or more of the named codes of that and lacks a @code{case} for one or more of the named codes of that
enumeration. (The presence of a @code{default} label prevents this enumeration. (The presence of a @code{default} label prevents this
...@@ -3021,12 +3063,14 @@ provoke warnings when this option is used. ...@@ -3021,12 +3063,14 @@ provoke warnings when this option is used.
This warning is enabled by @option{-Wall}. This warning is enabled by @option{-Wall}.
@item -Wswitch-default @item -Wswitch-default
@opindex Wswitch-switch @opindex Wswitch-default
@opindex Wno-switch-default
Warn whenever a @code{switch} statement does not have a @code{default} Warn whenever a @code{switch} statement does not have a @code{default}
case. case.
@item -Wswitch-enum @item -Wswitch-enum
@opindex Wswitch-enum @opindex Wswitch-enum
@opindex Wno-switch-enum
Warn whenever a @code{switch} statement has an index of enumerated type Warn whenever a @code{switch} statement has an index of enumerated type
and lacks a @code{case} for one or more of the named codes of that and lacks a @code{case} for one or more of the named codes of that
enumeration. @code{case} labels outside the enumeration range also enumeration. @code{case} labels outside the enumeration range also
...@@ -3034,18 +3078,21 @@ provoke warnings when this option is used. ...@@ -3034,18 +3078,21 @@ provoke warnings when this option is used.
@item -Wtrigraphs @item -Wtrigraphs
@opindex Wtrigraphs @opindex Wtrigraphs
@opindex Wno-trigraphs
Warn if any trigraphs are encountered that might change the meaning of Warn if any trigraphs are encountered that might change the meaning of
the program (trigraphs within comments are not warned about). the program (trigraphs within comments are not warned about).
This warning is enabled by @option{-Wall}. This warning is enabled by @option{-Wall}.
@item -Wunused-function @item -Wunused-function
@opindex Wunused-function @opindex Wunused-function
@opindex Wno-unused-function
Warn whenever a static function is declared but not defined or a Warn whenever a static function is declared but not defined or a
non-inline static function is unused. non-inline static function is unused.
This warning is enabled by @option{-Wall}. This warning is enabled by @option{-Wall}.
@item -Wunused-label @item -Wunused-label
@opindex Wunused-label @opindex Wunused-label
@opindex Wno-unused-label
Warn whenever a label is declared but not used. Warn whenever a label is declared but not used.
This warning is enabled by @option{-Wall}. This warning is enabled by @option{-Wall}.
...@@ -3054,6 +3101,7 @@ To suppress this warning use the @samp{unused} attribute ...@@ -3054,6 +3101,7 @@ To suppress this warning use the @samp{unused} attribute
@item -Wunused-parameter @item -Wunused-parameter
@opindex Wunused-parameter @opindex Wunused-parameter
@opindex Wno-unused-parameter
Warn whenever a function parameter is unused aside from its declaration. Warn whenever a function parameter is unused aside from its declaration.
To suppress this warning use the @samp{unused} attribute To suppress this warning use the @samp{unused} attribute
...@@ -3061,6 +3109,7 @@ To suppress this warning use the @samp{unused} attribute ...@@ -3061,6 +3109,7 @@ To suppress this warning use the @samp{unused} attribute
@item -Wunused-variable @item -Wunused-variable
@opindex Wunused-variable @opindex Wunused-variable
@opindex Wno-unused-variable
Warn whenever a local variable or non-constant static variable is unused Warn whenever a local variable or non-constant static variable is unused
aside from its declaration. aside from its declaration.
This warning is enabled by @option{-Wall}. This warning is enabled by @option{-Wall}.
...@@ -3070,6 +3119,7 @@ To suppress this warning use the @samp{unused} attribute ...@@ -3070,6 +3119,7 @@ To suppress this warning use the @samp{unused} attribute
@item -Wunused-value @item -Wunused-value
@opindex Wunused-value @opindex Wunused-value
@opindex Wno-unused-value
Warn whenever a statement computes a result that is explicitly not Warn whenever a statement computes a result that is explicitly not
used. To suppress this warning cast the unused expression to used. To suppress this warning cast the unused expression to
@samp{void}. This includes an expression-statement or the left-hand @samp{void}. This includes an expression-statement or the left-hand
...@@ -3081,6 +3131,7 @@ This warning is enabled by @option{-Wall}. ...@@ -3081,6 +3131,7 @@ This warning is enabled by @option{-Wall}.
@item -Wunused @item -Wunused
@opindex Wunused @opindex Wunused
@opindex Wno-unused
All the above @option{-Wunused} options combined. All the above @option{-Wunused} options combined.
In order to get a warning about an unused function parameter, you must In order to get a warning about an unused function parameter, you must
...@@ -3089,6 +3140,7 @@ either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies ...@@ -3089,6 +3140,7 @@ either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
@item -Wuninitialized @item -Wuninitialized
@opindex Wuninitialized @opindex Wuninitialized
@opindex Wno-uninitialized
Warn if an automatic variable is used without first being initialized or Warn if an automatic variable is used without first being initialized or
if a variable may be clobbered by a @code{setjmp} call. if a variable may be clobbered by a @code{setjmp} call.
...@@ -3173,6 +3225,7 @@ optimizing compilations (@option{-O1} and above). ...@@ -3173,6 +3225,7 @@ optimizing compilations (@option{-O1} and above).
@item -Wunknown-pragmas @item -Wunknown-pragmas
@opindex Wunknown-pragmas @opindex Wunknown-pragmas
@opindex Wno-unknown-pragmas
@cindex warning for unknown pragmas @cindex warning for unknown pragmas
@cindex unknown pragmas, warning @cindex unknown pragmas, warning
@cindex pragmas, warning of unknown @cindex pragmas, warning of unknown
...@@ -3190,6 +3243,7 @@ invalid syntax, or conflicts between pragmas. See also ...@@ -3190,6 +3243,7 @@ invalid syntax, or conflicts between pragmas. See also
@item -Wstrict-aliasing @item -Wstrict-aliasing
@opindex Wstrict-aliasing @opindex Wstrict-aliasing
@opindex Wno-strict-aliasing
This option is only active when @option{-fstrict-aliasing} is active. This option is only active when @option{-fstrict-aliasing} is active.
It warns about code which might break the strict aliasing rules that the It warns about code which might break the strict aliasing rules that the
compiler is using for optimization. The warning does not catch all compiler is using for optimization. The warning does not catch all
...@@ -3199,6 +3253,7 @@ It is equivalent to @option{-Wstrict-aliasing=3} ...@@ -3199,6 +3253,7 @@ It is equivalent to @option{-Wstrict-aliasing=3}
@item -Wstrict-aliasing=n @item -Wstrict-aliasing=n
@opindex Wstrict-aliasing=n @opindex Wstrict-aliasing=n
@opindex Wno-strict-aliasing=n
This option is only active when @option{-fstrict-aliasing} is active. This option is only active when @option{-fstrict-aliasing} is active.
It warns about code which might break the strict aliasing rules that the It warns about code which might break the strict aliasing rules that the
compiler is using for optimization. compiler is using for optimization.
...@@ -3233,6 +3288,7 @@ Does not warn about incomplete types. ...@@ -3233,6 +3288,7 @@ Does not warn about incomplete types.
@item -Wstrict-overflow @item -Wstrict-overflow
@itemx -Wstrict-overflow=@var{n} @itemx -Wstrict-overflow=@var{n}
@opindex Wstrict-overflow @opindex Wstrict-overflow
@opindex Wno-strict-overflow
This option is only active when @option{-fstrict-overflow} is active. This option is only active when @option{-fstrict-overflow} is active.
It warns about cases where the compiler optimizes based on the It warns about cases where the compiler optimizes based on the
assumption that signed overflow does not occur. Note that it does not assumption that signed overflow does not occur. Note that it does not
...@@ -3299,6 +3355,7 @@ obtaining infinities and NaNs. ...@@ -3299,6 +3355,7 @@ obtaining infinities and NaNs.
@item -Wsystem-headers @item -Wsystem-headers
@opindex Wsystem-headers @opindex Wsystem-headers
@opindex Wno-system-headers
@cindex warnings from system headers @cindex warnings from system headers
@cindex system headers, warnings from @cindex system headers, warnings from
Print warning messages for constructs found in system header files. Print warning messages for constructs found in system header files.
...@@ -3312,6 +3369,7 @@ headers---for that, @option{-Wunknown-pragmas} must also be used. ...@@ -3312,6 +3369,7 @@ headers---for that, @option{-Wunknown-pragmas} must also be used.
@item -Wfloat-equal @item -Wfloat-equal
@opindex Wfloat-equal @opindex Wfloat-equal
@opindex Wno-float-equal
Warn if floating point values are used in equality comparisons. Warn if floating point values are used in equality comparisons.
The idea behind this is that sometimes it is convenient (for the The idea behind this is that sometimes it is convenient (for the
...@@ -3327,6 +3385,7 @@ probably mistaken. ...@@ -3327,6 +3385,7 @@ probably mistaken.
@item -Wtraditional @r{(C only)} @item -Wtraditional @r{(C only)}
@opindex Wtraditional @opindex Wtraditional
@opindex Wno-traditional
Warn about certain constructs that behave differently in traditional and Warn about certain constructs that behave differently in traditional and
ISO C@. Also warn about ISO C constructs that have no traditional C ISO C@. Also warn about ISO C constructs that have no traditional C
equivalent, and/or problematic constructs which should be avoided. equivalent, and/or problematic constructs which should be avoided.
...@@ -3415,6 +3474,7 @@ traditional C compatibility. ...@@ -3415,6 +3474,7 @@ traditional C compatibility.
@item -Wtraditional-conversion @r{(C only)} @item -Wtraditional-conversion @r{(C only)}
@opindex Wtraditional-conversion @opindex Wtraditional-conversion
@opindex Wno-traditional-conversion
Warn if a prototype causes a type conversion that is different from what 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 would happen to the same argument in the absence of a prototype. This
includes conversions of fixed point to floating and vice versa, and includes conversions of fixed point to floating and vice versa, and
...@@ -3423,6 +3483,7 @@ except when the same as the default promotion. ...@@ -3423,6 +3483,7 @@ except when the same as the default promotion.
@item -Wdeclaration-after-statement @r{(C only)} @item -Wdeclaration-after-statement @r{(C only)}
@opindex Wdeclaration-after-statement @opindex Wdeclaration-after-statement
@opindex Wno-declaration-after-statement
Warn when a declaration is found after a statement in a block. This Warn when a declaration is found after a statement in a block. This
construct, known from C++, was introduced with ISO C99 and is by default construct, known from C++, was introduced with ISO C99 and is by default
allowed in GCC@. It is not supported by ISO C90 and was not supported by allowed in GCC@. It is not supported by ISO C90 and was not supported by
...@@ -3430,6 +3491,7 @@ GCC versions before GCC 3.0. @xref{Mixed Declarations}. ...@@ -3430,6 +3491,7 @@ GCC versions before GCC 3.0. @xref{Mixed Declarations}.
@item -Wundef @item -Wundef
@opindex Wundef @opindex Wundef
@opindex Wno-undef
Warn if an undefined identifier is evaluated in an @samp{#if} directive. Warn if an undefined identifier is evaluated in an @samp{#if} directive.
@item -Wno-endif-labels @item -Wno-endif-labels
...@@ -3439,15 +3501,17 @@ Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text. ...@@ -3439,15 +3501,17 @@ Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
@item -Wshadow @item -Wshadow
@opindex Wshadow @opindex Wshadow
@opindex Wno-shadow
Warn whenever a local variable shadows another local variable, parameter or Warn whenever a local variable shadows another local variable, parameter or
global variable or whenever a built-in function is shadowed. global variable or whenever a built-in function is shadowed.
@item -Wlarger-than-@var{len} @item -Wlarger-than-@var{len}
@opindex Wlarger-than @opindex Wlarger-than-@var{len}
Warn whenever an object of larger than @var{len} bytes is defined. Warn whenever an object of larger than @var{len} bytes is defined.
@item -Wunsafe-loop-optimizations @item -Wunsafe-loop-optimizations
@opindex Wunsafe-loop-optimizations @opindex Wunsafe-loop-optimizations
@opindex Wno-unsafe-loop-optimizations
Warn if the loop cannot be optimized because the compiler could not Warn if the loop cannot be optimized because the compiler could not
assume anything on the bounds of the loop indices. With assume anything on the bounds of the loop indices. With
@option{-funsafe-loop-optimizations} warn if the compiler made @option{-funsafe-loop-optimizations} warn if the compiler made
...@@ -3455,6 +3519,7 @@ such assumptions. ...@@ -3455,6 +3519,7 @@ such assumptions.
@item -Wpointer-arith @item -Wpointer-arith
@opindex Wpointer-arith @opindex Wpointer-arith
@opindex Wno-pointer-arith
Warn about anything that depends on the ``size of'' a function type or Warn about anything that depends on the ``size of'' a function type or
of @code{void}. GNU C assigns these types a size of 1, for of @code{void}. GNU C assigns these types a size of 1, for
convenience in calculations with @code{void *} pointers and pointers convenience in calculations with @code{void *} pointers and pointers
...@@ -3472,6 +3537,7 @@ example, warn if an unsigned variable is compared against zero with ...@@ -3472,6 +3537,7 @@ example, warn if an unsigned variable is compared against zero with
@item -Wbad-function-cast @r{(C only)} @item -Wbad-function-cast @r{(C only)}
@opindex Wbad-function-cast @opindex Wbad-function-cast
@opindex Wno-bad-function-cast
Warn whenever a function call is cast to a non-matching type. Warn whenever a function call is cast to a non-matching type.
For example, warn if @code{int malloc()} is cast to @code{anything *}. For example, warn if @code{int malloc()} is cast to @code{anything *}.
...@@ -3487,12 +3553,14 @@ in ISO C++ 200x. This warning is enabled by @option{-Wall}. ...@@ -3487,12 +3553,14 @@ in ISO C++ 200x. This warning is enabled by @option{-Wall}.
@item -Wcast-qual @item -Wcast-qual
@opindex Wcast-qual @opindex Wcast-qual
@opindex Wno-cast-qual
Warn whenever a pointer is cast so as to remove a type qualifier from Warn whenever a pointer is cast so as to remove a type qualifier from
the target type. For example, warn if a @code{const char *} is cast the target type. For example, warn if a @code{const char *} is cast
to an ordinary @code{char *}. to an ordinary @code{char *}.
@item -Wcast-align @item -Wcast-align
@opindex Wcast-align @opindex Wcast-align
@opindex Wno-cast-align
Warn whenever a pointer is cast such that the required alignment of the Warn whenever a pointer is cast such that the required alignment of the
target is increased. For example, warn if a @code{char *} is cast to target is increased. For example, warn if a @code{char *} is cast to
an @code{int *} on machines where integers can only be accessed at an @code{int *} on machines where integers can only be accessed at
...@@ -3500,6 +3568,7 @@ two- or four-byte boundaries. ...@@ -3500,6 +3568,7 @@ two- or four-byte boundaries.
@item -Wwrite-strings @item -Wwrite-strings
@opindex Wwrite-strings @opindex Wwrite-strings
@opindex Wno-write-strings
When compiling C, give string constants the type @code{const When compiling C, give string constants the type @code{const
char[@var{length}]} so that char[@var{length}]} so that
copying the address of one into a non-@code{const} @code{char *} copying the address of one into a non-@code{const} @code{char *}
...@@ -3514,6 +3583,7 @@ this is why we did not make @option{-Wall} request these warnings. ...@@ -3514,6 +3583,7 @@ this is why we did not make @option{-Wall} request these warnings.
@item -Wclobbered @item -Wclobbered
@opindex Wclobbered @opindex Wclobbered
@opindex Wno-clobbered
Warn for variables that might be changed by @samp{longjmp} or Warn for variables that might be changed by @samp{longjmp} or
@samp{vfork}. This warning is also enabled by @option{-Wextra}. @samp{vfork}. This warning is also enabled by @option{-Wextra}.
...@@ -3540,6 +3610,7 @@ integers are disabled by default in C++ unless ...@@ -3540,6 +3610,7 @@ integers are disabled by default in C++ unless
@item -Wempty-body @item -Wempty-body
@opindex Wempty-body @opindex Wempty-body
@opindex Wno-empty-body
Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
while} statement. Additionally, in C++, warn when an empty body occurs while} statement. Additionally, in C++, warn when an empty body occurs
in a @samp{while} or @samp{for} statement with no whitespacing before in a @samp{while} or @samp{for} statement with no whitespacing before
...@@ -3547,6 +3618,7 @@ the semicolon. This warning is also enabled by @option{-Wextra}. ...@@ -3547,6 +3618,7 @@ the semicolon. This warning is also enabled by @option{-Wextra}.
@item -Wsign-compare @item -Wsign-compare
@opindex Wsign-compare @opindex Wsign-compare
@opindex Wno-sign-compare
@cindex warning for comparison of signed and unsigned values @cindex warning for comparison of signed and unsigned values
@cindex comparison of signed and unsigned values, warning @cindex comparison of signed and unsigned values, warning
@cindex signed and unsigned values, comparison warning @cindex signed and unsigned values, comparison warning
...@@ -3587,6 +3659,7 @@ bit-wise operator is likely to be expected. ...@@ -3587,6 +3659,7 @@ bit-wise operator is likely to be expected.
@item -Waggregate-return @item -Waggregate-return
@opindex Waggregate-return @opindex Waggregate-return
@opindex Wno-aggregate-return
Warn if any functions that return structures or unions are defined or Warn if any functions that return structures or unions are defined or
called. (In languages where you can return an array, this also elicits called. (In languages where you can return an array, this also elicits
a warning.) a warning.)
...@@ -3601,6 +3674,7 @@ attributes. ...@@ -3601,6 +3674,7 @@ attributes.
@item -Wstrict-prototypes @r{(C only)} @item -Wstrict-prototypes @r{(C only)}
@opindex Wstrict-prototypes @opindex Wstrict-prototypes
@opindex Wno-strict-prototypes
Warn if a function is declared or defined without specifying the Warn if a function is declared or defined without specifying the
argument types. (An old-style function definition is permitted without argument types. (An old-style function definition is permitted without
a warning if preceded by a declaration which specifies the argument a warning if preceded by a declaration which specifies the argument
...@@ -3608,6 +3682,7 @@ types.) ...@@ -3608,6 +3682,7 @@ types.)
@item -Wold-style-declaration @r{(C only)} @item -Wold-style-declaration @r{(C only)}
@opindex Wold-style-declaration @opindex Wold-style-declaration
@opindex Wno-old-style-declaration
Warn for obsolescent usages, according to the C Standard, in a Warn for obsolescent usages, according to the C Standard, in a
declaration. For example, warn if storage-class specifiers like declaration. For example, warn if storage-class specifiers like
@code{static} are not the first things in a declaration. This warning @code{static} are not the first things in a declaration. This warning
...@@ -3615,11 +3690,13 @@ is also enabled by @option{-Wextra}. ...@@ -3615,11 +3690,13 @@ is also enabled by @option{-Wextra}.
@item -Wold-style-definition @r{(C only)} @item -Wold-style-definition @r{(C only)}
@opindex Wold-style-definition @opindex Wold-style-definition
@opindex Wno-old-style-definition
Warn if an old-style function definition is used. A warning is given Warn if an old-style function definition is used. A warning is given
even if there is a previous prototype. even if there is a previous prototype.
@item -Wmissing-parameter-type @r{(C only)} @item -Wmissing-parameter-type @r{(C only)}
@opindex Wmissing-parameter-type @opindex Wmissing-parameter-type
@opindex Wno-missing-parameter-type
A function parameter is declared without a type specifier in K&R-style A function parameter is declared without a type specifier in K&R-style
functions: functions:
...@@ -3631,6 +3708,7 @@ This warning is also enabled by @option{-Wextra}. ...@@ -3631,6 +3708,7 @@ This warning is also enabled by @option{-Wextra}.
@item -Wmissing-prototypes @r{(C only)} @item -Wmissing-prototypes @r{(C only)}
@opindex Wmissing-prototypes @opindex Wmissing-prototypes
@opindex Wno-missing-prototypes
Warn if a global function is defined without a previous prototype Warn if a global function is defined without a previous prototype
declaration. This warning is issued even if the definition itself declaration. This warning is issued even if the definition itself
provides a prototype. The aim is to detect global functions that fail provides a prototype. The aim is to detect global functions that fail
...@@ -3638,6 +3716,7 @@ to be declared in header files. ...@@ -3638,6 +3716,7 @@ to be declared in header files.
@item -Wmissing-declarations @r{(C and C++ only)} @item -Wmissing-declarations @r{(C and C++ only)}
@opindex Wmissing-declarations @opindex Wmissing-declarations
@opindex Wno-missing-declarations
Warn if a global function is defined without a previous declaration. Warn if a global function is defined without a previous declaration.
Do so even if the definition itself provides a prototype. Do so even if the definition itself provides a prototype.
Use this option to detect global functions that are not declared in Use this option to detect global functions that are not declared in
...@@ -3646,8 +3725,10 @@ or for inline functions, or for functions in anonymous namespaces. ...@@ -3646,8 +3725,10 @@ or for inline functions, or for functions in anonymous namespaces.
@item -Wmissing-field-initializers @item -Wmissing-field-initializers
@opindex Wmissing-field-initializers @opindex Wmissing-field-initializers
@opindex Wno-missing-field-initializers
@opindex W @opindex W
@opindex Wextra @opindex Wextra
@opindex Wno-extra
Warn if a structure's initializer has some fields missing. For Warn if a structure's initializer has some fields missing. For
example, the following code would cause such a warning, because example, the following code would cause such a warning, because
@code{x.h} is implicitly zero: @code{x.h} is implicitly zero:
...@@ -3670,6 +3751,7 @@ warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}. ...@@ -3670,6 +3751,7 @@ warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
@item -Wmissing-noreturn @item -Wmissing-noreturn
@opindex Wmissing-noreturn @opindex Wmissing-noreturn
@opindex Wno-missing-noreturn
Warn about functions which might be candidates for attribute @code{noreturn}. Warn about functions which might be candidates for attribute @code{noreturn}.
Note these are only possible candidates, not absolute ones. Care should Note these are only possible candidates, not absolute ones. Care should
be taken to manually verify functions actually do not ever return before be taken to manually verify functions actually do not ever return before
...@@ -3679,7 +3761,9 @@ hosted C environments. ...@@ -3679,7 +3761,9 @@ hosted C environments.
@item -Wmissing-format-attribute @item -Wmissing-format-attribute
@opindex Wmissing-format-attribute @opindex Wmissing-format-attribute
@opindex Wno-missing-format-attribute
@opindex Wformat @opindex Wformat
@opindex Wno-format
Warn about function pointers which might be candidates for @code{format} Warn about function pointers which might be candidates for @code{format}
attributes. Note these are only possible candidates, not absolute ones. attributes. Note these are only possible candidates, not absolute ones.
GCC will guess that function pointers with @code{format} attributes that GCC will guess that function pointers with @code{format} attributes that
...@@ -3706,7 +3790,7 @@ Usually they indicate a typo in the user's code, as they have ...@@ -3706,7 +3790,7 @@ Usually they indicate a typo in the user's code, as they have
implementation-defined values, and should not be used in portable code. implementation-defined values, and should not be used in portable code.
@item -Wnormalized=<none|id|nfc|nfkc> @item -Wnormalized=<none|id|nfc|nfkc>
@opindex Wnormalized @opindex Wnormalized=
@cindex NFC @cindex NFC
@cindex NFKC @cindex NFKC
@cindex character set, input normalization @cindex character set, input normalization
...@@ -3752,6 +3836,7 @@ unable to be fixed to display these characters distinctly. ...@@ -3752,6 +3836,7 @@ unable to be fixed to display these characters distinctly.
@item -Wno-deprecated-declarations @item -Wno-deprecated-declarations
@opindex Wno-deprecated-declarations @opindex Wno-deprecated-declarations
@opindex Wdeprecated-declarations
Do not warn about uses of functions (@pxref{Function Attributes}), Do not warn about uses of functions (@pxref{Function Attributes}),
variables (@pxref{Variable Attributes}), and types (@pxref{Type variables (@pxref{Variable Attributes}), and types (@pxref{Type
Attributes}) marked as deprecated by using the @code{deprecated} Attributes}) marked as deprecated by using the @code{deprecated}
...@@ -3759,12 +3844,15 @@ attribute. ...@@ -3759,12 +3844,15 @@ attribute.
@item -Wno-overflow @item -Wno-overflow
@opindex Wno-overflow @opindex Wno-overflow
@opindex Woverflow
Do not warn about compile-time overflow in constant expressions. Do not warn about compile-time overflow in constant expressions.
@item -Woverride-init @item -Woverride-init
@opindex Woverride-init @opindex Woverride-init
@opindex Wno-override-init
@opindex W @opindex W
@opindex Wextra @opindex Wextra
@opindex Wno-extra
Warn if an initialized field without side effects is overridden when Warn if an initialized field without side effects is overridden when
using designated initializers (@pxref{Designated Inits, , Designated using designated initializers (@pxref{Designated Inits, , Designated
Initializers}). Initializers}).
...@@ -3775,6 +3863,7 @@ This warning is included in @option{-Wextra}. To get other ...@@ -3775,6 +3863,7 @@ This warning is included in @option{-Wextra}. To get other
@item -Wpacked @item -Wpacked
@opindex Wpacked @opindex Wpacked
@opindex Wno-packed
Warn if a structure is given the packed attribute, but the packed Warn if a structure is given the packed attribute, but the packed
attribute has no effect on the layout or size of the structure. attribute has no effect on the layout or size of the structure.
Such structures may be mis-aligned for little benefit. For Such structures may be mis-aligned for little benefit. For
...@@ -3797,6 +3886,7 @@ struct bar @{ ...@@ -3797,6 +3886,7 @@ struct bar @{
@item -Wpadded @item -Wpadded
@opindex Wpadded @opindex Wpadded
@opindex Wno-padded
Warn if padding is included in a structure, either to align an element 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 of the structure or to align the whole structure. Sometimes when this
happens it is possible to rearrange the fields of the structure to happens it is possible to rearrange the fields of the structure to
...@@ -3804,15 +3894,18 @@ reduce the padding and so make the structure smaller. ...@@ -3804,15 +3894,18 @@ reduce the padding and so make the structure smaller.
@item -Wredundant-decls @item -Wredundant-decls
@opindex Wredundant-decls @opindex Wredundant-decls
@opindex Wno-redundant-decls
Warn if anything is declared more than once in the same scope, even in Warn if anything is declared more than once in the same scope, even in
cases where multiple declaration is valid and changes nothing. cases where multiple declaration is valid and changes nothing.
@item -Wnested-externs @r{(C only)} @item -Wnested-externs @r{(C only)}
@opindex Wnested-externs @opindex Wnested-externs
@opindex Wno-nested-externs
Warn if an @code{extern} declaration is encountered within a function. Warn if an @code{extern} declaration is encountered within a function.
@item -Wunreachable-code @item -Wunreachable-code
@opindex Wunreachable-code @opindex Wunreachable-code
@opindex Wno-unreachable-code
Warn if the compiler detects that code will never be executed. Warn if the compiler detects that code will never be executed.
This option is intended to warn when the compiler detects that at This option is intended to warn when the compiler detects that at
...@@ -3835,6 +3928,7 @@ code is to provide behavior which is selectable at compile-time. ...@@ -3835,6 +3928,7 @@ code is to provide behavior which is selectable at compile-time.
@item -Winline @item -Winline
@opindex Winline @opindex Winline
@opindex Wno-inline
Warn if a function can not be inlined and it was declared as inline. 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 Even with this option, the compiler will not warn about failures to
inline functions declared in system headers. inline functions declared in system headers.
...@@ -3848,6 +3942,7 @@ warnings produced by @option{-Winline} to appear or disappear. ...@@ -3848,6 +3942,7 @@ warnings produced by @option{-Winline} to appear or disappear.
@item -Wno-invalid-offsetof @r{(C++ only)} @item -Wno-invalid-offsetof @r{(C++ only)}
@opindex Wno-invalid-offsetof @opindex Wno-invalid-offsetof
@opindex Winvalid-offsetof
Suppress warnings from applying the @samp{offsetof} macro to a non-POD Suppress warnings from applying the @samp{offsetof} macro to a non-POD
type. According to the 1998 ISO C++ standard, applying @samp{offsetof} type. According to the 1998 ISO C++ standard, applying @samp{offsetof}
to a non-POD type is undefined. In existing C++ implementations, to a non-POD type is undefined. In existing C++ implementations,
...@@ -3863,16 +3958,19 @@ of the C++ standard. ...@@ -3863,16 +3958,19 @@ of the C++ standard.
@item -Wno-int-to-pointer-cast @r{(C only)} @item -Wno-int-to-pointer-cast @r{(C only)}
@opindex Wno-int-to-pointer-cast @opindex Wno-int-to-pointer-cast
@opindex Wint-to-pointer-cast
Suppress warnings from casts to pointer type of an integer of a Suppress warnings from casts to pointer type of an integer of a
different size. different size.
@item -Wno-pointer-to-int-cast @r{(C only)} @item -Wno-pointer-to-int-cast @r{(C only)}
@opindex Wno-pointer-to-int-cast @opindex Wno-pointer-to-int-cast
@opindex Wpointer-to-int-cast
Suppress warnings from casts from a pointer to an integer type of a Suppress warnings from casts from a pointer to an integer type of a
different size. different size.
@item -Winvalid-pch @item -Winvalid-pch
@opindex Winvalid-pch @opindex Winvalid-pch
@opindex Wno-invalid-pch
Warn if a precompiled header (@pxref{Precompiled Headers}) is found in Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
the search path but can't be used. the search path but can't be used.
...@@ -3907,6 +4005,7 @@ and/or writes to register variables. ...@@ -3907,6 +4005,7 @@ and/or writes to register variables.
@item -Wdisabled-optimization @item -Wdisabled-optimization
@opindex Wdisabled-optimization @opindex Wdisabled-optimization
@opindex Wno-disabled-optimization
Warn if a requested optimization pass is disabled. This warning does Warn if a requested optimization pass is disabled. This warning does
not generally indicate that there is anything wrong with your code; it not generally indicate that there is anything wrong with your code; it
merely indicates that GCC's optimizers were unable to handle the code merely indicates that GCC's optimizers were unable to handle the code
...@@ -3924,11 +4023,13 @@ This option is only supported for C and Objective-C@. It is implied by ...@@ -3924,11 +4023,13 @@ This option is only supported for C and Objective-C@. It is implied by
@item -Wstack-protector @item -Wstack-protector
@opindex Wstack-protector @opindex Wstack-protector
@opindex Wno-stack-protector
This option is only active when @option{-fstack-protector} is active. It This option is only active when @option{-fstack-protector} is active. It
warns about functions that will not be protected against stack smashing. warns about functions that will not be protected against stack smashing.
@item -Woverlength-strings @item -Woverlength-strings
@opindex Woverlength-strings @opindex Woverlength-strings
@opindex Wno-overlength-strings
Warn about string constants which are longer than the ``minimum Warn about string constants which are longer than the ``minimum
maximum'' length specified in the C standard. Modern compilers maximum'' length specified in the C standard. Modern compilers
generally allow string constants which are much longer than the generally allow string constants which are much longer than the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment