sval: extra: cast the parameter information to the right type
[smatch.git] / validation / sm_casts2.c
blob03320734811229bb81469bbee5579dbcc3cd38df
1 #include <stdio.h>
3 unsigned int frob();
5 unsigned char *a;
6 unsigned int *b;
7 int *c;
8 char *****d;
9 int main(void)
12 if (*a == (unsigned int)-1)
13 frob();
14 if (*b == (unsigned int)-1)
15 frob();
16 if (*c == (unsigned int)-1)
17 frob();
18 if (*d == (unsigned int)-1)
19 frob();
20 if (*d == -1)
21 frob();
22 if (*****d == (unsigned int)-1)
23 frob();
24 return 0;
27 * check-name: smatch casts pointers
28 * check-command: smatch sm_casts2.c
30 * check-output-start
31 sm_casts2.c:12 main() error: *a is never equal to max (wrong type 0 - 255).
32 sm_casts2.c:22 main() error: *****d is never equal to max (wrong type (-128) - 127).
33 * check-output-end