This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Arrays and Alignment
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: gdr at integrable-solutions dot net
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 23 Sep 03 15:50:16 EDT
- Subject: Re: Arrays and Alignment
| > 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.