This is the mail archive of the gcc-patches@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: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT


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


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