*new* check_macros: find macro precedence bugs
[smatch.git] / validation / sm_casts2.c
blob44793af4e54efa36cc6d1df6290eeab5c034ef02
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(3) error: *a is never equal to 4294967295 (wrong type 0 - 255).
32 sm_casts2.c +22 main(13) error: *****d is never equal to 4294967295 (wrong type -128 - 127).
33 * check-output-end