[TUHS] Minimum Array Sizes in 16 bit C (was Maximum)

Ralph Corderoy ralph at inputplus.co.uk
Sun Sep 29 20:06:11 AEST 2024


Hi Werner,

> > I got two letters back, saying that malloc(0) is illegal because
> > zero-length arrays are illegal, and the other vice versa.
>
> And now we have zero length arrays an UB malloc(0).

malloc(0) isn't undefined behaviour but implementation defined.

Are there prominent modern implementations which consider it an error so
return NULL?

-- 
Cheers, Ralph.


More information about the TUHS mailing list