From 6eae5f4303e1db86b9ac23de3d602717060aeece Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 16 Jul 2015 14:06:24 +0300 Subject: [PATCH] pointer_math: silence false a ton of false positives This should only be looking at "foo += sizeof()" type assignments. I'm not sure how I managed to commit this. I guess I started writing it and got distracted. Sorry. Signed-off-by: Dan Carpenter --- check_pointer_math.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/check_pointer_math.c b/check_pointer_math.c index b3df968a..80224f30 100644 --- a/check_pointer_math.c +++ b/check_pointer_math.c @@ -98,6 +98,9 @@ static void check_assign(struct expression *expr) struct symbol *type; char *name; + if (expr->op != SPECIAL_ADD_ASSIGN && expr->op != SPECIAL_SUB_ASSIGN) + return; + type = get_pointer_type(expr->left); if (!type) return; -- 2.11.4.GIT