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]

Re: fixinc testing cleanup


On Fri, May 12, 2000 at 03:42:39PM -0700, Bruce Korb wrote:
>     sed      =
>         "s/^[ \t]*#[ \t]*define[ \t]+\\([^(]*\\)\\(([^)]*)\\)[ \t]*"
>                "\\(_.\\)\\1\\2[ \t]*$/#define \\1 \\3\\1/";

If I'm not mistaken, the problem with the above expression is around the
period near the beginning of the second line- it will consume the F in
_FOOsomething, but needs to match the entire FOO. An easy change is to make
it "\\(_.*\\)". Also, looking at other sed excerpts, many avoid using '+'
as a match 1 or more. So the correct version may be:

     sed      =
         "s/^[ \t]*#[ \t]*define[ \t][ \t]*\\([^(]*\\)\\(([^)]*)\\)[ \t]*"
                "\\(_.*\\)\\1\\2[ \t]*$/#define \\1 \\3\\1/";

Michael.

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