I am getting the following warning:
warning: left-hand operand of comma expression has no effect
The macros are defined below. I am compiling with GCC (4.4.3) on Linux. It is C code.
#define MY_MAX(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })
#define MY_MIN(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })
How do I fix them to get rid of the warnings?
[[Update]]
Actually, I found the cause of the warning. It had nothing to do with the macro itself. It was because I was trying to find the min of two numbers, one of which was a #def named as MAXIMUM_ARRAYSIZE. It was defined as:
#define MAXIMUM_ARRAYSIZE (sizeof(size_t)==2,16384,1073741824)
That is a pretty strange macro definition.