bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bad regexp in Libtool m4 for PGI compiler version checking


From: Ralf Wildenhues
Subject: Re: Bad regexp in Libtool m4 for PGI compiler version checking
Date: Sat, 14 Nov 2009 11:27:04 +0100
User-agent: Mutt/1.5.20 (2009-08-09)

Hi Jeff,

* Jeff Squyres wrote on Fri, Nov 13, 2009 at 11:37:28PM CET:
> The PGI suite is soon to release version 10.0, which causes some
> problems for the regexps in Libtool's m4.  Here's an example
> (forwarded from one of PGI's engineers):
> 
> >         pgCC* | pgcpp*)
> >           # Portland Group C++ compiler
> >           case `$CC -V` in
> >           *pgCC\ [1-5]* | *pgcpp\ [1-5]*)

> The problem is that this first regexp (in a series of
> version-checking regexp's) now matches PGI v10.  Here's one possible
> solution:

> >           case `$CC -V` in
> >           *pgCC\ [10]* | *pgcpp\ [10]*)
[...]
> >           *pgCC\ [1-5]* | *pgcpp\ [1-5]*)

That doesn't work, because [10] matches either 1 or 0, not 1 followed by
0.  (Assuming you have removed any need for M4 quoting.)

We can either do something like

              case `$CC -V` in
              *pgCC\ [1-9][0-9]]* | *pgcpp\ [1-9][0-9]*)
                new ...
              *pgCC\ [1-5]* | *pgcpp\ [1-5]*)
                old ...
              *)
                new ...

but that would still require us to duplicate the new rules.  If
possible, we prefer to have tighter matches for old tools, because
their set of values is known.  Can we assume there to be a period
after the major version, or at least a non-digit, as in either

              case `$CC -V` in
              *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
                old ...
              *)
                new ...

or

              case `$CC -V` in
              *pgCC\ [1-5][^0-9]* | *pgcpp\ [1-5][^0-9]*)
                old ...
              *)
                new ...

Thanks,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]