RFC: attribute "unpadded"
Richard Kenner
kenner@vlsi1.ultra.nyu.edu
Fri Aug 23 16:07:00 GMT 2002
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.
More information about the Gcc
mailing list