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: How to change bit-field allocation


> -----Original Message-----
> From: gcc-owner On Behalf Of James E Wilson
> Sent: 06 September 2004 22:44

> Min ZOU wrote:
> > As I know, GCC allocates bit-fields inside a structure from 
> the lowest
> > addressed byte, i.e. LSB, for little endian. However, I 
> want to reverse
> > the ordering for the bit-fields allocation, i.e. always from MSB.

>   The normal rule is that a bitfield goes in the 
> first avaiable bit.  You want it to go in the last available bit 
> instead.  But the last bit of what?  

  Um, what's wrong with saying "The underlying integer type" as an answer to
this question?  You needn't insist on the compiler reversing the order of
allocation of consecutive underlying-int-type-sized units when it build the
struct, just that it fills the current one in the reverse direction.

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


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