From: Eli Zaretskii <eliz@gnu.org>
To: gdb-patches@sourceware.org
Subject: [RFA] Fix compilation failure in parse_escape
Date: Wed, 15 Apr 2009 18:48:00 -0000 [thread overview]
Message-ID: <83prfdlpqg.fsf@gnu.org> (raw)
Today's snapshot fails to compile:
gcc -g -O2 -I. -I.././gdb -I.././gdb/common -I.././gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I.././gdb/../include/opcode -I.././gdb/../readline/.. -I../bfd -I.././gdb/../bfd -I.././gdb/../include -I../libdecnumber -I.././gdb/../libdecnumber -I.././gdb/gnulib -Ignulib -DMI_OUT=1 -DTUI=1 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wno-switch -Wno-char-subscripts -Werror -c -o utils.o -MT utils.o -MMD -MP -MF .deps/utils.Tpo utils.c
cc1: warnings being treated as errors
utils.c: In function 'parse_escape':
utils.c:1621: warning: 'target_char' may be used uninitialized in this function
make[2]: *** [utils.o] Error 1
I think this happens because host_char_to_target sets its target_c
argument only under certain conditions. Is the following patch the
right fix?
2009-04-15 Eli Zaretskii <eliz@gnu.org>
* utils.c (parse_escape): Initialize target_char to pacify GCC.
Index: gdb/utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.208
diff -u -r1.208 utils.c
--- gdb/utils.c 20 Mar 2009 23:04:34 -0000 1.208
+++ gdb/utils.c 15 Apr 2009 18:45:02 -0000
@@ -1618,7 +1618,7 @@
int
parse_escape (char **string_ptr)
{
- int target_char;
+ int target_char = -2;
int c = *(*string_ptr)++;
switch (c)
{
next reply other threads:[~2009-04-15 18:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-15 18:48 Eli Zaretskii [this message]
2009-04-15 19:18 ` Tom Tromey
2009-04-15 20:42 ` Eli Zaretskii
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=83prfdlpqg.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/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