This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: attribute "unpadded"
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 24 Aug 2002 03:51:38 +1000
- Subject: Re: RFC: attribute "unpadded"
- References: <3627294541.1030124478@[192.168.0.103]>
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.