From: Tom Tromey <tromey@redhat.com>
To: Greg Watson <g.watson@computer.org>
Cc: gdb-patches@sourceware.org
Subject: Re: Improve handling of Fortran keywords
Date: Wed, 15 Dec 2010 19:28:00 -0000 [thread overview]
Message-ID: <m3mxo6n8e2.fsf@fleche.redhat.com> (raw)
In-Reply-To: <9574F1C6-076E-44C8-A487-D97CA5088D54@computer.org> (Greg Watson's message of "Wed, 15 Dec 2010 13:51:55 -0500")
>>>>> "Greg" == Greg Watson <g.watson@computer.org> writes:
Greg> Nope, this is not going to work. If the identifier being printed
Greg> is shorter than the keyword, they will match. You really have to
Greg> check the length as well.
Oops, duh.
Greg> If you want to use namelen, then I think this is the minimum
Greg> required change.
Thanks.
I am checking it in. Here is the final patch with ChangeLog entry.
Tom
2010-12-15 Greg Watson <g.watson@computer.org>
* f-exp.y (yylex): Check entire token against keywords.
Index: f-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/f-exp.y,v
retrieving revision 1.33
diff -u -r1.33 f-exp.y
--- f-exp.y 2 Jun 2010 22:41:55 -0000 1.33
+++ f-exp.y 15 Dec 2010 19:20:18 -0000
@@ -1150,8 +1150,8 @@
/* Catch specific keywords. */
for (i = 0; f77_keywords[i].operator != NULL; i++)
- if (strncmp (tokstart, f77_keywords[i].operator,
- strlen(f77_keywords[i].operator)) == 0)
+ if (strlen (f77_keywords[i].operator) == namelen
+ && strncmp (tokstart, f77_keywords[i].operator, namelen) == 0)
{
/* lexptr += strlen(f77_keywords[i].operator); */
yylval.opcode = f77_keywords[i].opcode;
prev parent reply other threads:[~2010-12-15 19:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-14 16:18 Greg Watson
2010-12-14 17:41 ` Tom Tromey
2010-12-15 18:52 ` Greg Watson
2010-12-15 19:28 ` Tom Tromey [this message]
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=m3mxo6n8e2.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=g.watson@computer.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