X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=typesafe_cb%2Ftest%2Fcompile_fail-typesafe_cb_preargs.c;fp=typesafe_cb%2Ftest%2Fcompile_fail-typesafe_cb_preargs.c;h=0000000000000000000000000000000000000000;hb=650c775ff00cccd03fc84e7789a03c51d9839004;hp=38daec51063fb718964d59abb08dd658c76b1139;hpb=c8acddea39d222312102952e91c32cfe4dd2cea0;p=ccan diff --git a/typesafe_cb/test/compile_fail-typesafe_cb_preargs.c b/typesafe_cb/test/compile_fail-typesafe_cb_preargs.c deleted file mode 100644 index 38daec51..00000000 --- a/typesafe_cb/test/compile_fail-typesafe_cb_preargs.c +++ /dev/null @@ -1,28 +0,0 @@ -#include "typesafe_cb/typesafe_cb.h" -#include - -static void _register_callback(void (*cb)(int x, void *arg), void *arg) -{ -} - -#define register_callback(cb, arg) \ - _register_callback(typesafe_cb_preargs(void, (cb), (arg), int), (arg)) - -static void my_callback(int x, char *p) -{ -} - -int main(int argc, char *argv[]) -{ -#ifdef FAIL - int *p; -#if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P -#error "Unfortunately we don't fail if cast_if_type is a noop." -#endif -#else - char *p; -#endif - p = NULL; - register_callback(my_callback, p); - return 0; -}