This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: attribute "unpadded"
- From: Joe Buck <Joe dot Buck at synopsys dot com>
- To: Richard dot Earnshaw at arm dot com
- Cc: Joe dot Buck at synopsys dot COM (Joe Buck),mark at codesourcery dot com (Mark Mitchell), gcc at gcc dot gnu dot org
- Date: Wed, 28 Aug 2002 11:20:25 -0700 (PDT)
- Subject: 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.