This is the mail archive of the
mailing list for the GCC project.
Re: x86_64: Should the -mavx* options affected __alignof__ (max_align_t)?
- From: Andrew Haley <aph at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>, Joseph Myers <joseph at codesourcery dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, GCC <gcc at gcc dot gnu dot org>
- Date: Thu, 02 Apr 2015 13:38:59 +0100
- Subject: Re: x86_64: Should the -mavx* options affected __alignof__ (max_align_t)?
- Authentication-results: sourceware.org; auth=none
- References: <55105B5B dot 50107 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1503231831300 dot 14930 at digraph dot polyomino dot org dot uk> <55105E53 dot 8020002 at redhat dot com> <551CFD38 dot 9040200 at redhat dot com> <551D0060 dot 1020805 at redhat dot com> <551D01E5 dot 9070405 at redhat dot com> <CAMe9rOoxjp1TFUgg493r_1LT9S9ZH=1D-+riO3f32A_WqcYN3A at mail dot gmail dot com> <551D2319 dot 4010905 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1504021132050 dot 32247 at digraph dot polyomino dot org dot uk> <551D2B60 dot 4030807 at redhat dot com>
On 04/02/2015 12:43 PM, Florian Weimer wrote:
> But it is dubious to require that, say, strdup ("example") returns a
> pointer which is 16-byte-aligned, too.
> What is missing, it seems to me, is the qualification that for the
> pointer returned by malloc, the alignment requirements only of those
> types whose size does not exceed the malloc argument argument need to be
I'm trying to guess how you'd write a strictly-conforming program that
could tell the difference. (Casting to an integer and looking at the
low-order bits doesn't count because the mapping from a pointer to an
integer is not well-defined.)