This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: LittleEndian


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]