Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>,
	       gdb-patches@sourceware.org
Subject: Re: [RFA-v2/ARI fix] Remove use of abort function in common/buffer.c
Date: Tue, 22 May 2012 12:39:00 -0000	[thread overview]
Message-ID: <4FBB88C5.6070900@redhat.com> (raw)
In-Reply-To: <20120522121832.GC5492@adacore.com>

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


  reply	other threads:[~2012-05-22 12:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4fbb59b7.44e2440a.48c4.ffffab13SMTPIN_ADDED@mx.google.com>
2012-05-22  9:34 ` [RFA/ARI " Pedro Alves
2012-05-22 12:05   ` [RFA-v2/ARI " Pierre Muller
2012-05-22 12:18     ` Joel Brobecker
2012-05-22 12:39       ` Pedro Alves [this message]
2012-05-22 15:15         ` [RFA-v3/ARI " Pierre Muller
2012-05-22 15:18           ` Pedro Alves
2012-05-22 15:57             ` Pierre Muller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FBB88C5.6070900@redhat.com \
    --to=palves@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox