cast, container_of, tlist: Fix warning with GCC 4.6: -Wunused-but-set-variable
[ccan] / ccan / cast / test / compile_fail-cast_static-3.c
1 #include <ccan/cast/cast.h>
2 #include <stdlib.h>
3
4 int main(int argc, char *argv[])
5 {
6         char *c;
7 #ifdef FAIL
8         const
9 #endif
10                 char *p = 0;
11
12         c = cast_static(char *, p);
13         (void) c; /* Suppress unused-but-set-variable warning. */
14         return 0;
15 }
16
17 #ifdef FAIL
18 #if !HAVE_COMPOUND_LITERALS
19 #error "Unfortunately we don't fail if cast_static is a noop"
20 #endif
21 #endif