X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=ccan%2Fminmax%2Ftest%2Fcompile_fail-wrongsign.c;fp=ccan%2Fminmax%2Ftest%2Fcompile_fail-wrongsign.c;h=6aeaf1c75e4dd054291f6b7292d67bfb084dc99c;hb=e8fe775b03a9abde11f7ce7a9ebf8e002111e923;hp=0000000000000000000000000000000000000000;hpb=930753e727859171d37f2e51d129f2e42ecf1dfa;p=ccan diff --git a/ccan/minmax/test/compile_fail-wrongsign.c b/ccan/minmax/test/compile_fail-wrongsign.c new file mode 100644 index 00000000..6aeaf1c7 --- /dev/null +++ b/ccan/minmax/test/compile_fail-wrongsign.c @@ -0,0 +1,19 @@ +#include + +static int function(void) +{ +#ifdef FAIL + return min(1, 1U); +#if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P +#error "Unfortunately we don't fail if the typechecks are noops." +#endif +#else + return 0; +#endif +} + +int main(int argc, char *argv[]) +{ + function(); + return 0; +}