compiler: RETURNS_NONNULL macro
[ccan] / ccan / cast / test / compile_fail-cast_signed-const.c
1 #include <ccan/cast/cast.h>
2 #include <stdlib.h>
3
4 int main(void)
5 {
6         unsigned char *uc;
7 #ifdef FAIL
8         const
9 #endif
10         char
11                 *p = NULL;
12
13         uc = cast_signed(unsigned char *, p);
14         (void) uc; /* Suppress unused-but-set-variable warning. */
15         return 0;
16 }
17
18 #ifdef FAIL
19 #if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P
20 #error "Unfortunately we don't fail if cast_const can only use size"
21 #endif
22 #endif