From: Christoph Mallon Date: Wed, 3 Sep 2008 20:16:08 +0000 (+0000) Subject: Warn about unreachable empty compound statements. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=4d951195589b5fbe66e5712b76b5ec5724404633;p=cparser Warn about unreachable empty compound statements. [r21681] --- diff --git a/parser.c b/parser.c index 799fa7b..6ccb424 100644 --- 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"); }