[cxx-abi-dev] Long bitfields in PODs

Mark Mitchell mark at codesourcery.com
Wed May 14 18:59:17 UTC 2003


On Wed, 2003-05-14 at 11:49, Jason Merrill wrote:
> On Tue, 13 May 2003 13:11:45 -0700, Mark Mitchell <mark at codesourcery.com> wrote:
> 
> > A type like:
> >
> >   struct S {
> >     int i : 8192;
> >   };
> >
> > is a POD.
> >
> > According to 2.4, that means that the underlying C layout rules for
> > the system should be used.  Unfortunately, that kind of type is not
> > valid in C.
> >
> > I believe that all types with bitfields wider than their declared
> > types should be considered non-PODs for the purposes of layout.
> 
> I don't see why we need to consider it a non-POD.  It seems to me that if
> there are no applicable C layout rules, then whatever we do vacuously
> follows the rules.

We have to say something -- if we want all ABI-compliant compilers to
behave the same way.

Right now, we say:

2.2 POD Data Types

The size and alignment of C POD types is as specified by the base (C)
ABI. Type bool has size and alignment 1. All of these types have data
size and non-virtual size equal to their size. (We ignore tail padding
for PODs because the Standard does not allow us to use it for anything
else.)

Something in there needs to change, right?

-- 
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery.com




More information about the cxx-abi-dev mailing list