By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,844 Members | 1,918 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,844 IT Pros & Developers. It's quick & easy.

Do __attribute__((aligned(16))) take active for every element or the total variable?

P: 2
typedef __attribute__((aligned(16)))
struct {
unsigned long long w[3];
} UINT192;

UINT192 bid_Kx192[32];

extern void abort (void);

int main()
{
int i = 0;
unsigned long x = 0;
for (i = 0; i < 32; ++i)
bid_Kx192[i].w[1] = i == 1;
for (i = 0; i < 32; ++i)
x += bid_Kx192[1].w[1];
if (x != 32)
abort ();
return 0;
}

can we except every element of struct UINT192 aligned with 16 bytes ?
Apr 3 '19 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.