This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/ARI fix] Remove use of abort function in common/buffer.c
- From: Pedro Alves <palves at redhat dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 22 May 2012 10:34:19 +0100
- Subject: Re: [RFA/ARI fix] Remove use of abort function in common/buffer.c
- References: <4fbb59b7.44e2440a.48c4.ffffab13SMTPIN_ADDED@mx.google.com>
On 05/22/2012 10:17 AM, Pierre Muller wrote:
> ARI clearly states that abort function
> should never be used, and to use internal_error
> instead.
>
> I first suspected that this was related to missing declarations in
> common directory, but internal_error does
> exist there also.
>
> Finally, looking at common/buffer.c source, I found that
> gdb_assert was probably a better fit here
> (the macro does call internal_error).
>
>
> Is this patch OK or what else should we use here?
We should just remove the abort; it's dead code. xrealloc already handles
that for us. common/common-utils.c:xrealloc:
...
/* (...) It never returns NULL. */
...
if (val == NULL)
malloc_failure (size);
return val;
}
--
Pedro Alves