This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH v2] Catch exception in value_rtti_indirect_type
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: Pedro Alves <palves at redhat dot com>, <gdb-patches at sourceware dot org>
- Cc: <simon dot marchi at polymtl dot ca>
- Date: Fri, 23 Jan 2015 13:00:02 -0500
- Subject: Re: [PATCH v2] Catch exception in value_rtti_indirect_type
- Authentication-results: sourceware.org; auth=none
- References: <1411174953-8930-1-git-send-email-simon dot marchi at ericsson dot com> <54809E38 dot 3080606 at redhat dot com> <54821670 dot 6020006 at ericsson dot com> <54C23FB2 dot 90300 at redhat dot com> <54C27035 dot 5030205 at ericsson dot com> <54C27B67 dot 3000209 at redhat dot com>
On 15-01-23 11:48 AM, Pedro Alves wrote:
> 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.
> Pedro Alves