This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Big-endian Gcc on Intel IA32
- From: dewar at gnat dot com
- To: dewar at gnat dot com, gcc at gcc dot gnu dot org, torvalds at transmeta dot com
- Date: Mon, 17 Dec 2001 16:12:52 -0500 (EST)
- Subject: Re: Big-endian Gcc on Intel IA32
<<<<One thing that might be helpful for portability issues like this, where
the user _is_ willing and able to recompile the application, but maybe
not able to find all subtly users of byte-order dependencies would be to
allow the notion of "byte order attributes" on data structures.
>>
This is a much trickier language feature to design than you would imagine.
We have been struggling with this in Ada for a while.
<<Imagine being able to just tag the data structures with "this data
structure is big-endian", and have the compiler automatically do the
conversion when a value is loaded from such a data structure.
>>
I't snice to imagine, but hard to work out the details.
I am definitely not opposed to this, and indeed support an effort
to try to design such a feature. A good starting point for reading
is Norm Cohen's tutorial on the Bit_Order attribute in Ada (not sure
what the reference is, perhaps someone else can supply it).