* * linespec.c (decode_dollar): Avoid "may be used uninitialized" warning.
@ 2011-12-06 19:56 Doug Evans
2011-12-06 20:08 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Doug Evans @ 2011-12-06 19:56 UTC (permalink / raw)
To: tromey; +Cc: gdb-patches
Hi. I'm not sure how you want to fix this.
cc1: warnings being treated as errors
../../src/gdb/linespec.c: In function 'decode_dollar':
../../src/gdb/linespec.c:2549: error: 'values.nelts' may be used uninitialized in this function
../../src/gdb/linespec.c:2549: error: 'values.sals' may be used uninitialized in this function
make[2]: *** [linespec.o] Error 1
2011-12-06 Doug Evans <dje@google.com>
* linespec.c (decode_dollar): Avoid "may be used uninitialized" warning.
Index: linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.132
diff -u -p -r1.132 linespec.c
--- linespec.c 6 Dec 2011 18:54:39 -0000 1.132
+++ linespec.c 6 Dec 2011 19:31:19 -0000
@@ -2494,6 +2494,10 @@ decode_dollar (struct linespec_state *se
volatile struct gdb_exception exc;
+ /* Avoid "may be used uninitialized" warning. */
+ values.sals = NULL;
+ values.nelts = 0;
+
TRY_CATCH (exc, RETURN_MASK_ERROR)
{
values = decode_variable (self, copy);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-06 19:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-06 19:56 * linespec.c (decode_dollar): Avoid "may be used uninitialized" warning Doug Evans
2011-12-06 20:08 ` Tom Tromey
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).