This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA-v2/ARI fix] Remove use of abort function in common/buffer.c


On 05/22/2012 01:18 PM, Joel Brobecker wrote:

> Hi Pierre, Hi Pedro,
> 
> Thanks for taking care of this, Pierre.
> 
>> +  /* new_buffer is non NULL otherwise
>> +     xrealloc calls malloc_failure which does not return here.  */
> 
> I suggest a slightly different way of saying this:
> 
>     /* xrealloc guaranties that new_buffer cannot be null.  */
> 
> It avoids the problem with the location of the line break and any issue
> with punctuation...
> 


Fine with me, but I'd suggest to just say nothing.  The whole point of the xrealloc,
xmalloc, etc. functions is to abort on failure instead of returning NULL.  We have
about 150 or so xrealloc calls in the tree, about 70 xcalloc calls, and
about 700 xmalloc calls.  We don't put just comment on most (any?) of those, and
I don't see what makes this particular instance special.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]