implied: fix a bug handling parameter implications
[smatch.git] / validation / sm_precedence.c
blob42b965eaff55ff966e36c90c83b26375a47ce3a7
1 struct foo {
2 unsigned int x:1;
3 };
5 int frob();
6 int a,b,c,d, x, y;
7 struct foo *z;
8 static int options_write(void)
10 if (x & y == 0)
11 frob();
12 if (x | y == 0)
13 frob();
14 if (a == b & c == d)
15 frob();
16 if (a == c == d)
17 frob();
18 if (!a == b)
19 frob();
20 c = !a & b;
21 if (x + y == 0)
22 frob();
23 if (!a == !b)
24 frob();
25 if (!a == z->x)
26 frob();
27 if (!!a == b)
28 frob();
32 * check-name: Smatch precedence check
33 * check-command: smatch sm_precedence.c
35 * check-output-start
36 sm_precedence.c:10 options_write() warn: add some parenthesis here?
37 sm_precedence.c:12 options_write() warn: add some parenthesis here?
38 sm_precedence.c:14 options_write() warn: add some parenthesis here?
39 sm_precedence.c:16 options_write() warn: add some parenthesis here?
40 sm_precedence.c:18 options_write() warn: add some parenthesis here?
41 sm_precedence.c:20 options_write() warn: add some parenthesis here?
42 * check-output-end