slice: remove unneeded nr_nrbits from EXPR_SLICE
[smatch.git] / validation / cast-bad-00.c
blob6d15485d40bedf25fb67cedc88a82e2494709680
1 typedef unsigned short u16;
2 typedef unsigned int u32;
4 union u {
5 u32 a;
6 u16 b;
7 };
9 struct s {
10 u32 a;
11 u16 b;
15 void bar(u16, u32);
16 void union_to_int(u16 val);
17 void struct_to_int(u16 val);
20 void union_to_int(u16 val)
22 union u u;
24 u.b = val;
25 bar(u.b, u);
28 void struct_to_int(u16 val)
30 struct s s;
32 s.b = val;
33 bar(s.b, s);
37 * check-name: cast-bad 00
39 * check-error-start
40 cast-bad-00.c:25:18: warning: incorrect type in argument 2 (different base types)
41 cast-bad-00.c:25:18: expected unsigned int [usertype]
42 cast-bad-00.c:25:18: got union u [assigned] u
43 cast-bad-00.c:33:18: warning: incorrect type in argument 2 (different base types)
44 cast-bad-00.c:33:18: expected unsigned int [usertype]
45 cast-bad-00.c:33:18: got struct s [assigned] s
46 * check-error-end