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/ARI fix] Remove use of abort function in common/buffer.c


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


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