This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: LittleEndian
- From: Allan Sandfeld Jensen <snowwolf at one2one-networks dot com>
- To: dewar at gnat dot com (Robert Dewar),gcc at gcc dot gnu dot org
- Date: Tue, 30 Apr 2002 13:08:54 +0200
- Subject: Re: LittleEndian
- References: <20020429215234.C3DABF28F4@nile.gnat.com>
On Monday 29 April 2002 23:52, Robert Dewar wrote:
> > Why would you want such an option? If the code contains byte-order
> > dependencies, it's unlikely that a compiler option would fix it. If
> > you're trying to port binary data files, good luck.
>
> Most often the reason people want this is that they think it will
> automatically solve the endianess problem in porting code or data from one
> machine to another. That's wrong of course, but people live in hope :-)
Sometimes it just practical if you want to retain your bitfidling algorithms
from one architecture to another. Ofcouse personally I would prefer to have
it as a syntax option to int. E.g. "little_endian long int" or just "le
long". The ELF-flag would then just specify which is default.
The above would make it possible to mark the places in the code where you
assume endianness, and as a minimum halt compilation on architectures that
doesnt support the assumed endian.
`Allan