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

Michael Meissner <meissner@cygnus.com>
Fri, 25 Aug 1995 17:14:02 GMT

          From comp.compilers

Related articles
[2 earlier articles]
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)
Re: Help: How to determine big/little endian? meissner@cygnus.com (Michael Meissner) (1995-08-25)
Re: Help: How to determine big/little endian? cwf@research.att.com (Chris Fraser) (1995-08-25)
Re: Help: How to determine big/little endian? nr@cs.purdue.edu (1995-08-25)
Re: Help: How to determine big/little endian? doug@netcom.com (1995-08-26)
Re: Help: How to determine big/little endian? meissner@cygnus.com (Michael Meissner) (1995-09-01)
Re: Help: How to determine big/little endian? mab@wdl.loral.com (1995-09-01)
Re: Help: How to determine big/little endian? erik@kroete2.freinet.de (1995-09-03)
[2 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: Michael Meissner <meissner@cygnus.com>
Keywords: architecture
Organization: Compilers Central
References: 95-08-165
Date: Fri, 25 Aug 1995 17:14:02 GMT

| My advice for this and similar situations is to write a small program which
| tests the cases with which your program should be able to deal, and creates
| an include file with the appropriate definitions for the real program. This
| approach also works with other languages, where you can't tell something by
| asking the compiler, but want to determine it at compile time.


The problem with this approach is that it works fine for situations
where the output of the compiler is directly runable. If you use a
cross compiler, you have to run the test program on the target. For
example, in my current job, I develop big endian PowerPC compilers
(GCC) on Linux running on a little endian Pentium. In fact, when you
get to the embedded world, it is often times the case that the target
doesn't run an OS (or you have to down load it via a serial line or
flash EPROM).


--
Michael Meissner, Cygnus Support (East Coast)
Suite 105, 48 Grove Street, Somerville, MA 02144, USA
meissner@cygnus.com, 617-629-3016 (office), 617-629-3010 (fax)
--


Post a followup to this message

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