]> git.ozlabs.org Git - ccan/blobdiff - ccan/cast/test/compile_fail-cast_static.c
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / cast / test / compile_fail-cast_static.c
index 0f9e4780470a267dbf4573b76bd4791ba58f70b3..91d0940bfea470e1c24007c1ea3c9cd378d9b48d 100644 (file)
@@ -1,17 +1,23 @@
 #include <ccan/cast/cast.h>
 #include <stdlib.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
-       char c;
+       long c;
 #ifdef FAIL
        char *
 #else
-       long
+       char
 #endif
                x = 0;
 
-       c = cast_static(char, x);
+       c = cast_static(long, x);
        (void) c; /* Suppress unused-but-set-variable warning. */
        return 0;
 }
+
+#ifdef FAIL
+#if !HAVE_COMPOUND_LITERALS
+#error "Unfortunately we don't fail if cast_static without compound literals"
+#endif
+#endif