This is the mail archive of the
mailing list for the GCC project.
Re: max_align_t definition
- From: Florian Weimer <fweimer at redhat dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Thu, 09 Apr 2015 14:36:01 +0200
- Subject: Re: max_align_t definition
- 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> <alpine dot DEB dot 2 dot 10 dot 1504021640470 dot 408 at digraph dot polyomino dot org dot uk> <55264E4A dot 3000905 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1504091225570 dot 4346 at digraph dot polyomino dot org dot uk>
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)?
Florian Weimer / Red Hat Product Security