diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2007-01-02 17:33:25 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2007-01-02 17:33:25 +0000 |
commit | b1ed4cb43c9b43a57b28d35c46062607af6e6a64 (patch) | |
tree | 2b0687af1952de91d3b3f408b09402cfbbfa1bba /gcc/doc/invoke.texi | |
parent | d887a68299b172a03c4648b16fdfbef9dcf25ce0 (diff) | |
download | gcc-b1ed4cb43c9b43a57b28d35c46062607af6e6a64.zip gcc-b1ed4cb43c9b43a57b28d35c46062607af6e6a64.tar.gz gcc-b1ed4cb43c9b43a57b28d35c46062607af6e6a64.tar.bz2 |
re PR middle-end/7651 (Define -Wextra strictly in terms of other warning flags)
2007-01-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR middle-end/7651
* c.opt (Wold-style-declaration): New.
* doc/invoke.texi (C-only Warning Options): New.
(Wold-style-declaration): Document it.
(Wextra): Enabled by -Wextra.
* c-opts.c (c_common_post_options): Enabled by -Wextra.
* c-decl.c (declspecs_add_scspec): Replace -Wextra with
-Wold-style-declaration.
testsuite/
* gcc.dg/declspec-3.c: Replace -W with -Wold-style-declaration.
* gcc.dg/declspec-3-Wextra.c: New.
* gcc.dg/declspec-3-no.c: New
From-SVN: r120347
Diffstat (limited to 'gcc/doc/invoke.texi')
-rw-r--r-- | gcc/doc/invoke.texi | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index ff463c7..2101192 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -256,8 +256,8 @@ Objective-C and Objective-C++ Dialects}. @item C-only Warning Options @gccoptlist{-Wbad-function-cast -Wmissing-declarations @gol --Wmissing-parameter-type -Wmissing-prototypes @gol --Wnested-externs -Wold-style-definition @gol +-Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs @gol +-Wold-style-declaration -Wold-style-definition @gol -Wstrict-prototypes -Wtraditional -Wtraditional-conversion @gol -Wdeclaration-after-statement -Wpointer-sign} @@ -2885,9 +2885,11 @@ but @samp{x[(void)i,j]} will not. @item An unsigned value is compared against zero with @samp{<} or @samp{>=}. -@item -Storage-class specifiers like @code{static} are not the first things in -a declaration. According to the C Standard, this usage is obsolescent. +@item @r{(C only)} +Storage-class specifiers like @code{static} are not the first things +in a declaration. According to the C Standard, this usage is +obsolescent. This warning can be independently controlled by +@option{-Wold-style-declaration}. @item If @option{-Wall} or @option{-Wunused} is also specified, warn about unused @@ -3214,6 +3216,13 @@ argument types. (An old-style function definition is permitted without a warning if preceded by a declaration which specifies the argument types.) +@item -Wold-style-declaration @r{(C only)} +@opindex Wold-style-declaration +Warn for obsolescent usages, according to the C Standard, in a +declaration. For example, warn if storage-class specifiers like +@code{static} are not the first things in a declaration. This warning +is also enabled by @option{-Wextra}. + @item -Wold-style-definition @r{(C only)} @opindex Wold-style-definition Warn if an old-style function definition is used. A warning is given |