* [commit] fix gcc warnings
@ 2012-01-09 22:33 Doug Evans
0 siblings, 0 replies; only message in thread
From: Doug Evans @ 2012-01-09 22:33 UTC (permalink / raw)
To: gdb-patches
Hi.
Simple fix to avoid some gcc warnings.
cc1: warnings being treated as errors
../../src/gdb/gdbtypes.c: In function 'safe_parse_type':
../../src/gdb/gdbtypes.c:1698: error: 'type' may be used uninitialized in this function
cc1: warnings being treated as errors
../../src/gdb/varobj.c: In function 'varobj_set_value':
../../src/gdb/varobj.c:1420: error: 'val' may be used uninitialized in this function
../../src/gdb/varobj.c:1402: error: 'value' may be used uninitialized in this function
2012-01-09 Doug Evans <dje@google.com>
* gdbtypes.c (safe_parse_type): Initialize type to keep gcc happy.
* varobj.c (varobj_set_value): Initialize val,value to keep gcc happy.
Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.224
diff -u -p -r1.224 gdbtypes.c
--- gdbtypes.c 9 Jan 2012 20:27:48 -0000 1.224
+++ gdbtypes.c 9 Jan 2012 22:29:19 -0000
@@ -1674,7 +1674,7 @@ static struct type *
safe_parse_type (struct gdbarch *gdbarch, char *p, int length)
{
struct ui_file *saved_gdb_stderr;
- struct type *type;
+ struct type *type = NULL; /* Initialize to keep gcc happy. */
volatile struct gdb_exception except;
/* Suppress error messages. */
Index: varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/varobj.c,v
retrieving revision 1.186
diff -u -p -r1.186 varobj.c
--- varobj.c 9 Jan 2012 20:27:49 -0000 1.186
+++ varobj.c 9 Jan 2012 22:29:19 -0000
@@ -1359,13 +1359,12 @@ varobj_get_value (struct varobj *var)
int
varobj_set_value (struct varobj *var, char *expression)
{
- struct value *val;
-
+ struct value *val = NULL; /* Initialize to keep gcc happy. */
/* The argument "expression" contains the variable's new value.
We need to first construct a legal expression for this -- ugh! */
/* Does this cover all the bases? */
struct expression *exp;
- struct value *value;
+ struct value *value = NULL; /* Initialize to keep gcc happy. */
int saved_input_radix = input_radix;
char *s = expression;
volatile struct gdb_exception except;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-01-09 22:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-09 22:33 [commit] fix gcc warnings Doug Evans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).