RFC: attribute "unpadded"
Joe Buck
Joe.Buck@synopsys.com
Wed Aug 28 11:20:00 GMT 2002
Richard Earnshaw:
> > > I wonder if we should not just give the type two sizes, an unpadded one
> > > and a padded one. Then the unpadded one would be used for operations such
Me:
> > That would violate C semantics: sizeof() must return the padded length.
> > If it did not, the common C idiom
Richard:
> We've already gone outside the realm of the C standard as soon as we
> define __attribute__ ((unpadded)).
You're right, I was confused. Objection withdrawn, pardon my stupidity.
On the other hand, there may be other problems with making arrays of unpadded
objects. It almost seems contractory: to find the address of foo[1] we
consider padding, but we've declared the thing unpadded.
More information about the Gcc
mailing list