X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcast%2Ftest%2Fcompile_fail-cast_signed-const.c;h=9971dc8eb320cbdc1fc3cfcde2c71b34ea51f6ad;hb=e59b7388d8b2b56dc759be7c2dbf63100d2e131f;hp=4e67dc6264491b5e9e61ca15c874884f97b7cc24;hpb=118ace351b789dfaca8866f84a8cd4b924941268;p=ccan diff --git a/ccan/cast/test/compile_fail-cast_signed-const.c b/ccan/cast/test/compile_fail-cast_signed-const.c index 4e67dc62..9971dc8e 100644 --- a/ccan/cast/test/compile_fail-cast_signed-const.c +++ b/ccan/cast/test/compile_fail-cast_signed-const.c @@ -11,5 +11,12 @@ int main(int argc, char *argv[]) *p = NULL; uc = cast_signed(unsigned char *, p); + (void) uc; /* Suppress unused-but-set-variable warning. */ return 0; } + +#ifdef FAIL +#if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P +#error "Unfortunately we don't fail if cast_const can only use size" +#endif +#endif