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: modify gcc to handle byteorder issue automatically


On Fri, Aug 08, 2003 at 08:30:31AM +0200, hartmut.schirmer@arcormail.de 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.

-- 
Michael Meissner
email: gnu@the-meissners.org
http://www.the-meissners.org


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