views:

45

answers:

0

Hello

How will gcc set the alignment for variable/field with

 __attribute__((aligned))

What about different gcc versions/ different platforms?

Testing code:

int main() {
printf("%d\n", (__alignof__(char __attribute__ ((aligned)) )) );
}

For x86, gcc 3.4, 4.1, 4.3 I got 16.