db: don't turn RaiseError on
[smatch.git] / check_assign_vs_compare.c
bloba6b2ccaafbdef1d6c43d3e4f938f9813f2f119ac
1 /*
2 * smatch/check_assign_vs_compare.c
4 * Copyright (C) 2012 Oracle.
6 * Licensed under the Open Software License version 1.1
8 */
10 #include "smatch.h"
12 static int my_id;
14 static void match_condition(struct expression *expr)
16 long long val;
18 if (expr->type != EXPR_ASSIGNMENT || expr->op != '=')
19 return;
21 if (!get_value(expr->right, &val))
22 return;
23 sm_msg("warn: was '== %lld' instead of '='", val);
26 void check_assign_vs_compare(int id)
28 my_id = id;
29 add_hook(&match_condition, CONDITION_HOOK);