]> git.ozlabs.org Git - ccan/blob - ccan/cast/test/compile_fail-cast_static.c
ccanlint: Move ccanlint test options from _info comments to code
[ccan] / ccan / cast / test / compile_fail-cast_static.c
1 #include <ccan/cast/cast.h>
2 #include <stdlib.h>
3
4 int main(void)
5 {
6         long c;
7 #ifdef FAIL
8         char *
9 #else
10         char
11 #endif
12                 x = 0;
13
14         c = cast_static(long, x);
15         (void) c; /* Suppress unused-but-set-variable warning. */
16         return 0;
17 }
18
19 #ifdef FAIL
20 #if !HAVE_COMPOUND_LITERALS
21 #error "Unfortunately we don't fail if cast_static without compound literals"
22 #endif
23 #endif