tech-userlevel archive

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

Re: Return Value of realloc(3)



Abhinav Upadhyay <er.abhinav.upadhyay%gmail.com@localhost> wrote:

> On Sun, Dec 30, 2012 at 5:46 AM, Valeriy E. Ushakov 
> <uwe%stderr.spb.ru@localhost> wrote:
>>> If this is the case, then I think it should be clearly documented in
>>> the man page.
>>
>> Why?  Programs should not depend on that.  [...]
>
> 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."

Well, you don't mark your attachments as text, so they are not
immediately readable without an extra effort :), and the text of the
message was:

| it appears that on NetBSD it is the latter case. Is this correct?
| If this is the case, then I think it should be clearly documented in
| the man page. FWIW on GNU/Linux, it appears that the default bevahiour
| is to return NULL in case the requested size is 0 bytes (and it is
| documented).

which says that Linux documents its specific behaviour (returning
null) and that NetBSD also should document its specific behaviour
(returning non-null).  I was replying to that.

-uwe



Home | Main Index | Thread Index | Old Index