summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-30 09:52:41 +0000
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-30 09:52:41 +0000
commitc2c7830b1a4c7935be65bd615d92711d751aa4b2 (patch)
tree550e5d90532796178dbba4eb2e6ff1c54828d12c /gcc/c-common.c
parent7e3b149dab60d97e666978f145dd82e6feec0bdf (diff)
downloadgcc-c2c7830b1a4c7935be65bd615d92711d751aa4b2.tar.gz
2008-09-30 Paolo Bonzini <bonzini@gnu.org>
* c-common.c (empty_if_body_warning): Remove. * c-common.h (empty_if_body_warning): Remove. * c-parser.c (c_parser_if_body, c_parser_else_body): Implement here the -Wempty-body warning for `if' and `else' statements. * c-typeck.c (c_finish_if_stmt): Do not call empty_body_warning. cp: 2008-09-30 Paolo Bonzini <bonzini@gnu.org> * parser.c (cp_parser_selection_statement): Implement here the -Wempty-body warning for `if' and `else' statements. * semantics.c (finish_if_stmt): Do not call empty_body_warning. testsuite: 2008-09-30 Paolo Bonzini <bonzini@gnu.org> * g++.dg/warn/if-empty-1.C: Copy from gcc.dg/if-empty-1.c. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140780 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 5d692112bd7..7665b6234fa 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1291,31 +1291,6 @@ strict_aliasing_warning (tree otype, tree type, tree expr)
return false;
}
-/* Print a warning about if (); or if () .. else; constructs
- via the special empty statement node that we create. INNER_THEN
- and INNER_ELSE are the statement lists of the if and the else
- block. */
-
-void
-empty_if_body_warning (tree inner_then, tree inner_else)
-{
- if (TREE_CODE (inner_then) == STATEMENT_LIST
- && STATEMENT_LIST_TAIL (inner_then))
- inner_then = STATEMENT_LIST_TAIL (inner_then)->stmt;
-
- if (inner_else && TREE_CODE (inner_else) == STATEMENT_LIST
- && STATEMENT_LIST_TAIL (inner_else))
- inner_else = STATEMENT_LIST_TAIL (inner_else)->stmt;
-
- if (IS_EMPTY_STMT (inner_then) && !inner_else)
- warning (OPT_Wempty_body, "%Hsuggest braces around empty body "
- "in an %<if%> statement", EXPR_LOCUS (inner_then));
-
- else if (inner_else && IS_EMPTY_STMT (inner_else))
- warning (OPT_Wempty_body, "%Hsuggest braces around empty body "
- "in an %<else%> statement", EXPR_LOCUS (inner_else));
-}
-
/* Warn for unlikely, improbable, or stupid DECL declarations
of `main'. */