Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: swap(x,y) Message-ID: <6029@ficc.uu.net> Date: 5 Sep 89 12:07:58 GMT References: <8350@boring.cwi.nl> <1560@l.cc.purdue.edu> Organization: Xenix Support, FICC Lines: 14 In article <1560@l.cc.purdue.edu>, cik@l.cc.purdue.edu (Herman Rubin) writes: > In article <10790@riks.csl.sony.co.jp>, diamond@csl.sony.co.jp (Norman Diamond) writes: > > *(int*)&x > What if x is in a register? What if it is? This is a quality-of-implementation issue. A good optimiser will cancel out all the extra loads and stores. I'm sure you wouldn't bother with a compiler with a poor optimiser... -- Peter da Silva, *NIX support guy @ Ferranti International Controls Corporation. Biz: peter@ficc.uu.net, +1 713 274 5180. Fun: peter@sugar.hackercorp.com. `-_-' "The Distribution: field on the header has been modified so as not to 'U` violate Information Export laws." -- eugene miya, NASA Ames Research Center.