realloc

Antoine Verheijen antoine at alberta.UUCP
Sat Apr 1 09:33:59 AEST 1989


In article <9122 at alice.UUCP> andrew at alice.UUCP (Andrew Hume) writes:
>
>
>gregg townsend reminds us of the pANS ``feature'' that malloc(0) returns NULL.
>can anyone provide the (or any) justification of this pointless stupid
>definition? i just love the idea that an initialised pointer is SOMETIMES
>indistinguishable from an uninitialised pointer.


Please note that a NULL pointer is not (necessarily) the same thing as an
uninitialized pointer. NULL is a very specific and legitimate value for
a pointer whereas an uninitialized pointer is, by definition, unpredictable,
its value usually being dependent on the system you're running under (unless
I've missed something new in the standard).



More information about the Comp.lang.c mailing list