Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [obv] varobj.c: Fix GCC false warning
@ 2010-10-17  8:45 Jan Kratochvil
  2010-10-17 10:02 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2010-10-17  8:45 UTC (permalink / raw)
  To: gdb-patches

Hi,

CFLAGS=-O0 ./configure --without-python; make
varobj.c: In function ‘value_get_print_value’:
varobj.c:2578:22: error: ‘str_addr’ may be used uninitialized in this function

Reproducible with FSF GCC 4.4, 4.5, HEAD.

Checked in.


Thanks,
Jan


http://sourceware.org/ml/gdb-cvs/2010-10/msg00100.html

--- src/gdb/ChangeLog	2010/10/15 23:08:04	1.12264
+++ src/gdb/ChangeLog	2010/10/17 08:43:45	1.12265
@@ -1,3 +1,8 @@
+2010-10-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Fix GCC false warning.
+	* varobj.c (value_get_print_value) <str_addr>: Initialize it.
+
 2010-10-16  Pierre Muller  <muller@ics.u-strasbg.fr>
 
 	* p-typeprint.c (pascal_type_print_method_args): Fix problem in
--- src/gdb/varobj.c	2010/10/15 18:54:13	1.162
+++ src/gdb/varobj.c	2010/10/17 08:43:46	1.163
@@ -2486,7 +2486,8 @@
   long len = 0;
   char *encoding = NULL;
   struct gdbarch *gdbarch = NULL;
-  CORE_ADDR str_addr;
+  /* Initialize it just to avoid a GCC false warning.  */
+  CORE_ADDR str_addr = 0;
   int string_print = 0;
 
   if (value == NULL)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-17 11:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-17  8:45 [obv] varobj.c: Fix GCC false warning Jan Kratochvil
2010-10-17 10:02 ` Andreas Schwab
2010-10-17 11:54   ` [patch] varobj.c: Reset string_print [Re: [obv] varobj.c: Fix GCC false warning] Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox