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: [PATCH] make obstack object allocators more type-safe


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


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