From e39ef3260db4dcb75b5d57c97186ff1e8c01269d Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sat, 9 Feb 2013 01:43:05 +0300 Subject: [PATCH] silence bogus "unreachable code" warnings No return functions were triggering "unreachable code" warnings even though there was no code after the function call. I wasn't seeing these because I use always the --spammy option and the unreachable code warning for --spammy is in a different spot. Reported-by: Bart Van Assche Signed-off-by: Dan Carpenter --- smatch_function_hooks.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/smatch_function_hooks.c b/smatch_function_hooks.c index 2e4b43d4..2b59a07d 100644 --- a/smatch_function_hooks.c +++ b/smatch_function_hooks.c @@ -625,6 +625,8 @@ static void db_return_states(struct expression *expr) if (expr->fn->type != EXPR_SYMBOL || !expr->fn->symbol) return; + if (!__get_cur_slist()) /* no return functions */ + return; sym = expr->fn->symbol; if (!sym) -- 2.11.4.GIT