Arrays and Alignment
Gabriel Dos Reis
gdr@integrable-solutions.net
Tue Sep 23 21:05:00 GMT 2003
kenner@vlsi1.ultra.nyu.edu (Richard Kenner) writes:
| | > typedef unsigned char achar __attribute__ ((__aligned__(32)));
| | > achar a[2];
|
| | > __alignof__(a[1]):1
|
| I think this is wrong: it should be 32.
seconded.
| 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!
I stand corrected.
| 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.
Thanks for the precision.
-- Gaby
More information about the Gcc
mailing list