tdb2: fix msync() arg
[ccan] / ccan / cast / test / compile_fail-cast_const.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         char *uc;
12         const
13 #ifdef FAIL
14                 struct char_struct
15 #else
16                 char
17 #endif
18                 *p = NULL;
19
20         uc = cast_const(char *, p);
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_const can only use size"
27 #endif
28 #endif