minmax: New module, safe min and max macros
[ccan] / ccan / minmax / test / compile_fail-wrongsign.c
1 #include <ccan/minmax/minmax.h>
2
3 static int function(void)
4 {
5 #ifdef FAIL
6         return min(1, 1U);
7 #if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P
8 #error "Unfortunately we don't fail if the typechecks are noops."
9 #endif
10 #else
11         return 0;
12 #endif
13 }
14
15 int main(int argc, char *argv[])
16 {
17         function();
18         return 0;
19 }