[commit] [msys+mingw] build error [-Werror=uninitialized]

Jan Kratochvil
2012-03-16T08:19:47Z

On Fri, 16 Mar 2012 08:44:37 +0100, Yao Qi wrote:
> On 03/16/2012 03:31 PM, asmwarrior wrote:
> > TRY_CATCH (ex, RETURN_MASK_ERROR)
> > {
> > addr = value_as_address (vfn);
> > }
> > Which means addr is set before passed to print_function_pointer_address() call.
> >
> > So I'm not sure why gcc report such warning.
>
> No idea on this. Patch below fixes the problem on my box.

Added there a comment like in other cases.

This improper warning happens with TRY_CATCH on older gccs.

Thanks,
Jan

http://sourceware.org/ml/gdb-cvs/2012-03/msg00203.html

--- src/gdb/ChangeLog 2012/03/15 18:53:42 1.14016
+++ src/gdb/ChangeLog 2012/03/16 08:18:07 1.14017
@@ -1,3 +1,9 @@
+2012-03-16 Yao Qi <yao@codesourcery.com>
+ Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix false compilation warning.
+ * gnu-v3-abi.c (print_one_vtable): Initialize ADDR.
+
2012-03-15 Jonathan Larmour <jifl@eCosCentric.com>
Pedro Alves <pedro@codesourcery.com>

--- src/gdb/gnu-v3-abi.c 2012/03/15 15:43:11 1.70
+++ src/gdb/gnu-v3-abi.c 2012/03/16 08:18:09 1.71
@@ -869,8 +869,9 @@

for (i = 0; i <= max_voffset; ++i)
{
+ /* Initialize it just to avoid a GCC false warning. */
+ CORE_ADDR addr = 0;
struct value *vfn;
- CORE_ADDR addr;
volatile struct gdb_exception ex;

printf_filtered ("[%d]: ", i);