This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
- From: Geert Bosch <bosch at gnat dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner),gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Thu, 17 Apr 2003 18:05:28 -0400
- Subject: Re: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT
On Thursday, Apr 17, 2003, at 16:15 America/New_York, Alexandre Oliva
wrote:
Ok, you got me curious. Would you mind explaining to an Ada-clueless
person how come these two cases can possibly be different? In my
C-centric view, I really can't see the difference. Code snippets
demonstrating the semantic difference would be highly appreciated.
Below is an example which is required not to raise Program_Error:
with System.Storage_Elements; use System.Storage_Elements;
procedure T is
type Point is record
X, Y, Z : Long_Float;
end record;
type Path is array (Positive range <>) of Point;
pragma Pack (Path);
Q : Point;
for Q'Alignment use 16;
begin
if Q'Address mod 16 /= 0 then
raise Program_Error;
end if;
end T;
Waiting to be enlightened, :-)
Hope the example helps. Yell if not :-)