fixinc: RE error: repetition-operator operand invalid

korbb@egcs.cygnus.com korbb@egcs.cygnus.com
Tue Jul 6 07:32:00 GMT 1999


> On FreeBSD 3.2 I get the following error messages when bootstrapping
> current CVS:
> 
>   :
>   Fixing directory /usr/include into /.../gcc/include
>   Applying End_Else_Label           to ./g++/std/cstring.h
>   sed: 9: ":loop
>   /\\$/N
>   s/\\$/\\++ ...": RE error: repetition-operator operand invalid

It is curious I did not see this on my Linux box!

> If these are real errors, shouldn't the bootstrap abort at this point?

I vaguely remember this being fixed a long time ago.  I must
have muffed it when I recombined the endif/else processing.
As for catching the error, it is difficult.  It would be necessary
to keep track of the PIDs of all the fixup children and
check their status inside the SIGCHLD processing, while ignoring
the status of unknown children.  (Some shells give you gratuitous
child processes that will give you SIGCHLDs just like your
regular children.  Yuck.)  All of the fixes for each file are
run together in a single filter chain connected with pipes.

P.S. Gerald - would you be kind enough to post to egcs-patches
for me?  Posting from egcs.cygnus.com seems to have been disabled.
The fix is already in the main line.  Thanks.


1999-07-06  Bruce Korb  <ddsinc09@ix.netcom.com>

        * fixinc/inclhack.def(end_else_label): Double the backslash so
        sed gets a chance to see it.
        * fixinc/inclhack.sh: regen
        * fixinc/fixincl.x: regen

Index: inclhack.def
===================================================================
RCS file: /cvs/egcs/egcs/gcc/fixinc/inclhack.def,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- inclhack.def        1999/06/28 07:07:01     1.31
+++ inclhack.def        1999/07/06 07:06:51     1.32
@@ -521,7 +521,7 @@
                "s%^\\([ \t]*#[ \t]*else\\)[ \t][ \t]*/[^*].*%\\1%\n"
                "s%^\\([ \t]*#[ \t]*else\\)[ \t][ \t]*[^/ \t].*%\\1%\n"
                "s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]*/[^*].*%\\1%\n"
-               "s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]*\*[^/].*%\\1%\n"
+               "s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]*\\*[^/].*%\\1%\n"
                "s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]*[^/* \t].*%\\1%";
 };
 
Index: inclhack.sh
===================================================================
RCS file: /cvs/egcs/egcs/gcc/fixinc/inclhack.sh,v
retrieving revision 1.36
diff -u -r1.36 inclhack.sh
--- inclhack.sh 1999/06/28 07:07:03     1.36
+++ inclhack.sh 1999/07/06 14:11:15
@@ -920,7 +920,7 @@
 s%^\([         ]*#[    ]*else\)[       ][      ]*/[^*].*%\1%
 s%^\([         ]*#[    ]*else\)[       ][      ]*[^/   ].*%\1%
 s%^\([         ]*#[    ]*endif\)[      ][      ]*/[^*].*%\1%
-s%^\([         ]*#[    ]*endif\)[      ][      ]**[^/].*%\1%
+s%^\([         ]*#[    ]*endif\)[      ][      ]*\*[^/].*%\1%
 s%^\([         ]*#[    ]*endif\)[      ][      ]*[^/*  ].*%\1%' \
           < $infile > ${DESTDIR}/fixinc.tmp
     rm -f ${DESTFILE}
Index: fixincl.x
===================================================================
RCS file: /cvs/egcs/egcs/gcc/fixinc/fixincl.x,v
retrieving revision 1.34
diff -u -r1.34 fixincl.x
--- fixincl.x   1999/06/28 07:07:04     1.34
+++ fixincl.x   1999/07/06 14:11:19
@@ -812,7 +812,7 @@
 s%^\\([ \t]*#[ \t]*else\\)[ \t][ \t]*/[^*].*%\\1%\n\
 s%^\\([ \t]*#[ \t]*else\\)[ \t][ \t]*[^/ \t].*%\\1%\n\
 s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]*/[^*].*%\\1%\n\
-s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]**[^/].*%\\1%\n\
+s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]*\\*[^/].*%\\1%\n\
 s%^\\([ \t]*#[ \t]*endif\\)[ \t][ \t]*[^/* \t].*%\\1%",
     (char*)NULL };
 


More information about the Gcc-patches mailing list