From: fweimer@redhat.com (Florian Weimer)
To: libc-stable@sourceware.org
Subject: [2.27 COMMITTED] conform/conformtest.pl: Escape literal braces in regular expressions
Date: Mon, 01 Jan 2018 00:00:00 -0000 [thread overview]
Message-ID: <20180706144058.7A08A43994575@oldenburg.str.redhat.com> (raw)
This suppresses Perl warnings like these:
Unescaped left brace in regex is deprecated here (and will be fatal in
Perl 5.32), passed through in regex; marked by <-- HERE in m/^element
*({ <-- HERE ([^}]*)}|([^{ ]*)) *({([^}]*)}|([^{ ]*)) *([A-Za-z0-9_]*)
*(.*)/ at conformtest.pl line 370.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit ddb3c626b0a159de3547d901420198b626c29554)
2018-07-06 Florian Weimer <fweimer@redhat.com>
* conform/conformtest.pl (checknamespace): Escape literal braces
in regular expressions.
diff --git a/conform/conformtest.pl b/conform/conformtest.pl
index cb500f0e76..a4ef756105 100644
--- a/conform/conformtest.pl
+++ b/conform/conformtest.pl
@@ -367,7 +367,7 @@ while ($#headers >= 0) {
s/^optional-//;
$optional = 1;
}
- if (/^element *({([^}]*)}|([^{ ]*)) *({([^}]*)}|([^{ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
+ if (/^element *(\{([^}]*)\}|([^{ ]*)) *(\{([^}]*)\}|([^{ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
my($struct) = "$2$3";
my($type) = "$5$6";
my($member) = "$7";
@@ -556,7 +556,7 @@ while ($#headers >= 0) {
"Symbol \"$symbol\" has not the right value.", $res,
$xfail);
}
- } elsif (/^type *({([^}]*)|([a-zA-Z0-9_]*))/) {
+ } elsif (/^type *(\{([^}]*)|([a-zA-Z0-9_]*))/) {
my($type) = "$2$3";
my($maybe_opaque) = 0;
@@ -586,7 +586,7 @@ while ($#headers >= 0) {
? "NOT AVAILABLE"
: "Type \"$type\" not available."), $missing, $optional,
$xfail);
- } elsif (/^tag *({([^}]*)|([a-zA-Z0-9_]*))/) {
+ } elsif (/^tag *(\{([^}]*)|([a-zA-Z0-9_]*))/) {
my($type) = "$2$3";
# Remember that this name is allowed.
@@ -607,7 +607,7 @@ while ($#headers >= 0) {
compiletest ($fnamebase, "Testing for type $type",
"Type \"$type\" not available.", $missing, 0, $xfail);
- } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
+ } elsif (/^function *(\{([^}]*)\}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
my($rettype) = "$2$3";
my($fname) = "$4";
my($args) = "$5";
@@ -644,7 +644,7 @@ while ($#headers >= 0) {
"Function \"$fname\" has incorrect type.", $res, 0,
$xfail);
}
- } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
+ } elsif (/^function *(\{([^}]*)\}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
my($rettype) = "$2$3";
my($fname) = "$4";
my($args) = "$5";
@@ -681,7 +681,7 @@ while ($#headers >= 0) {
"Function \"$fname\" has incorrect type.", $res, 0,
$xfail);
}
- } elsif (/^variable *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) *(.*)/) {
+ } elsif (/^variable *(\{([^}]*)\}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) *(.*)/) {
my($type) = "$2$3";
my($vname) = "$4";
my($rest) = "$5";
@@ -713,7 +713,7 @@ while ($#headers >= 0) {
compiletest ($fnamebase, "Test for type of variable $fname",
"Variable \"$vname\" has incorrect type.", $res, 0, $xfail);
- } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
+ } elsif (/^macro-function *(\{([^}]*)\}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
my($rettype) = "$2$3";
my($fname) = "$4";
my($args) = "$5";
@@ -812,11 +812,11 @@ while ($#headers >= 0) {
s/^xfail(\[([^\]]*)\])?-//;
s/^optional-//;
- if (/^element *({([^}]*)}|([^ ]*)) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
+ if (/^element *(\{([^}]*)\}|([^ ]*)) *(\{([^}]*)\}|([^ ]*)) *([A-Za-z0-9_]*) *(.*)/) {
push @allow, $7;
} elsif (/^(macro|constant|macro-constant|macro-int-constant) +([a-zA-Z0-9_]*) *(?:{([^}]*)} *)?(?:([>=<!]+) ([A-Za-z0-9_-]*))?/) {
push @allow, $2;
- } elsif (/^(type|tag) *({([^}]*)|([a-zA-Z0-9_]*))/) {
+ } elsif (/^(type|tag) *(\{([^}]*)|([a-zA-Z0-9_]*))/) {
my($type) = "$3$4";
# Remember that this name is allowed.
@@ -827,13 +827,13 @@ while ($#headers >= 0) {
} else {
push @allow, $type;
}
- } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
+ } elsif (/^function *(\{([^}]*)\}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) {
push @allow, $4;
- } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
+ } elsif (/^function *(\{([^}]*)\}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
push @allow, $4;
- } elsif (/^variable *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*)/) {
+ } elsif (/^variable *(\{([^}]*)\}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*)/) {
push @allow, $4;
- } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
+ } elsif (/^macro-function *(\{([^}]*)\}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) {
push @allow, $4;
} elsif (/^symbol *([a-zA-Z0-9_]*) *([A-Za-z0-9_-]*)?/) {
push @allow, $1;
reply other threads:[~2018-07-06 14:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20180706144058.7A08A43994575@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=libc-stable@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).