6a7377fd6d16862a7efad1b90a9b2bbd5c80123f
[ccan] / ccan / str / test / compile_fail-isxdigit.c
1 #define CCAN_STR_DEBUG 1
2 #include <ccan/str/str.h>
3
4 int main(int argc, char *argv[])
5 {
6 #ifdef FAIL
7 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
8 #error We need typeof to check isxdigit.
9 #endif
10         char
11 #else
12         unsigned char
13 #endif
14                 c = argv[0][0];
15
16 #ifdef FAIL
17         /* Fake fail on unsigned char platforms. */
18         c = 255;
19         BUILD_ASSERT(c < 0);
20 #endif
21
22         return isxdigit(c);
23 }