This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: are statically allocated structs always aligned to a machine word on x86/x86_64?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: john smith <wempwer at gmail dot com>, gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Sun, 23 Aug 2015 14:49:17 +0100
- Subject: Re: are statically allocated structs always aligned to a machine word on x86/x86_64?
- Authentication-results: sourceware.org; auth=none
- References: <CAKmQUfZT04z8pd9bvqazEPkV1iqRrUxw82nxd3RbOerVbyxqhA at mail dot gmail dot com> <CAH6eHdQdAt1sqtnZe7CiJtWKb_SeggnXieiiR7Wf4D8Uf1sLyg at mail dot gmail dot com> <CAKmQUfbuZ-tbggq8iCxYd4G_VSnVgbS-jBzPc6AYxQhRtN65GQ at mail dot gmail dot com> <CAH6eHdQUBc_Rh_zcTD1hKvCV=XPt9KHupGgFcT2aks-fu=BS3g at mail dot gmail dot com> <20150823110539 dot GA16487 at gate dot crashing dot org>
On 23 August 2015 at 12:05, Segher Boessenkool wrote:
> On Sun, Aug 23, 2015 at 12:15:56AM +0100, Jonathan Wakely wrote:
>> because alignments must be a power of 2.
>
> That is true in C++, but not true in C or even POSIX afaics?
C11 Â6.2.8
"Every valid alignment value shall be a nonnegative integral power of two."