3 ms·
As a data point, C23 added explicit wording about overflow handling in calloc(): > The calloc function returns […] a null pointer […] if the mathematical produ
by jwilk 4y ago
As a data point, C23 added explicit wording about overflow handling in calloc():
> The calloc function returns […] a null pointer […] if the mathematical product of nmemb * size is not representable as a value of type size_t.
So apparently the Committee is OK with allocating more than SIZE_MAX/2 (but not more than SIZE_MAX).