X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=typesafe_cb%2Ftest%2Fcompile_fail-cast_if_type.c;fp=typesafe_cb%2Ftest%2Fcompile_fail-cast_if_type.c;h=0000000000000000000000000000000000000000;hb=650c775ff00cccd03fc84e7789a03c51d9839004;hp=1e417cbac6bb869b43693087fe827380389d1cf8;hpb=c8acddea39d222312102952e91c32cfe4dd2cea0;p=ccan diff --git a/typesafe_cb/test/compile_fail-cast_if_type.c b/typesafe_cb/test/compile_fail-cast_if_type.c deleted file mode 100644 index 1e417cba..00000000 --- a/typesafe_cb/test/compile_fail-cast_if_type.c +++ /dev/null @@ -1,25 +0,0 @@ -#include "typesafe_cb/typesafe_cb.h" - -void _set_some_value(void *val); - -void _set_some_value(void *val) -{ -} - -#define set_some_value(expr) \ - _set_some_value(cast_if_type((expr), unsigned long, void *)) - -int main(int argc, char *argv[]) -{ -#ifdef FAIL - int x = 0; - set_some_value(x); -#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 - void *p = 0; - set_some_value(p); -#endif - return 0; -}