RFC: attribute "unpadded"
Fergus Henderson
fjh@cs.mu.OZ.AU
Fri Aug 23 10:51:00 GMT 2002
On 23-Aug-2002, Mark Mitchell <mark@codesourcery.com> wrote:
> I want to create a new type attribute "unpadded" that would, on
> this code:
>
> struct S __attribute__((unpadded)) {
> int i;
> char c;
> };
>
> define S to have size 5 and alignment 4 on an ILP32 machine.
>
> The idea is that the normal tail padding of S (the three bytes
> after "c" to round it out to a multiple of the alignment) would
> be suppressed. It would be illegal to create arrays of these
> types, since the required alignment would not then be provided
> to all of the array elements.
What about pointer arithmetic, for pointers of type `S *'?
Would that be disallowed too?
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: < http://www.cs.mu.oz.au/~fjh > | -- the last words of T. S. Garp.
More information about the Gcc
mailing list