From: dje@google.com (Doug Evans)
To: tromey@redhat.com
Cc: gdb-patches@sourceware.org
Subject: * linespec.c (decode_dollar): Avoid "may be used uninitialized" warning.
Date: Tue, 06 Dec 2011 19:56:00 -0000 [thread overview]
Message-ID: <20111206193317.5CEAF2461D7@ruffy.mtv.corp.google.com> (raw)
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);
next reply other threads:[~2011-12-06 19:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-06 19:56 Doug Evans [this message]
2011-12-06 20:08 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111206193317.5CEAF2461D7@ruffy.mtv.corp.google.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox