Path: utzoo!attcan!uunet!ogicse!littlei!nosun!hays From: hays@nosun.UUCP (Kirk Hays) Newsgroups: comp.lang.c Subject: Re: Brain Teaser Message-ID: <661@intelisc.nosun.UUCP> Date: 4 Apr 90 16:22:14 GMT References: <12726@ulysses.att.com> <100@demott.COM> Organization: Intel Scientific Computers Lines: 25 In article <100@demott.COM> kdq@demott.COM (Kevin D. Quitt) writes: [ discussion of (nasty) micro-efficiency hack eliminated, one guaranteed not to work on machines with disjoint address spaces, sizeof (char*) > sizeof (long), or 'active' pointers] > It *DOES* work on the intel machines. The only Intel processors it >might not work on are the 386 and 486, since they have 48 bit addresses. >But the C compilers for these processors don't give you direct access to >48bit addresses. Wrong. I know of at least six (6) different compilers for the 386/486, some of them non-Intel, that support 48 bit pointers. They're very good for shaking bugs out of programs which are written with the "all the world is a flat address space of 32 bits" mentality. I say, use a temporary variable, and let the compiler figure out that you're doing a swap. Nasty hacks like this one should be a last resort, and should probably appear only in device drivers and the like... -- Kirk Hays - I'm the NRA, NRA-ILA, CCRKBA, SAF, and Neal Knox is my lobbyist.