hooks: add a warning to detect unimplemented hooks
[smatch.git] / validation / enum-typecheck.c
blob77b77b47b241342a8bc07edda5bb170ec6468d5f
1 enum good { G, };
2 enum bad { B, };
3 enum good g;
5 enum good compat_int(void) { return 1; }
7 void parg(enum good);
8 void parg(enum bad);
10 void farg(enum good a);
11 void farg(enum bad a) { }
13 enum good pret(void);
14 enum bad pret(void);
16 enum good fret(void);
17 enum bad fret(void) { return 0; }
20 enum good *ptr;
21 enum bad *ptr;
23 enum good *gptr = &g;
24 enum bad *bptr = &g;
27 * check-name: enum-typecheck
28 * check-command: sparse -Wno-decl $file
29 * check-known-to-fail
31 * check-error-start
32 enum-typecheck.c:8:6: error: symbol 'parg' redeclared with different type
33 enum-typecheck.c:11:6: error: symbol 'farg' redeclared with different type
34 enum-typecheck.c:14:11: error: symbol 'pret' redeclared with different type
35 enum-typecheck.c:17:11: error: symbol 'fret' redeclared with different type
36 enum-typecheck.c:21:12: error: symbol 'ptr' redeclared with different type
37 enum-typecheck.c:24:20: warning: incorrect type in initializer (different type sizes)
38 * check-error-end