H
Hallvard B Furuseth
Harald said:I agree with Hallvard's reply to this, but would like to try expressing
this in a slightly different way: 7.20.3p1 does apply. It gives
implementations permission to unconditionally fail to realloc to 0 bytes.
I think that means you don't agree
7.20.3p1's NULL is success return, while 7.20.3.4's is failure return.
On success return, the old object it deallocated. On failure return it
is not. Which is why realloc(non-null, 0) isn't allowed both - we
couldn't tell success from failure.
In any case, what matters for programming is that it's safest and
simplest to avoid realloc(non-null, 0).