Remove some false positives and enable the check.
[smatch.git] / validation / cond_expr2.c
blob174f2d17ed15f01dbef2ac172d22dbc9d274142a
1 extern const int *p;
2 extern volatile void *q;
3 extern volatile int *r;
4 static void f(void)
6 q = 1 ? p : q; // warn: const volatile void * -> const int *
7 r = 1 ? r : q; // OK: volatile void * -> volatile int *
8 r = 1 ? r : p; // warn: const volatile int * -> volatile int *
11 * check-name: type of conditional expression
12 * check-description: Used to miss qualifier mixing and mishandle void *
14 * check-error-start
15 cond_expr2.c:6:4: warning: incorrect type in assignment (different modifiers)
16 cond_expr2.c:6:4: expected void volatile *extern [addressable] [toplevel] q
17 cond_expr2.c:6:4: got void const volatile *
18 cond_expr2.c:8:4: warning: incorrect type in assignment (different modifiers)
19 cond_expr2.c:8:4: expected int volatile *extern [addressable] [toplevel] [assigned] r
20 cond_expr2.c:8:4: got int const volatile *
21 * check-error-end