* Re: [Bug bootstrap/53607] opt-functions.awk --> "awk: There is a regular expression error."
[not found] ` <bug-53607-8784-MBTnlKIggu@http.gcc.gnu.org/bugzilla/>
@ 2013-01-06 16:49 ` Daniel Richard G.
2013-01-06 17:45 ` Andreas Schwab
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Richard G. @ 2013-01-06 16:49 UTC (permalink / raw)
To: gcc-patches; +Cc: John David Anglin
[-- Attachment #1: Type: text/plain, Size: 1709 bytes --]
This patch addresses a build failure on HP-UX due to the vendor
awk(1) apparently treating a lone curly-brace as an incomplete
repetition operator:
[...]
awk -f /home/src/gcc-4.7.2/gcc/opt-functions.awk -f
/home/src/gcc-4.7.2/gcc/opt-read.awk \
-f /home/src/gcc-4.7.2/gcc/opth-gen.awk \
< optionlist > tmp-options.h
awk: There is a regular expression error.
?, *, or + not preceded by valid regular expression
The source line number is 90.
The error context is
if (flags ~ >>> "^{") <<<
gmake[3]: *** [s-options-h] Error 2
gmake[3]: Leaving directory `/tmp/gcc-build/gcc'
gmake[2]: *** [all-stage1-gcc] Error 2
gmake[2]: Leaving directory `/tmp/gcc-build'
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory `/tmp/gcc-build'
gmake: *** [bootstrap-lean] Error 2
Fixed by escaping two curly-braces with backslashes.
Tested by getting past that point in the bootstrap successfully on
hppa2.0w-hp-hpux11.00; formal test case not applicable.
ChangeLog entry:
PR bootstrap/53607
* opt-functions.awk: Fix compatibility with HP-UX awk.
Patch: See attached.
--Daniel
On Sun, 2012 Dec 23 3:18+0000, danglin at gcc dot gnu.org wrote:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53607
>
> --- Comment #1 from John David Anglin <...> 2012-12-23 03:18:19 UTC ---
> Please send patch with ChangeLog to gcc-patches and CC me. I will
> apply if approved.
>
> --
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.
--
Daniel Richard G. || skunk@iSKUNK.ORG
My ASCII-art .sig got a bad case of Times New Roman.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pr53607-fix.patch --]
[-- Type: text/x-patch; name="pr53607-fix.patch", Size: 414 bytes --]
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Bug bootstrap/53607] opt-functions.awk --> "awk: There is a regular expression error."
2013-01-06 16:49 ` [Bug bootstrap/53607] opt-functions.awk --> "awk: There is a regular expression error." Daniel Richard G.
@ 2013-01-06 17:45 ` Andreas Schwab
2013-01-06 19:56 ` Daniel Richard G.
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2013-01-06 17:45 UTC (permalink / raw)
To: Daniel Richard G.; +Cc: gcc-patches, John David Anglin
"Daniel Richard G." <skunk@iSKUNK.ORG> writes:
> 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)
You need to escape the backslash inside a string.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Bug bootstrap/53607] opt-functions.awk --> "awk: There is a regular expression error."
2013-01-06 17:45 ` Andreas Schwab
@ 2013-01-06 19:56 ` Daniel Richard G.
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Richard G. @ 2013-01-06 19:56 UTC (permalink / raw)
To: Andreas Schwab; +Cc: gcc-patches, John David Anglin
[-- Attachment #1: Type: text/plain, Size: 470 bytes --]
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
--
Daniel Richard G. || skunk@iSKUNK.ORG
My ASCII-art .sig got a bad case of Times New Roman.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pr53607-fix-2.patch --]
[-- Type: text/x-patch; name="pr53607-fix-2.patch", Size: 416 bytes --]
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-06 19:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-53607-8784@http.gcc.gnu.org/bugzilla/>
[not found] ` <bug-53607-8784-MBTnlKIggu@http.gcc.gnu.org/bugzilla/>
2013-01-06 16:49 ` [Bug bootstrap/53607] opt-functions.awk --> "awk: There is a regular expression error." Daniel Richard G.
2013-01-06 17:45 ` Andreas Schwab
2013-01-06 19:56 ` Daniel Richard G.
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).