Given a structure definition like
struct foo {
int a, b, c;
};
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.
Since you say you’re using GCC and hoping to support Clang, GCC’s
alignedattribute should do the trick: