[binutils-gdb] gas: ignore ONLY_STANDARD_ESCAPES in scrubber

Jan Beulich via Binutils-cvs <[email protected]> Fri, 17 Jul 2026 07:25:45 +0000 (GMT)
Newsgroups gmane.comp.gnu.binutils.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D2792bbd8b98e=
205716ddda02b690cc067313e71a

commit 2792bbd8b98e205716ddda02b690cc067313e71a
Author: Jan Beulich <[email protected]>
Date:   Fri Jul 17 09:23:07 2026 +0200

    gas: ignore ONLY_STANDARD_ESCAPES in scrubber
   =20
    The handling there is broken in several ways:
    - It gets in the way of macro parameter names starting with one of the =
not
      special cased values.
    - For perhaps a small set of targets (SINGLE_QUOTE_STRINGS, M68k MRI
      mode): While the "quotechar" static variable allows for string quotat=
ion
      by other than '"', the case labels circumventing the warning only (and
      potentially wrongly) cover '"'.
   =20
    read.c:next_char_of_string() having similar checking in place, drop the
    special casing (as as_warn() invocation) from here.
   =20
    While adjusting macros/macros.exp XFAIL-ary for an affected testcase,
    correct the referenced manifest symbol at the same time.

Diff:
---
 gas/app.c                           | 28 ----------------------------
 gas/testsuite/gas/macros/macros.exp |  6 +-----
 2 files changed, 1 insertion(+), 33 deletions(-)

diff --git a/gas/app.c b/gas/app.c
index 6d8b8889784..3410e696572 100644
--- a/gas/app.c
+++ b/gas/app.c
@@ -707,35 +707,7 @@ do_scrub_chars (size_t (*get) (char *, size_t), char *=
tostart, size_t tolen,
 	      PUT (quotechar);
 	      continue;
=20
-	      /* These two are used inside macros.  */
-	    case '@':
-	    case '+':
-	      break;
-
-	    case '"':
-	    case '\\':
-	    case 'b':
-	    case 'f':
-	    case 'n':
-	    case 'r':
-	    case 't':
-	    case 'v':
-	    case 'x':
-	    case 'X':
-	    case '0':
-	    case '1':
-	    case '2':
-	    case '3':
-	    case '4':
-	    case '5':
-	    case '6':
-	    case '7':
-	      break;
-
 	    default:
-#ifdef ONLY_STANDARD_ESCAPES
-	      as_warn (_("unknown escape '\\%c' in string; ignored"), ch);
-#endif
 	      break;
 	    }
 	  PUT (ch);
diff --git a/gas/testsuite/gas/macros/macros.exp b/gas/testsuite/gas/macros=
/macros.exp
index 34912414e90..741d743624e 100644
--- a/gas/testsuite/gas/macros/macros.exp
+++ b/gas/testsuite/gas/macros/macros.exp
@@ -53,13 +53,9 @@ switch -glob $target_triplet {
 }
=20
 if { ![istarget hppa*-*-*] || [istarget *-*-linux*] } {
-    # FIXME: Due to macro mishandling of ONLY_STANDARD_ESCAPES.
-    setup_xfail "avr-*" "cris-*" "crisv32-*" "msp430-*"
-
-    # These fail due to NO_STRING_ESCAPES
+    # These fail due to !TC_STRING_ESCAPES
     setup_xfail "powerpc*-*-aix*" "powerpc*-*-beos*" "powerpc*-*-macos*"
     setup_xfail "rs6000-*-*"
-    setup_xfail "z80-*-*"
=20
     # FIXME: Due to difference in what "consecutive octets" means.
     setup_xfail "*c4x*-*-*" "*c54x*-*"