X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=typesafe_cb%2Ftest%2Fcompile_fail-cast_if_type-callback-int.c;fp=typesafe_cb%2Ftest%2Fcompile_fail-cast_if_type-callback-int.c;h=0000000000000000000000000000000000000000;hb=bd9f392599277acd2404688d034aa98b652ee1b7;hp=85006c9b363840a31e439dc079111bc466d3ad3a;hpb=246bde098d4f5ac212840a41b740297dd94e1135;p=ccan diff --git a/typesafe_cb/test/compile_fail-cast_if_type-callback-int.c b/typesafe_cb/test/compile_fail-cast_if_type-callback-int.c deleted file mode 100644 index 85006c9b..00000000 --- a/typesafe_cb/test/compile_fail-cast_if_type-callback-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(cast_if_type((fn), void (*)(typeof(arg)), void (*)(void *)), \ - arg) - -void my_callback(int something); -void my_callback(int something) -{ -} - -int main(int argc, char *argv[]) -{ -#ifdef FAIL - callback(my_callback, 100); -#endif - return 0; -}