aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2006-12-16 16:48:01 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2006-12-16 16:48:01 +0000
commitb3b433c507af133b95bfdbbd33338139e3d15345 (patch)
treed673fa90f961dc743634330e431fadf58ca98b8b /gcc/c-common.c
parentd6b418fa0b3d5dc88ffb3f1673f82e6dbf5da6d1 (diff)
downloadgcc-b3b433c507af133b95bfdbbd33338139e3d15345.zip
gcc-b3b433c507af133b95bfdbbd33338139e3d15345.tar.gz
gcc-b3b433c507af133b95bfdbbd33338139e3d15345.tar.bz2
re PR middle-end/7651 (Define -Wextra strictly in terms of other warning flags)
2006-12-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR middle-end/7651 * c.opt (Wempty-body): New. * doc/invoke.texi (Wempty-body): Document it. (Wextra): Enabled by -Wextra. * c-opts.c (c_common_post_options): Enabled by -Wextra. * c-common.c (empty_body_warning): Replace Wextra with Wempty-body. * c-parser.c (c_parser_c99_block_statement): Likewise. testsuite/ * gcc.dg/20001116-1.c: Replace -Wextra with -Wempty-body. * gcc.dg/if-empty-1.c: Likewise. * gcc.dg/pr23165.c: Likewise. * g++.dg/warn/empty-body.C: Likewise. From-SVN: r119963
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 4771a53..3219cf3 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1000,7 +1000,7 @@ strict_aliasing_warning (tree otype, tree type, tree expr)
void
empty_body_warning (tree inner_then, tree inner_else)
{
- if (extra_warnings)
+ if (warn_empty_body)
{
if (TREE_CODE (inner_then) == STATEMENT_LIST
&& STATEMENT_LIST_TAIL (inner_then))
@@ -1011,11 +1011,11 @@ empty_body_warning (tree inner_then, tree inner_else)
inner_else = STATEMENT_LIST_TAIL (inner_else)->stmt;
if (IS_EMPTY_STMT (inner_then) && !inner_else)
- warning (OPT_Wextra, "%Hempty body in an if-statement",
+ warning (OPT_Wempty_body, "%Hempty body in an if-statement",
EXPR_LOCUS (inner_then));
if (inner_else && IS_EMPTY_STMT (inner_else))
- warning (OPT_Wextra, "%Hempty body in an else-statement",
+ warning (OPT_Wempty_body, "%Hempty body in an else-statement",
EXPR_LOCUS (inner_else));
}
}