[commit] Fix build failure in skip.c

Ulrich Weigand uweigand@de.ibm.com
Wed Nov 16 18:32:00 GMT 2011


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



More information about the Gdb-patches mailing list