sval: update check_deref.c
[smatch.git] / check_select.c
blob0e619678851480f93e2d4de1e20979128a41ecd4
1 /*
2 * smatch/check_select.c
4 * Copyright (C) 2010 Dan Carpenter.
6 * Licensed under the Open Software License version 1.1
8 */
10 #include "smatch.h"
11 #include "smatch_slist.h"
13 static int my_id;
15 static void match_select(struct expression *expr)
17 if (expr->cond_true)
18 return;
19 expr = strip_expr(expr->conditional);
20 if (expr->type != EXPR_COMPARE)
21 return;
22 sm_msg("warn: boolean comparison inside select");
25 void check_select(int id)
27 my_id = id;
28 add_hook(&match_select, SELECT_HOOK);