This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

patch - fix false keyword triggering in gas with cgen targets


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))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]