From 843a152dc1193455bcc052c4b6c3939439db1cb2 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 18 Dec 2009 22:41:10 +0200 Subject: [PATCH] check_unused_ret.c: fix check for local variables This check is supposed to only care about assignments to local variables, but the test was broken because it was using the wrong symbol pointer. Signed-off-by: Dan Carpenter --- check_unused_ret.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/check_unused_ret.c b/check_unused_ret.c index 2277a94e..2f277c2a 100644 --- a/check_unused_ret.c +++ b/check_unused_ret.c @@ -67,7 +67,6 @@ static void match_assign_call(struct expression *expr) { struct expression *left; struct assignment *assign; - struct symbol *base; if (final_pass) return; @@ -80,8 +79,7 @@ static void match_assign_call(struct expression *expr) left = strip_expr(expr->left); if (!left || left->type != EXPR_SYMBOL) return; - base = get_base_type(left->symbol); - if (!base->ctype.modifiers & MOD_AUTO) + if (left->symbol->ctype.modifiers & (MOD_TOPLEVEL | MOD_EXTERN | MOD_STATIC)) return; skip_this = left; -- 2.11.4.GIT