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

mw@ipx2.rz.uni-mannheim.de (Marc Wachowitz)
Tue, 22 Aug 1995 07:49:20 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)
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)
[6 later articles]
| List of all articles for this month |
Newsgroups: comp.arch,comp.compilers
From: mw@ipx2.rz.uni-mannheim.de (Marc Wachowitz)
Followup-To: comp.compilers
Keywords: architecture
Organization: ---
References: <4074ig$nh7@masala.cc.uh.edu> 95-08-120
Date: Tue, 22 Aug 1995 07:49:20 GMT

Dennis O'Connor -FT-~ (doconnor@sedona.intel.com) wrote:
> If the C standard specified a flag or pair of flags that the
> compiler would set to indicate whether the target architecture
> was big- or little-endian, that would be a big help.


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


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.


                                Marc Wachowitz <mw@ipx2.rz.uni-mannheim.de>


--


Post a followup to this message

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