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"


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.


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