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 v2] Catch exception in value_rtti_indirect_type


On 01/23/2015 04:00 PM, Simon Marchi wrote:

> Hmm I am now getting a
> 
> /home/emaisin/src/binutils-gdb/gdb/valops.c:3625:13: error: âtargetâ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>    real_type = value_rtti_type (target, full, top, using_enc);
> 
> Logically, target can't be uninitialized there because of the exception throw. I would expect gcc to be
> smarter about it, since throw_error is marked as noreturn. I can obviously fix it by assigning it to NULL
> at declaration time, but is there a better way of getting rid of the error in these cases?

Bah.  Yeah, initializing as NULL is fine.

Thanks,
Pedro Alves


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