Re: Help: How to determine big/little endian?

"John Carter" <ECE@dwaf-hri.pwv.gov.za>
Mon, 21 Aug 1995 06:05:57 GMT

          From comp.compilers

Related articles
Re: Help: How to determine big/little endian? doconnor@sedona.intel.com (1995-08-17)
Re: Help: How to determine big/little endian? ECE@dwaf-hri.pwv.gov.za (John Carter) (1995-08-21)
Re: Help: How to determine big/little endian? baynes@ukpsshp1.serigate.philips.nl (1995-08-21)
Re: Help: How to determine big/little endian? pardo@cs.washington.edu (1995-08-21)
Re: Help: How to determine big/little endian? mw@ipx2.rz.uni-mannheim.de (1995-08-22)
Re: Help: How to determine big/little endian? tonyk@cybercom.net (1995-08-22)
Re: Help: How to determine big/little endian? paysan@informatik.tu-muenchen.de (1995-08-21)
Re: Help: How to determine big/little endian? tim@franck.Princeton.EDU (1995-08-25)
[9 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: "John Carter" <ECE@dwaf-hri.pwv.gov.za>
Keywords: C, architecture, comment
Organization: Dpt Water Affairs & Forestry (IWQS)
References: 95-08-120
Date: Mon, 21 Aug 1995 06:05:57 GMT

>So, how about it, GNU and ANSI ? Let's see __BIGEND__
>and __LITTLEEND__ incorporated into the standards.
Seconded!


>[How often in otherwise platform independent code do you really need to know
>the byte order?
Not often. But it is very painful when you do. Even if your desire is
not to be Platform Independant, but merely to dredge from memory
which flavour is Intel...


>I've almost always been able to program around it without
>much trouble. -John]
Mostly by ending up with a program that will work only on the current
machine. Ran into this one with a simple checksum program just the
other day.


On the other hand one then needs to dredge from the primal sludge of
memory, what is the meaning of BigEndian and LittleEndian. Maybe
_HIGHER_ADDRESSES_ARE_MORE_SIGNIFICANT and
_LOWER_ADDRESSES_ARE_MORE_SIGNIFICANT would be better flags...


I spotted an article in Dr Dobbs on the subject of Endian neutral
programmming, but I didn't buy it.... What was their answer to the
problem?


John Carter
Institute for Water Quality Studies. Department of Water Affairs.
Internet : ece@dwaf-hri.pwv.gov.za
Phone : 27-12-808-0374x194 Fax : 27-12-808-0338
[Honest, ten years ago I was writing code that had to run on PDP-11, Vax,
8086, and IBM mainframes. It wasn't real hard, and didn't have a lot of
ifdefs. What I mostly did was to use shiting and masking in the few places
where we needed a specific byte order in data read from or written to
external files. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.