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, Dec 30, 2012 at 6:23 PM, Valeriy E. Ushakov 
<uwe%stderr.spb.ru@localhost> wrote:
> 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.
>

Yes, sorry, I should start using a proper email client :P

But I guess, overall the consensus is that this should be documented
in the man page? The actual language/wordings to be used can be
changed later on. I can open a PR for this.

--
Abhinav


Home | Main Index | Thread Index | Old Index