https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112364

--- Comment #3 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Martin Uecker from comment #2)
> I don't think this is correct.  The requirement is "The pointer returned if
> the allocation succeeds is suitably aligned so that it may be assigned to a
> pointer to any type of object with a fundamental alignment requirement and
> size less than or equal to the size requested."
> 
> So it only has to take into account fundamental alignments for objects below
> the given size and the fundamental alignment requirement differs for
> different objects. Note that there is no "fundamental alignment". 
> max_align_t would have the "greatest fundamental alignment", but the wording
> for allocation functions does not refer to the greatest fundamental
> alignment.

Hmm, the "and size less than or equal to the size requested" clause does not
exist in N1570 (C11), but it does exist in N3054 (C2x).  It looks like a subtly
backward-incompatible change in the standard...

Reply via email to