指定64位对齐

2023-09-11 07:52:03 作者:你怎么那么懂事,连崩溃都是悄无声息的。今日小编带来的是一看一

由于像

struct foo {
    int a, b, c;
};

什么是指定它应该始终对齐到64位地址的最佳(最简单,最可靠和便携式)的方式,即使是在32位版本的?我使用C ++ 11与GCC 4.5.2,并希望也支持锵。

What's the best (simplest, most reliable and portable) way to specify that it should always be aligned to a 64-bit address, even on a 32-bit build? I'm using C++11 with GCC 4.5.2, and hoping to also support Clang.

推荐答案

既然你说你正在使用GCC并希望支持铛,GCC的对齐

相关推荐
 
精彩推荐
图片推荐