By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,844 Members | 1,895 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.

can the alignment of array elements letter than element size?

P: 2
I see https://gcc.gnu.org/ml/gcc-patches/2005-10/msg00253.html, but don't find the description in C ABI.

*** gcc.orig/gcc/stor-layout.c Thu Sep 29 10:27:09 2005
--- gcc/gcc/stor-layout.c Wed Oct 5 15:00:30 2005
*************** layout_type (tree type)
*** 1817,1822 ****
--- 1817,1828 ----
TYPE_MODE (type) = BLKmode;
}
}
+ if (TYPE_SIZE_UNIT (element)
+ && TREE_CODE (TYPE_SIZE_UNIT (element)) == INTEGER_CST
+ && compare_tree_int (TYPE_SIZE_UNIT (element), 0) != 0
+ && compare_tree_int (TYPE_SIZE_UNIT (element),
+ TYPE_ALIGN_UNIT (element)) < 0)
+ error ("alignment of array elements is greater than element size");
break;
}
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.