From patchwork Sun Jan 6 19:56:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Bug, bootstrap/53607] opt-functions.awk --> "awk: There is a regular expression error." Date: Sun, 06 Jan 2013 09:56:32 -0000 From: "Daniel Richard G." X-Patchwork-Id: 209797 Message-Id: <1357502192.20273.140661174132361.1ECA78EE@webmail.messagingengine.com> To: Andreas Schwab Cc: gcc-patches@gcc.gnu.org, John David Anglin On Sun, 2013 Jan 6 18:45+0100, Andreas Schwab wrote: > > > sub(".* " name "\\(", "", flags) > > - if (flags ~ "^{") > > + if (flags ~ "^\{") > > { > > - sub ("^{", "", flags) > > + sub ("^\{", "", flags) > > sub("}\\).*", "", flags) > > You need to escape the backslash inside a string. Revised patch attached; awk behavior/output is same as before. --Daniel Index: gcc/opt-functions.awk =================================================================== --- gcc/opt-functions.awk (revision 194916) +++ gcc/opt-functions.awk (working copy) @@ -62,9 +62,9 @@ if (flags !~ " " name "\\(") return "" sub(".* " name "\\(", "", flags) - if (flags ~ "^{") + if (flags ~ "^\\{") { - sub ("^{", "", flags) + sub ("^\\{", "", flags) sub("}\\).*", "", flags) } else