X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=typesafe_cb%2Ftest%2Fcompile_fail-typesafe_cb.c;fp=typesafe_cb%2Ftest%2Fcompile_fail-typesafe_cb.c;h=d305d5fb1101fc1c3a242346f97a5218fd166744;hb=bd9f392599277acd2404688d034aa98b652ee1b7;hp=340500891fc8c62de1dac3a0928ee8d6e52c1282;hpb=246bde098d4f5ac212840a41b740297dd94e1135;p=ccan diff --git a/typesafe_cb/test/compile_fail-typesafe_cb.c b/typesafe_cb/test/compile_fail-typesafe_cb.c index 34050089..d305d5fb 100644 --- a/typesafe_cb/test/compile_fail-typesafe_cb.c +++ b/typesafe_cb/test/compile_fail-typesafe_cb.c @@ -16,10 +16,18 @@ 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; + + /* This should work always. */ + register_callback(my_callback, "hello world"); + + /* This will fail with FAIL defined */ register_callback(my_callback, p); return 0; }