On Tue, Oct 11, 2016 at 2:59 PM, DJ Delorie <d...@redhat.com> wrote: > > Jason Merrill <ja...@redhat.com> writes: >> If PA malloc doesn't actually provide 16-byte alignment, this change >> seems problematic; it will mean any type that wants 16-byte alignment >> will silently get 8-byte alignment instead. > > Should such cases be calling memalign (or posix_memalign) instead of > malloc?
We're talking about this in the context of C++17 aligned new, which uses one of those functions (or C aligned_alloc) under the hood. Currently on PA, allocating one of these types with 'new' in C++14 mode gives a warning because the compiler doesn't think the allocation will actually provide the 16-byte alignment that the type wants. This warning seems to be correct. This patch would silence that warning by pretending that malloc will provide 16-byte alignment, which is not actually true. It seems to me that the warning is correct, but not a problem in this case, so perhaps turning the warning off by default on PA is the right solution. Jason