This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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 opt-functions.awk in POSIXLY_CORRECT mode (PR other/78766)


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


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