gcc将如何设置变量/字段的对齐方式
__attribute__((aligned))
不同的 gcc 版本/不同的平台呢?
测试代码:
int main() {
printf("%d\n", (__alignof__(char __attribute__ ((aligned)) )) );
}
对于 x86、gcc 3.4、4.1、4.3,我得到了 16。
gcc将如何设置变量/字段的对齐方式
__attribute__((aligned))
不同的 gcc 版本/不同的平台呢?
测试代码:
int main() {
printf("%d\n", (__alignof__(char __attribute__ ((aligned)) )) );
}
对于 x86、gcc 3.4、4.1、4.3,我得到了 16。