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: RFC: attribute "unpadded"


    I wonder if Ada can do something like this already, it seems to have
    everything *else* in its type system...

Yes and no.  Certainly you need to be able to have a record in Ada where
there is no padding, but the idea of its size not being a multiple of its
alignment is problematic.  So what's actually done is that *two* sizes are
stored, the "GCC size", which includes the padding and is a multiple of the
alignment, and the "Ada size", which does not include the alignment.  The
distinction is that it's the Ada size that represents the minimum size that
the record requires when placed into another packed record.

I was trying to decide if Mark's proposal would help Ada, but can't tell:
I'd need to see more details to know for sure.


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