This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] make obstack object allocators more type-safe
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>, gdb-patches at sourceware dot org
- Date: Mon, 16 Jun 2014 15:15:47 +0100
- Subject: Re: [PATCH] make obstack object allocators more type-safe
- Authentication-results: sourceware.org; auth=none
- References: <1402686633-7872-1-git-send-email-tromey at redhat dot com>
On 06/13/2014 08:10 PM, Tom Tromey wrote:
> This changes OBSTACK_ZALLOC and OBSTACK_CALLOC to cast their value to
> the correct type. This is more type-safe and also is more in line
> with the other object-allocation macros in libiberty.h.
>
> Making this change revealed one trivial error in dwarf2read.c.
> On the whole that seems pretty good to me.
Agreed.
>
> Tested by rebuilding.
>
> 2014-06-13 Tom Tromey <tromey@redhat.com>
>
> * dwarf2read.c (dw2_get_real_path): Use correct type in
> OBSTACK_CALLOC.
> * gdb_obstack.h (OBSTACK_ZALLOC, OBSTACK_CALLOC): Cast result.
Looks fine to me ...
--
Pedro Alves