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"


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.


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