This is why parenthesis in macro definitions are important.
A macro does simple text substitution. So when you do this:
m=3+MAX(2,3);
It expands to this:
m=3+2>3 ? 2:3
With the implicit parenthesis:
m = ((3+2)>3) ? 2:3
Which is probably not what you want.
You need to put parenthesis around the entire macro as well as around each argument wherever it is used:
#define MAX(a,b) ((a)>(b) ? (a) : (b))
This will then expand to:
m = 3 + ((2)>(3) ? (2):(3))
Also note that with a macro like this you open yourself up to side effects of one of the operands. For example, if you did this:
int a=2, b=3;
m = MAX(a++,b);
You would get:
int a=2, b=3;
m = ((a++) > (b) ? (a++) : (b));
This invokes undefined behavior because it attempts to modify a
more than once in an expression without a sequence point.