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]

Re: [Bug bootstrap/53607] opt-functions.awk --> "awk: There is a regular expression error."


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.
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

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