tdb2: more stats
[ccan] / ccan / cast / test / compile_fail-cast_signed-sizesame.c
1 #include <ccan/cast/cast.h>
2 #include <stdlib.h>
3
4 /* Note: this *isn't* sizeof(char) on all platforms. */
5 struct char_struct {
6         char c;
7 };
8
9 int main(int argc, char *argv[])
10 {
11         unsigned char *uc;
12 #ifdef FAIL
13         struct char_struct
14 #else
15         char
16 #endif
17                 *p = NULL;
18
19         uc = cast_signed(unsigned char *, p);
20
21         return 0;
22 }
23
24 #ifdef FAIL
25 #if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P
26 #error "Unfortunately we don't fail if cast_signed can only use size"
27 #endif
28 #endif