#define max(a,b) \\ ({ typeof (a) _a = (a); \\ typeof (b) _b = (b); \\ _a > _b ? _a : _b; })
Why not simply (a>b ? a :
(a>b ? a :
If the macro is called with expression, this might lead to unexpected behaviour. Assume this:
int c = max(i++, j++);
In this case, the max is increase twice with the simpler version.