]> git.ozlabs.org Git - ccan/blobdiff - ccan/str/test/compile_fail-isblank.c
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / str / test / compile_fail-isblank.c
index 86a33503dab00fb0f3007f4c5c066030ad602c22..e14b0d7e66ac1a8e0018233c709b7274e182a468 100644 (file)
@@ -3,8 +3,9 @@
 
 int main(int argc, char *argv[])
 {
+       (void)argc;
 #ifdef FAIL
-#if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
+#if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF || !HAVE_ISBLANK
 #error We need typeof to check isblank.
 #endif
        char
@@ -15,9 +16,12 @@ int main(int argc, char *argv[])
 
 #ifdef FAIL
        /* Fake fail on unsigned char platforms. */
-       c = 255;
-       BUILD_ASSERT(c < 0);
+       BUILD_ASSERT((char)255 < 0);
 #endif
 
+#if HAVE_ISBLANK
        return isblank(c);
+#else
+       return c;
+#endif
 }