max_align_t definition
Joseph Myers
joseph@codesourcery.com
Thu Apr 9 17:14:00 GMT 2015
On Thu, 9 Apr 2015, Florian Weimer wrote:
> On 04/09/2015 02:31 PM, Joseph Myers wrote:
>
> > It's C90 DR#075 that requires malloc (1) to return a pointer suitably
> > aligned for all types (including long double). (That is, all types that
> > can be defined using C90 standard syntax.)
> >
> >> Before C11, this was perfectly conforming. I doubt it was the intention
> >
> > No, it was never conforming for malloc (1) to return memory not aligned
> > for long double.
>
> Why is that so? Is the argument that the result of malloc (1) could be
> used to store a zero-length array of arbitrarily large objects (such as
> long double, whose size is almost certainly larger than 1)?
1993 predates most WG14 documents being online, so I don't know what
rationale there might be beyond a straight interpretation of the standard
text.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Gcc
mailing list