function_hooks/unwind: introduce return_implies_exact()
[smatch.git] / validation / function-attribute-pointer.c
blobfd08ac7106d5f59a2d08f940efb950e5a6a03f11
1 #define __noreturn __attribute__((__noreturn__))
3 void set_die(void (*)(void));
4 void set_die_nr(__noreturn void (*)(void));
6 void die(void);
7 void __noreturn die_nr(void);
9 static void foo(void)
11 set_die(die);
12 set_die(die_nr);
13 set_die_nr(die_nr);
14 set_die_nr(die);
16 void (*fptr0)(void) = die;
17 void (*fptr1)(void) = die_nr;
18 __noreturn void (*fptr3)(void) = die_nr;
19 __noreturn void (*fptr2)(void) = die;
23 * check-name: function-attribute-pointer
25 * check-error-start
26 function-attribute-pointer.c:14:20: warning: incorrect type in argument 1 (different modifiers)
27 function-attribute-pointer.c:14:20: expected void ( [noreturn] * )( ... )
28 function-attribute-pointer.c:14:20: got void ( * )( ... )
29 function-attribute-pointer.c:19:42: warning: incorrect type in initializer (different modifiers)
30 function-attribute-pointer.c:19:42: expected void ( [noreturn] *fptr2 )( ... )
31 function-attribute-pointer.c:19:42: got void ( * )( ... )
32 * check-error-end