From 4dda1a3e0b9c366db502961f75e2e2752f1909a3 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 22 Sep 2011 14:33:14 +0300 Subject: [PATCH] no_effect: add some more tests This test is sort of pointless since it duplicates functionality from gcc. But I already wrote it, so I'm going to commit it. What happened is that someone submitted a patch with a bug like this so I assumed that gcc didn't catch it. But then I didn't find any similar bugs in the kernel, and I investigated some more and it turns that that the submitter just ignored the warning or was using an old version of gcc or something. Signed-off-by: Dan Carpenter --- check_no_effect.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/check_no_effect.c b/check_no_effect.c index 493aa4d3..a1e43301 100644 --- a/check_no_effect.c +++ b/check_no_effect.c @@ -22,6 +22,10 @@ static void match_stmt(struct statement *stmt) return; switch(expr->type) { case EXPR_PREOP: + if (expr->op == '!') + break; + if (expr->op == '~') + break; case EXPR_POSTOP: case EXPR_STATEMENT: case EXPR_ASSIGNMENT: -- 2.11.4.GIT