1 typedef unsigned int u32
;
2 typedef u32
__attribute__((bitwise
)) __be32
;
4 /* Implicit casts of 0, legal */
5 static __be32
foo(void)
12 /* Explicit cast of 0, legal */
13 static __be32
bar(void)
18 /* Implicit casts of nonzero, bad */
19 static __be32
baz(void)
26 /* Explicit cast of nonzero, bad */
27 static __be32
quux(void)
33 * check-name: conversions to bitwise types
34 * check-command: sparse -Wbitwise $file
36 bitwise-cast.c:21:20: warning: incorrect type in initializer (different base types)
37 bitwise-cast.c:21:20: expected restricted __be32 [usertype] x
38 bitwise-cast.c:21:20: got int
39 bitwise-cast.c:23:16: warning: incorrect type in return expression (different base types)
40 bitwise-cast.c:23:16: expected restricted __be32
41 bitwise-cast.c:23:16: got int
42 bitwise-cast.c:29:17: warning: cast to restricted __be32