From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sourceware.org
Cc: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
Subject: Re: Committed, MAINTAINERS, sim/cris: Fix make -j race and mark cris-elf as non-broken, cp-name-parser.y
Date: Sat, 28 May 2005 18:07:00 -0000 [thread overview]
Message-ID: <20050528164959.GB26806@nevyn.them.org> (raw)
In-Reply-To: <20050528142226.GA5901@nevyn.them.org>
On Sat, May 28, 2005 at 10:22:27AM -0400, Daniel Jacobowitz wrote:
> On Sat, May 28, 2005 at 10:58:31AM +0200, Hans-Peter Nilsson wrote:
> > cc1: warnings being treated as errors
> > cp-name-parser.y: In function 'parse_escape':
> > cp-name-parser.y:1443: warning: 'target_char' may be used
> > uninitialized in this function
> >
> > in the gdb directory. I looked at that problem and concluded
> > the patch to cp-name-parser.y as an obvious fix. The warning
> > came from gcc-4.0.0-2 and looks correct; the c_parse_backslash
> > is a static function and apparently the code *has* that problem;
> > it's not a false positive. It takes two looks. Then I ran into:
>
> Maybe it takes three? Your patch is incorrect, since it is covering up
> a real problem. It ought to be "return c".
Like so. Checked with GCC 4.1.0 20050508 and committed.
--
Daniel Jacobowitz
CodeSourcery, LLC
2005-05-28 Daniel Jacobowitz <dan@codesourcery.com>
* cp-name-parser.y (parse_escape): Revert previous change. Return
the input character by default.
Index: cp-name-parser.y
===================================================================
RCS file: /cvs/src/src/gdb/cp-name-parser.y,v
retrieving revision 1.2
diff -u -p -r1.2 cp-name-parser.y
--- cp-name-parser.y 28 May 2005 08:49:13 -0000 1.2
+++ cp-name-parser.y 28 May 2005 16:47:46 -0000
@@ -1440,7 +1440,7 @@ c_parse_backslash (int host_char, int *t
static int
parse_escape (const char **string_ptr)
{
- int target_char = 0;
+ int target_char;
int c = *(*string_ptr)++;
if (c_parse_backslash (c, &target_char))
return target_char;
@@ -1498,7 +1498,7 @@ parse_escape (const char **string_ptr)
return i;
}
default:
- return target_char;
+ return c;
}
}
next prev parent reply other threads:[~2005-05-28 16:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-28 16:44 Hans-Peter Nilsson
2005-05-28 16:50 ` Daniel Jacobowitz
2005-05-28 18:07 ` Daniel Jacobowitz [this message]
2005-05-28 18:28 ` cp-name-parser.y Hans-Peter Nilsson
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=20050528164959.GB26806@nevyn.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=hans-peter.nilsson@axis.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