The gcc mailing list thread that starts with this message explores the issue. http://gcc.gnu.org/ml/gcc/2003-09/msg01031.html #include <stdio.h> typedef unsigned char achar __attribute__ ((__aligned__(32))); achar a[2]; int main(int argc,char* argv[]){ printf("__alignof__(achar):%u\n",__alignof__(achar)); printf("__alignof__(a[1]):%u\n",__alignof__(a[1])); printf("&a: %8.8lX\n",(unsigned long)&a); printf("sizeof(a):%u\n",sizeof(a)); printf("sizeof(a[0]):%u\n",sizeof(a[0])); printf("&a[0]: %8.8lX\n",(unsigned long)&a[0]); printf("&a[1]: %8.8lX\n",(unsigned long)&a[1]); return 0; } % gcc -o main main.c ; main __alignof__(achar):32 __alignof__(a[1]):1 &a: 08049740 sizeof(a):32 sizeof(a[0]):1 &a[0]: 08049740 &a[1]: 08049741 <<<<<<<<<<<< I expected this to be 08049760 % gcc --version gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5) I expected the second element of the array to be aligned as well as the first, since the alignment of the type is 32.
alignment is only for structors and where it stored on the stack/global memory.