Brain Teaser

Kirk Hays hays at nosun.UUCP
Thu Apr 5 02:22:14 AEST 1990


In article <100 at demott.COM> kdq at 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.



More information about the Comp.lang.c mailing list