]> git.ozlabs.org Git - ccan/blob - ccan/typesafe_cb/test/compile_fail-typesafe_cb-int.c
Remove unused main() args in many modules.
[ccan] / ccan / typesafe_cb / test / compile_fail-typesafe_cb-int.c
1 #include <ccan/typesafe_cb/typesafe_cb.h>
2 #include <stdlib.h>
3
4 void _callback(void (*fn)(void *arg), void *arg);
5 void _callback(void (*fn)(void *arg), void *arg)
6 {
7         fn(arg);
8 }
9
10 /* Callback is set up to warn if arg isn't a pointer (since it won't
11  * pass cleanly to _callback's second arg. */
12 #define callback(fn, arg)                                               \
13         _callback(typesafe_cb(void, (fn), (arg)), (arg))
14
15 void my_callback(int something);
16 void my_callback(int something)
17 {
18 }
19
20 int main(void)
21 {
22 #ifdef FAIL
23         /* This fails due to arg, not due to cast. */
24         callback(my_callback, 100);
25 #endif
26         return 0;
27 }