xref: /illumos-gate/usr/src/tools/smatch/src/validation/function-pointer-type.c (revision 8222814ef8560ee0ba222eca8ca5acffc6cd0e44)
1 extern int fun(void);
2 
3 void fa(void) { int (*f)(void); f = &fun; }
4 void f0(void) { int (*f)(void); f = fun; }	// C99,C11 6.3.2.1p4
5 void f1(void) { int (*f)(void); f = *fun; }	// C99,C11 6.5.3.2p4
6 void f2(void) { int (*f)(void); f = **fun; }	// C99,C11 6.5.3.2p4
7 void f3(void) { int (*f)(void); f = ***fun; }	// C99,C11 6.5.3.2p4
8 
9 /*
10  * check-name: type of function pointers
11  * check-command: sparse -Wno-decl $file
12  */
13