Stefan Monnier 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.