This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
- From: Jamie Lokier <jamie at shareable dot org>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: aoliva at redhat dot com, gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org, kenner at vlsi1 dot ultra dot nyu dot edu, rth at redhat dot com
- Date: Tue, 22 Apr 2003 01:07:08 +0100
- Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
- References: <20030421213551.97122F28D2@nile.gnat.com>
Robert Dewar wrote:
> Yes, at least that's the intention in Ada. Setting an alignment for a type
> specifies a minimum alignment for objects.
>
> type A is ...
>
> B : A;
> for B'Alignment use 4;
>
> Put_Line (Integer'Image (B'Alignment));
>
> This must output 4. Of course the compiler could still silently put
> B on a bigger alignment, since there would be no way to tell that it
> was doing this systematically, but this would be a poor implementation.
Must it output 4 even if A'Alignment is 8?
I think it should be an error to say "for B'Alignment use 4" in that
case, but I don't know Ada.
-- Jamie