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__ ((aligne开发者_JAVA技巧d)) )) );
}
For x86, gcc 3.4, 4.1, 4.3 I got 16.
精彩评论