X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fcast%2Ftest%2Fcompile_fail-cast_static.c;h=a4ebf61b1ae66549a792771ca1085701b9efce0b;hp=0f9e4780470a267dbf4573b76bd4791ba58f70b3;hb=6abc867fce8c3eba40eb26092d31e34b47dd9165;hpb=f27c9672ef62379e09793dcf42725bf9c37f44bf diff --git a/ccan/cast/test/compile_fail-cast_static.c b/ccan/cast/test/compile_fail-cast_static.c index 0f9e4780..a4ebf61b 100644 --- a/ccan/cast/test/compile_fail-cast_static.c +++ b/ccan/cast/test/compile_fail-cast_static.c @@ -3,15 +3,21 @@ int main(int argc, char *argv[]) { - char c; + long c; #ifdef FAIL char * #else - long + char #endif x = 0; - c = cast_static(char, x); + c = cast_static(long, x); (void) c; /* Suppress unused-but-set-variable warning. */ return 0; } + +#ifdef FAIL +#if !HAVE_COMPOUND_LITERALS +#error "Unfortunately we don't fail if cast_static without compound literals" +#endif +#endif