small clean up.
[smatch.git] / check_bitwise_or.c
blob468c52c042b7546d1d4cea0e7b249f0aa4a9ac22
1 /*
2 * sparse/check_bitwise_or.c
4 * Copyright (C) 2009 Dan Carpenter.
6 * Licensed under the Open Software License version 1.1
8 */
11 * I can't think of a place where it makes sense to use a bitwise
12 * or in a condition. Either people want bitwise and or regular or.
15 #include "smatch.h"
17 static int my_id;
19 static void match_condition(struct expression *expr)
21 expr = strip_expr(expr);
22 if (expr->type != EXPR_BINOP)
23 return;
24 if (expr->op == '|')
25 sm_msg("error: bitwise or used in condition.");
28 void check_bitwise_or(int id)
30 my_id = id;
31 add_hook(&match_condition, CONDITION_HOOK);