On Wed, 21 Sep 2016, John David Anglin wrote: > The alignment of 16 arises in code that used the ldcw instruction. > Although this could be avoided in glibc there are numerous other > packages with objects requiring 16-byte alignment. So, I'm tending > to think the typedef for max_align_t should be adjusted on hppa-linux > so that it has 16-byte alignment. Is that the correct approach?
The ISO C rule (given the fix to DR#445) is that max_align_t must be at least as aligned as, inter alia, "all types specified in clause 7 as complete object types". The idea is that it must be at least as aligned as any type the user can define using only standard features other than _Alignas. It would seem reasonable for it to be at least as aligned as POSIX types as well, in cases where POSIX types have greater alignment requirements than ISO C types; clearly malloc needs to return memory sufficiently aligned for POSIX types (because POSIX inherits from C99, where malloc has the "any type of object" wording). It's vector types we want to avoid contributing to max_align_t alignment. -- Joseph S. Myers jos...@codesourcery.com