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

--- Comment #9 from Martin Uecker <muecker at gwdg dot de> ---
(In reply to jos...@codesourcery.com from comment #7)
> I believe "size requested" refers to the product nmemb * size in the case 
> of calloc, so getting the arguments the "wrong" way round does not affect 
> the required alignment.  The point of the change was to override DR#075 
> and stop requiring e.g. 1-byte allocations to be suitably aligned for 
> larger types, not to make alignment for calloc depend on more than the 
> product of the two arguments.

This may have been the intention but the wording now refers explicitly to the
size.
To me this also makes sense as calloc talks about allocating an array of
objects of size 'size'. The required alignment of the array would not depend on
the number of elements but only their size.

Reply via email to