check_signed: check int types as well
[smatch.git] / validation / sm_select.c
blob1e11662760924ac7e205312ee1e932f5f4749e26
1 struct foo {
2 int a;
3 };
5 struct foo *a;
6 struct foo *b;
8 struct foo *c;
9 struct foo *d;
10 struct foo *e;
11 void func (void)
13 if (a?b:0) {
14 a->a = 1;
15 b->a = 1;
17 a->a = 1;
18 b->a = 1;
19 d = returns_nonnull();
20 if (c?d:e) {
21 c->a = 1;
22 d->a = 1;
23 e->a = 1;
28 * check-name: Ternary Conditions
29 * check-command: smatch --spammy sm_select.c
31 * check-output-start
32 sm_select.c +17 func(6) error: dereferencing undefined: 'a'
33 sm_select.c +18 func(7) error: dereferencing undefined: 'b'
34 sm_select.c +21 func(10) error: dereferencing undefined: 'c'
35 sm_select.c +23 func(12) error: dereferencing undefined: 'e'
36 * check-output-end