BUG: realloc(p,0) should be consistent with malloc(0)
Andreas Schwab
schwab@suse.de
Wed Jun 18 15:42:40 GMT 2025
On Jun 17 2025, Alejandro Colomar wrote:
> RETURN VALUE
>
> If size is 0,
> ...
> either:
>
> - A null pointer shall be returned
> and, if ptr is not a null pointer,
> errno shall be set to EINVAL.
>
> - A pointer to the allocated space shall be returned,
> and the memory object pointed to by ptr shall be freed.
> ...
>
Note that all of this is marked obsolescent.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
More information about the Libc-alpha
mailing list