This is the mail archive of the
mailing list for the GCC project.
Re: modify gcc to handle byteorder issue automatically
On Fri, Aug 08, 2003 at 08:30:31AM +0200, email@example.com wrote:
> Jim Wilson <wilson at tuliptree dot org>:
> > It seems easier to let users handle this in their own applications rather
> > than handling it in the compiler.
> Why not extend the __mode__ attribute
> __attribute__((__mode__(__SI__))) -> default endianess
> __attribute__((__mode__(__SI__,__BE__))) -> big endian
> __attribute__((__mode__(__SI__,__LE__))) -> little endian
> This way one doesn't have to worry about structs and bitfields
> and solves the problem for most of the users.
The only problem is that historically pointers to types with attributes lose
the attribute. Unless this has been fixed in the last couple of months, it
will need to be fixed.