Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!ubc-cs!uw-beaver!cornell!batcomputer!caen!zaphod.mps.ohio-state.edu!mips!pacbell.com!ucsd!nosc!dog.ee.lbl.gov!elf.ee.lbl.gov!torek From: torek@elf.ee.lbl.gov (Chris Torek) Newsgroups: comp.lang.c Subject: Re: macros and semicolons Message-ID: <14795@dog.ee.lbl.gov> Date: 28 Jun 91 17:06:55 GMT References: <1991Jun24.213932.595@otago.ac.nz> <160662@pyramid.pyramid.com> <6531@goanna.cs.rmit.oz.au> <1991Jun28.134517.5972@nss1.com> Reply-To: torek@elf.ee.lbl.gov (Chris Torek) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 10 X-Local-Date: Fri, 28 Jun 91 10:06:55 PDT In article <1991Jun28.134517.5972@nss1.com> mrm@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@ee.lbl.gov