This is the mail archive of the gcc-patches@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: [PATCH] MS Bitfields for Interix


Donn Terry wrote:
> 
> I haven't looked at the patch content yet, and may not be able to for a
> while.  However, I think, regardless of the patch, that the following
> applies.
> 
> There are three possible states when both attribute packed and pragma
> pack are both used:

That's a different issue, and IMHO of lesser interest, since both the
pragma nad the attribute are in the source code.  The issue I am talking
about is a clash between the structure layout mandated by the ABI and
what the application wants to do to describe a specific bit layout - that
can be in the FP emulation to get the IEEE layout, or it could describe
hardware registers.  In either case, you want the compiler to lay out
the structure exactly as specified, regardless of the prevailing ABI.

> In EITHER case 1 or case 2, it will do something "wrong" (in terms of
> binary
> compatability) sometimes.  What you describe below is one of those.  If

It is not.  #pragma pack doesn't even enter the picture.

> (clearly) have worked.  If you want "native" (MS compatabile) packing
> all the
> time, you cannot EVER turn on __attribute__((packed)) because gnu
> packing is
> much tighter that that from #pragma pack.

The point is that the MS compatible packing should be used by default, but
attribute packed specifies explicitly to use the dense GNU packing, and
hence should take precedence.
	
-- 
--------------------------
SuperH (UK) Ltd.
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330


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