CCoding Style - Parenthesize the macro body and arguments2

From EdWiki

Revision as of 09:30, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- Emsys pages from Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Parenthesize the macro body and arguments ...

Even Parenthesizing the macro properly doesn’t address the multiple evaluation problem.

#define    max( x, y)    ( (x) > (y) ? (x) : (y) )

And it is invoked as

max( i++, j++ )

Will increment the larger value twice.