hooks: add a warning to detect unimplemented hooks
[smatch.git] / validation / Waddress-array.c
blob8317845481f9a512afc8aae0e580376eacfeedf2
1 int foo(void) {
2 extern int a[];
4 if (a)
5 return 1;
6 return 0;
9 int bar(void) {
10 int a[2];
12 if (a)
13 return 1;
14 return 0;
18 * check-name: Waddress-array
19 * check-command: sparse -Wno-decl -Waddress $file
21 * check-error-start
22 Waddress-array.c:4:13: warning: the address of an array will always evaluate as true
23 Waddress-array.c:12:13: warning: the address of an array will always evaluate as true
24 * check-error-end