Arrays and Alignment

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Tue Sep 23 20:44:00 GMT 2003


| > typedef unsigned char achar __attribute__ ((__aligned__(32)));
| > achar           a[2];

| > __alignof__(a[1]):1

I think this is wrong: it should be 32.

    Note however that an object may be defined to have a user-supplied
    alignment without implying that its type has the same alignment.  

    I remember Kenner argued for that distinction (a while ago).  

Yes, but not in this direction!  An object cannot be *less* aligned than
it's type.  I argued for being able to represent an object that was *more*
aligned than its type.



More information about the Gcc mailing list