fix implicit zero initializer.
[smatch.git] / validation / bool-cast-implicit.c
blobee8b705b96d1a16030ed236ba0562b3c4ff49934
1 typedef unsigned int u32;
2 typedef int s32;
3 typedef void *vdp;
4 typedef int *sip;
5 typedef double dbl;
6 typedef unsigned short __attribute__((bitwise)) le16;
8 static _Bool fs32(s32 a) { return a; }
9 static _Bool fu32(u32 a) { return a; }
10 static _Bool fvdp(vdp a) { return a; }
11 static _Bool fsip(sip a) { return a; }
12 static _Bool fdbl(dbl a) { return a; }
13 static _Bool ffun(void) { return ffun; }
15 static _Bool fres(le16 a) { return a; }
18 * check-name: bool-cast-implicit
19 * check-command: test-linearize -m64 $file
20 * check-output-ignore
21 * check-output-excludes: cast\\.
23 * check-error-start
24 bool-cast-implicit.c:15:36: warning: incorrect type in return expression (different base types)
25 bool-cast-implicit.c:15:36: expected bool
26 bool-cast-implicit.c:15:36: got restricted le16 [usertype] a
27 * check-error-end