unreachable code: don't warn about empty statements
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 19 Dec 2013 15:20:45 +0000 (19 18:20 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 19 Dec 2013 15:20:45 +0000 (19 18:20 +0300)
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 <dan.carpenter@oracle.com>
smatch_flow.c

index 89fc4b8..3532bfc 100644 (file)
@@ -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;