_Generic(expression, type1: e1, ... /*, default: e */);
expression is not evaluated.
This is especially useful for writing type-generic macros, that will behave differently depending on the type of the argument.
#define my_imaxabs _Generic(INTMAX_C(0), \
long: labs, \
long long: llabs \
/* long long long: lllabs */ \
)
int
main(void)
{
off_t a;
a = -42;
printf("imaxabs(%jd) == %jd\n", (intmax_t) a, my_imaxabs(a));
printf("&imaxabs == %p\n", &my_imaxabs);
printf("&labs == %p\n", &labs);
printf("&llabs == %p\n", &llabs);
exit(EXIT_SUCCESS);
}