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


    Yes, the type can have greater alignment.  However type normally does
    imply a minimum alignment and minimum size.  Specifying user alignment
    for a well-defined type seems redundant.

You lost me.

If I have a record of two 16-bit fields, the natural alignment of that type
is 16 bits.  However, the user is allowed to specify an alignment of 32
bits for the type.

I'm not sure what your second sentence means, but it is indeed true
that the compiler cannot change the alignment of a type since it
bounds it in both directions: it gives the minimum alignment that an
object of that type created by the compiler is guaranteed to have, but
it also gives the *maximum* alignment that the compiler is allowed to assume
that a user-created object of that type will have.


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