Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!pyramid!hplabs!sdcrdcf!psivax!friesen From: friesen@psivax.UUCP (Stanley Friesen) Newsgroups: net.lang.c Subject: Re: Byte order (retitled) Message-ID: <1104@psivax.UUCP> Date: Wed, 16-Apr-86 16:33:14 EST Article-I.D.: psivax.1104 Posted: Wed Apr 16 16:33:14 1986 Date-Received: Fri, 18-Apr-86 21:04:29 EST References: <7046@cca.UUCP> <7158@cca.UUCP> Reply-To: friesen@psivax.UUCP (Stanley Friesen) Organization: Pacesetter Systems Inc., Sylmar, CA Lines: 25 In article <7158@cca.UUCP> g-rh@cca.UUCP (Richard Harter) writes: >> >>Many implementors of C on big-endian machines have had to cope with >>the pointer conversion problem, which is simpler on little-endians. >> > Color me skeptical. You may be right, but I would like to > see more details. In the model of pointers that it occurs > to me to implement, big-Endian and little-endian come out > the same. Could you expand on this! Do you mean that if you cast a pointer to a long to a pointer to a short and dereference you will get the *high* order portion on a big-endian machine and the *low* order portion on a little-endian? Clearly a portability problem, and the the big-endian behavior is counter-intuitive. Or do you intend that the pointer always point to the low-order byte even on a big-endian machine? Then you have to index *backwards* to break the item up into bytes! Really, the only way to get the rigth semantics on a big-endian machine is to actually convert pointers when a cast is used. -- Sarima (Stanley Friesen) UUCP: {ttidca|ihnp4|sdcrdcf|quad1|nrcvax|bellcore|logico}!psivax!friesen ARPA: ttidca!psivax!friesen@rand-unix.arpa