This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] MS Bitfields for Interix
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: Donn Terry <donnte at microsoft dot com>
- Cc: Douglas B Rupp <rupp at gnat dot com>, gcc-patches at gcc dot gnu dot org, aoliva at redhat dot com
- Date: Mon, 09 Sep 2002 17:05:00 +0100
- Subject: Re: [PATCH] MS Bitfields for Interix
- Organization: SuperH UK Ltd.
- References: <FE465D8F724E3F4F811D067203A214AE05342CCE@red-msg-08.redmond.corp.microsoft.com>
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
> 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
> 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