X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=typesafe_cb%2Ftest%2Fcompile_fail-typesafe_cb-int.c;fp=typesafe_cb%2Ftest%2Fcompile_fail-typesafe_cb-int.c;h=0000000000000000000000000000000000000000;hb=650c775ff00cccd03fc84e7789a03c51d9839004;hp=54d0e7bac3a36094303555d699775590d39e6eb7;hpb=c8acddea39d222312102952e91c32cfe4dd2cea0;p=ccan diff --git a/typesafe_cb/test/compile_fail-typesafe_cb-int.c b/typesafe_cb/test/compile_fail-typesafe_cb-int.c deleted file mode 100644 index 54d0e7ba..00000000 --- a/typesafe_cb/test/compile_fail-typesafe_cb-int.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "typesafe_cb/typesafe_cb.h" -#include - -void _callback(void (*fn)(void *arg), void *arg); -void _callback(void (*fn)(void *arg), void *arg) -{ - fn(arg); -} - -/* Callback is set up to warn if arg isn't a pointer (since it won't - * pass cleanly to _callback's second arg. */ -#define callback(fn, arg) \ - _callback(typesafe_cb(void, (fn), (arg)), (arg)) - -void my_callback(int something); -void my_callback(int something) -{ -} - -int main(int argc, char *argv[]) -{ -#ifdef FAIL - /* This fails due to arg, not due to cast. */ - callback(my_callback, 100); -#endif - return 0; -}