From 1da03605ced73fc20f40ad649f3038e654d36dee Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Mon, 3 Aug 2015 14:35:58 +0200 Subject: Fix build error due to uninitialized variable warning As of commit a5fdf78a4402341a0ae23a5ca8a63825e2b5286c, building GDB with a GCC 4.1 host compiler fails with: gdb/cp-namespace.c: In function 'cp_lookup_symbol_via_imports': gdb/cp-namespace.c:482: warning: 'sym.block' may be used uninitialized in this function Apparently, more recent compilers are able to deduce that no actual uninitialized use of sym.block takes place, but GCC 4.1 isn't yet able to do that. Fixed by adding an explicit initalization. gdb/ * cp-namespace.c (cp_lookup_symbol_via_imports): Fix uninitialized variable warning with some compilers. --- gdb/cp-namespace.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gdb/cp-namespace.c') diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index aa29c920e11..f5f4bad878d 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -485,6 +485,7 @@ cp_lookup_symbol_via_imports (const char *scope, struct cleanup *searched_cleanup; sym.symbol = NULL; + sym.block = NULL; /* First, try to find the symbol in the given namespace if requested. */ if (search_scope_first) -- cgit v1.2.1