Paul Eggert wrote: > Come to think of it, I suppose we should change xalloc_oversized to > report an overflow if the resulting size would be greater than > PTRDIFF_MAX. That should catch more potential problems in Gnulib and in > Gnulib-using code. > ... > Here is an example of why arrays larger than PTRDIFF_MAX bytes can cause > real problems.
So, an attempt to allocate a memory chunk of 2.5 GB size on 32-bit Linux/x86 is ill-fated already? That is, SIZE_MAX = 4 GB - 1 gives us a fake illusion that allocations > 2 GB would be OK, and in fact they are not OK, so it's in fact ssize_t or ptrdiff_t that matters?! Bruno