tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Return Value of realloc(3)

On Sun, 30 Dec 2012, Abhinav Upadhyay wrote:
My point was that we should document this exact behaviour as mentioned
in the standards.
"If size is 0, either NULL or a unique pointer that can be
successfully passed to free(3) is returned."

I agree. And we might as well also document what happens when zero is passed to malloc or calloc.

If we also document which of the two behaviours is used by NetBSD, then we should be careful not to encourage callers to reply on that implementation decision, because it may change in the future while remaining compatible with relevant standards.

--apb (Alan Barrett)

Home | Main Index | Thread Index | Old Index