This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Fix build failure in skip.c
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 16 Nov 2011 19:32:33 +0100 (CET)
- Subject: [commit] Fix build failure in skip.c
Hello,
I'm getting build failures in skip.c due to "uninitialized variable"
warnings caused by older compilers for TRY_CATCH blocks in some cases.
The patch below fixes this in the same way this very same problem was
fixed elsewhere, by just adding initialiers.
Tested on spu-elf, committed to mainline.
Bye,
Ulrich
ChangeLog:
* skip.c (skip_function_command): Work around uninitialized
variable warning.
Index: gdb/skip.c
===================================================================
RCS file: /cvs/src/src/gdb/skip.c,v
retrieving revision 1.1
diff -u -p -r1.1 skip.c
--- gdb/skip.c 1 Nov 2011 14:51:21 -0000 1.1
+++ gdb/skip.c 16 Nov 2011 18:25:28 -0000
@@ -160,7 +160,7 @@ skip_function_command (char *arg, int fr
int pending = 0;
char *orig_arg = arg; /* decode_line_1 modifies the arg pointer. */
volatile struct gdb_exception decode_exception;
- struct symtabs_and_lines sals;
+ struct symtabs_and_lines sals = { 0 };
TRY_CATCH (decode_exception, RETURN_MASK_ERROR)
{
@@ -509,7 +509,7 @@ skip_re_set (void)
else if (e->function_name != 0)
{
char *func_name = e->function_name;
- struct symtabs_and_lines sals;
+ struct symtabs_and_lines sals = { 0 };
volatile struct gdb_exception decode_exception;
TRY_CATCH (decode_exception, RETURN_MASK_ERROR)
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com