diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-02 17:33:25 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-02 17:33:25 +0000 |
commit | 02619052e76db7ede9d3151c6e3cbf47d6e389e3 (patch) | |
tree | 2b0687af1952de91d3b3f408b09402cfbbfa1bba /gcc/c-decl.c | |
parent | c56b193617523d8338e4f3647a9cc28b60375be7 (diff) | |
download | gcc-02619052e76db7ede9d3151c6e3cbf47d6e389e3.tar.gz |
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
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120347 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index a9506e122b3..f669a4729da 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -7613,8 +7613,9 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec) gcc_assert (TREE_CODE (scspec) == IDENTIFIER_NODE && C_IS_RESERVED_WORD (scspec)); i = C_RID_CODE (scspec); - if (extra_warnings && specs->non_sc_seen_p) - warning (OPT_Wextra, "%qE is not at beginning of declaration", scspec); + if (specs->non_sc_seen_p) + warning (OPT_Wold_style_declaration, + "%qE is not at beginning of declaration", scspec); switch (i) { case RID_INLINE: |