This is the mail archive of the
mailing list for the GCC project.
RE: How to change bit-field allocation
- From: "Dave Korn" <dk at artimi dot com>
- To: "'James E Wilson'" <wilson at specifixinc dot com>,"'Min ZOU'" <zou dot min at renesas dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 7 Sep 2004 16:54:08 +0100
- Subject: 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.
Can't think of a witty .sigline today....