are statically allocated structs always aligned to a machine word on x86/x86_64?

Jonathan Wakely jwakely.gcc@gmail.com
Sun Aug 23 15:23:00 GMT 2015


On 23 August 2015 at 16:19, Segher Boessenkool wrote:
> On Sun, Aug 23, 2015 at 02:49:17PM +0100, Jonathan Wakely wrote:
>> 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."
>
> Ah, that is hidden deep in /4, I didn't see it :-)  This is new
> in C11 it seems?


Yes, quite possibly, I don't have anything older than C11 on this
machine to check though.



More information about the Gcc-help mailing list