macros and semicolons

Chris Torek torek at elf.ee.lbl.gov
Sat Jun 29 03:06:55 AEST 1991


In article <1991Jun28.134517.5972 at nss1.com> mrm at nss1.com
(Michael R. Miller) writes:
>#define swap(x, y)  (x ^= y ^= x ^= y)

See the Frequently Asked Questions.  This macro produces undefined
results because it modifies an object more than once without an
intervening sequence point.
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427)
Berkeley, CA		Domain:	torek at ee.lbl.gov



More information about the Comp.lang.c mailing list