From: Dan Carpenter Date: Thu, 19 Dec 2013 15:20:45 +0000 (+0300) Subject: unreachable code: don't warn about empty statements X-Git-Tag: 1.60~457 X-Git-Url: https://repo.or.cz/w/smatch.git/commitdiff_plain/ef15ecba0ed25ef32cdd31fe07ff564faba14a6f unreachable code: don't warn about empty statements This is when people add extra semi-colons like: return 0;; Or: switch (foo) { ... }; These warnings were only enabled with --spammy but it's better to use coccinelle for these. Signed-off-by: Dan Carpenter --- diff --git a/smatch_flow.c b/smatch_flow.c index 89fc4b81..3532bfc4 100644 --- a/smatch_flow.c +++ b/smatch_flow.c @@ -522,7 +522,7 @@ static void print_unreached(struct statement *stmt) default: break; } - if (!option_spammy && empty_statement(stmt)) + if (empty_statement(stmt)) return; sm_msg("info: ignoring unreachable code."); print = 0;