3 ms·
> The idea that C89 did not mandate this makes sense to me because I remember now-obsolete Unixes not liking this either. C89 did mandate this: > If ptr is a
by masklinn 11y ago
> The idea that C89 did not mandate this makes sense to me because I remember now-obsolete Unixes not liking this either.
C89 did mandate this:
> If ptr is a null pointer, the realloc function behaves like the malloc function for the specified size.
C89 also mandated that realloc(ptr, 0) be equivalent to free(ptr), which was removed in C99:
> If size is zero and ptr is not a null pointer, the object it points to is freed.