开发者

__attribute__((aligned)) - gcc

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜