Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.misc Subject: Re: Escape from strong typing (was: swap(x,y)) Message-ID: <10911@smoke.BRL.MIL> Date: 2 Sep 89 22:49:21 GMT References: <8350@boring.cwi.nl> <14479@haddock.ima.isc.com> <1545@l.cc.purdue.edu> <10897@smoke.BRL.MIL> <14500@haddock.ima.isc.com> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 9 In article <14500@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: >Btw, it wouldn't have worked to write "*(hack *)&x" since the implementation >passed arguments in registers; taking the address forced a store to memory. That's in fact what I had in mind when I implied that C has existing tools that can do the job. The particular implementation didn't need to allocate actual memory for the operation; presumably it did so because its optimizer wasn't sufficiently clever. (I assume that this would have been coded as a macro, not as a function call.)