This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix opt-functions.awk in POSIXLY_CORRECT mode (PR other/78766)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 Dec 2016 20:14:18 +0100
- Subject: [PATCH] Fix opt-functions.awk in POSIXLY_CORRECT mode (PR other/78766)
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
{ is a special character in ERE, so gawk rightfully complains in
POSIXLY_CORRECT mode. The regex is meant to look for { at the beginning
of line. Neither "^\{" nor "^\\{" works though, but "^[{]" does.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
2016-12-12 Jakub Jelinek <jakub@redhat.com>
PR other/78766
* opt-functions.awk (opt_args): Use [{] instead of { in regexps.
--- gcc/opt-functions.awk.jj 2016-01-04 14:55:50.000000000 +0100
+++ gcc/opt-functions.awk 2016-12-12 09:38:02.229155459 +0100
@@ -61,10 +61,10 @@ function opt_args(name, flags)
if (flags !~ " " name "\\(")
return ""
sub(".* " name "\\(", "", flags)
- if (flags ~ "^{")
+ if (flags ~ "^[{]")
{
- sub ("^{", "", flags)
- sub("}\\).*", "", flags)
+ sub ("^[{]", "", flags)
+ sub ("}\\).*", "", flags)
}
else
sub("\\).*", "", flags)
Jakub