1 #include <ccan/typesafe_cb/typesafe_cb.h>
4 void _callback(void (*fn)(void *arg), void *arg);
5 void _callback(void (*fn)(void *arg), void *arg)
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))
15 void my_callback(int something);
16 void my_callback(int something)
20 int main(int argc, char *argv[])
23 /* This fails due to arg, not due to cast. */
24 callback(my_callback, 100);