On 4/18/21 5:13 AM, Bruno Haible wrote:
How about extending the unit test (tests/test-malloc-gnu.c) accordingly?
Won't that raise the possibility of the tests being too expensive, in case the C library actually attempts to allocate PTRDIFF_MAX + 1 bytes? (I'm looking at you, 64-bit Hurd. :-)
I see we're already doing something similar with size_t in test-reallocarray.c but I suspect that test isn't often run because reallocarray isn't much used yet. Plus, that test won't use up much resources even on typical buggy hosts, because size_t overflow wraps around.