emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs-26 9e59de9: Use GCALIGNED properly for GCC


From: Philipp Stephani
Subject: Re: emacs-26 9e59de9: Use GCALIGNED properly for GCC
Date: Fri, 10 Nov 2017 18:11:49 +0000



Stefan Monnier <address@hidden> schrieb am Fr., 10. Nov. 2017 um 19:03 Uhr:
>>> union gcaligned_foo { struct foo s; int64_t gcaligned; };
>> Are int64_t necessarily aligned on multiples of 8 on 32bit platforms?
> No, unfortunately.

That was my impression as well.

> That does not work either, alas, as C11 says 'alignas (8)' is an error when
> the natural alignment of the object is less than 8. This is one of the
> problems that we have encountered in earlier attempts to fix this bug. 'char
> alignas (8)' avoids this problem.

I don't follow: the natural alignment for `char` is definitely less than
8, so if "'alignas (8)' is an error when the natural alignment of the
object is less than 8", how can "char alignas (8)" avoid the problem?


It's the other way round: alignas(8) is an error when the natural alignment of the object is *greater* than 8.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]