projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d328241
)
Warn about unreachable empty compound statements.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Wed, 3 Sep 2008 20:16:08 +0000
(20:16 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Wed, 3 Sep 2008 20:16:08 +0000
(20:16 +0000)
[r21681]
parser.c
patch
|
blob
|
history
diff --git
a/parser.c
b/parser.c
index
799fa7b
..
6ccb424
100644
(file)
--- a/
parser.c
+++ b/
parser.c
@@
-5065,9
+5065,9
@@
continue_for:;
static void check_unreachable(statement_t const* const stmt)
{
if (!stmt->base.reachable &&
- stmt->kind != STATEMENT_COMPOUND &&
stmt->kind != STATEMENT_DO_WHILE &&
- stmt->kind != STATEMENT_FOR) {
+ stmt->kind != STATEMENT_FOR &&
+ (stmt->kind != STATEMENT_COMPOUND || stmt->compound.statements == NULL)) {
warningf(&stmt->base.source_position, "statement is unreachable");
}