[binutils-gdb] prune_warnings_extra quoting
Alan Modra
amodra@sourceware.org
Thu Mar 12 23:34:34 GMT 2026
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=34d035b6b7240a0d8a81b80ad6b5e54ee1683313
commit 34d035b6b7240a0d8a81b80ad6b5e54ee1683313
Author: Alan Modra <amodra@gmail.com>
Date: Fri Mar 13 08:54:05 2026 +1030
prune_warnings_extra quoting
This patch just tidies the code a little. By using tcl {} quoting
rather than "" we can reduce the need for backslash quoting.
* testsuite/lib/binutils-common.exp (prune_warnings_extra): Use
tcl {} quoting.
Diff:
---
binutils/testsuite/lib/binutils-common.exp | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
index 72cbf4a4e05..24215502069 100644
--- a/binutils/testsuite/lib/binutils-common.exp
+++ b/binutils/testsuite/lib/binutils-common.exp
@@ -768,29 +768,29 @@ proc prune_warnings_extra { text } {
# as they indicate that the sources need to be updated to recognise
# the new properties.
if { "$experimental" == "false" } {
- # The "\\1" is to try to preserve a "\n" but only if necessary.
- regsub -all "(^|\n)(\[^\n\]*: warning:\[^\n\]*unsupported GNU_PROPERTY_TYPE\[^\n\]*\n?)+" $text "\\1" text
+ # The {\1} is to preserve a \n when necessary.
+ regsub -all {(^|\n)([^\n]*: warning:[^\n]*unsupported GNU_PROPERTY_TYPE[^\n]*\n?)+} $text {\1} text
}
# PR binutils/23898: It is OK to have gaps in build notes.
- regsub -all "(^|\n)(\[^\n\]*: Warning: Gap in build notes detected from\[^\n\]*\n?)+" $text "\\1" text
+ regsub -all {(^|\n)([^\n]*: Warning: Gap in build notes detected from[^\n]*\n?)+} $text {\1} text
# Many tests use assembler source files without a .note.GNU-stack section.
# So ignore warnings about it being missing.
- regsub -all "(^|\n)(\[^\n\]*: warning:\[^\n\]*missing \\.note\\.GNU-stack section\[^\n\]*\n?)+" $text "\\1" text
- regsub -all "(^|\n)(\[^\n\]*: NOTE: This behaviour is deprecated\[^\n\]*\n?)+" $text "\\1" text
+ regsub -all {(^|\n)([^\n]*: warning:[^\n]*missing \.note\.GNU-stack section[^\n]*\n?)+} $text {\1} text
+ regsub -all {(^|\n)([^\n]*: NOTE: This behaviour is deprecated[^\n]*\n?)+} $text {\1} text
# Ignore warnings about RWX segments.
- regsub -all "(^|\n)(\[^\n\]*: warning:\[^\n\]*has a LOAD segment with RWX permissions\[^\n\]*\n?)+" $text "\\1" text
- regsub -all "(^|\n)(\[^\n\]*: warning:\[^\n\]*has a TLS segment with execute permission\[^\n\]*\n?)+" $text "\\1" text
+ regsub -all {(^|\n)([^\n]*: warning:[^\n]*has a LOAD segment with RWX permissions[^\n]*\n?)+} $text {\1} text
+ regsub -all {(^|\n)([^\n]*: warning:[^\n]*has a TLS segment with execute permission[^\n]*\n?)+} $text {\1} text
# Configuring with --enable-warn-execstack=yes will generate warnings if
# -z execstack is used.
- regsub -all "(^|\n)(\[^\n\]*: warning: enabling an executable stack because of -z execstack command line option\[^\n\]*\n?)+" $text "\\1" text
+ regsub -all {(^|\n)([^\n]*: warning: enabling an executable stack because of -z execstack command line option[^\n]*\n?)+} $text {\1} text
# Ignore LTO warnings triggered by configuring with --enable-pgo-build=lto.
- regsub -all "(^|\n)(\[^\n\]*lto-wrapper: warning: using serial compilation of \[0-9\]+ LTRANS jobs\[^\n\]*\n?)+" $text "\\1" text
- regsub -all "(^|\n)(\[^\n\]*lto-wrapper: note: \[^\n\]*\n?)+" $text "\\1" text
+ regsub -all {(^|\n)([^\n]*lto-wrapper: warning: using serial compilation of [0-9]+ LTRANS jobs[^\n]*\n?)+} $text {\1} text
+ regsub -all {(^|\n)([^\n]*lto-wrapper: note: [^\n]*\n?)+} $text {\1} text
return $text
}
More information about the Binutils-cvs
mailing list