]> git.ozlabs.org Git - ccan/blobdiff - ccan/cast/test/compile_fail-cast_signed-const.c
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / cast / test / compile_fail-cast_signed-const.c
index 4e67dc6264491b5e9e61ca15c874884f97b7cc24..26bf8974ea48d6e82e6dda4de0f71f6f0878bd9e 100644 (file)
@@ -1,7 +1,7 @@
 #include <ccan/cast/cast.h>
 #include <stdlib.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
        unsigned char *uc;
 #ifdef FAIL
@@ -11,5 +11,12 @@ int main(int argc, char *argv[])
                *p = NULL;
 
        uc = cast_signed(unsigned char *, p);
+       (void) uc; /* Suppress unused-but-set-variable warning. */
        return 0;
 }
+
+#ifdef FAIL
+#if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P
+#error "Unfortunately we don't fail if cast_const can only use size"
+#endif
+#endif