]> git.ozlabs.org Git - ccan/blobdiff - typesafe_cb/test/compile_fail-typesafe_cb.c
Compile even with !HAVE_TYPEOF etc, and remove redundant test case.
[ccan] / typesafe_cb / test / compile_fail-typesafe_cb.c
index 340500891fc8c62de1dac3a0928ee8d6e52c1282..d305d5fb1101fc1c3a242346f97a5218fd166744 100644 (file)
@@ -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;
 }