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: DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT


    Well...  You can always compare DECL_USER_ALIGN with TYPE_USER_ALIGN,
    if you care strongly about that.  

No, you can't.  You can't distinguish between the cases where the alignment
is specified for the type and not the object and the case where it is
specified for both.

    But the point that whether the alignment came from a decl-specific
    attribute or from the type shouldn't make a difference.

Why not?  They are two *very* different things with different semantics.

    But why should the common case be more difficult and error-prone?  

Which is "the common case"?  Specifying the alignment of either in C is 
very rare since it is a GNU extension.  Specifying alignment in Ada is
much more common and there the most common case is specifying it for
types and not for objects.

    Do you have any situation in mind in which it is actually important to
    tell whether a decl-specific user-requested alignment came from the
    variable declaration or from its type?

Sure.  It's required to properly implement these specifications for Ada,
where the semantics of the two cases are completely different.


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