* patch - fix false keyword triggering in gas with cgen targets
[not found] <0eee01c2a6cc$0d5d4230$f601a8c0@nkelseyxp>
@ 2002-12-18 12:47 ` Doug Evans
0 siblings, 0 replies; only message in thread
From: Doug Evans @ 2002-12-18 12:47 UTC (permalink / raw)
To: Nick Kelsey; +Cc: binutils, cgen
Nick Kelsey writes:
> Hi all,
>
> Attached is patch to fix flase keyword triggering in gas with symbols such
> as <register name>_foo.
An equivalent solution is to move the '_' to desc.scm and either
make it a default nonalpha_char or hardcode it as always being
a nonalpha_char.
However, I like changing cgen-asm.c better. '_' is typically a
legit symbol char so better to bubble it up to the top and treat
it like alnum's.
I'm assuming of course this doesn't break existing ports.
Given that the '_' was there for a long time I think it is
a safe assumption, but still an assumption nonetheless.
If down the road we ever have to revisit this decision we
can move '_' to desc.scm and make it the default.
---
Nit though. GNU coding standard say the || goes at the beginning
of the next line. The way I remember this is that English reads as
"if foo, or bar, or baz"
not
"if foo or, bar or, baz"
*** cgen-asm.c 26 Nov 2002 18:12:48 -0000
--- cgen-asm.c 18 Dec 2002 02:16:00 -0000
*************** cgen_parse_keyword (cd, strp, keyword_ta
*** 225,231 ****
/* Allow letters, digits, and any special characters. */
while (((p - start) < (int) sizeof (buf))
&& *p
! && (ISALNUM (*p) || strchr (keyword_table->nonalpha_chars, *p)))
++p;
if (p - start >= (int) sizeof (buf))
--- 225,233 ----
/* Allow letters, digits, and any special characters. */
while (((p - start) < (int) sizeof (buf))
&& *p
! && (ISALNUM (*p) ||
! strchr (keyword_table->nonalpha_chars, *p) ||
! *p == '_'))
++p;
if (p - start >= (int) sizeof (buf))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-12-18 20:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <0eee01c2a6cc$0d5d4230$f601a8c0@nkelseyxp>
2002-12-18 12:47 ` patch - fix false keyword triggering in gas with cgen targets Doug Evans
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).