开发者

__attribute__((aligned)) - gcc

开发者 https://www.devze.com 2023-01-14 07:11 出处:网络
How will gcc set the alignment for variable/field with __attribute__((aligned)) What about different gcc versions/ different platforms?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消