autoconf-patches
[Top][All Lists]
Advanced

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

Re: AT_KEYWORDS failure: cmdline OR-combinations


From: Stepan Kasal
Subject: Re: AT_KEYWORDS failure: cmdline OR-combinations
Date: Fri, 26 Aug 2005 18:12:52 +0200
User-agent: Mutt/1.4.1i

Hello Paul,

regarding the test failures reported by Ralf Wildenhues in

http://lists.gnu.org/archive/html/autoconf-patches/2005-08/msg00055.html

As Ralf has already told you, we have a solution for them.
(Yes, we have also analyzed the problem with test 66, and I'll send a mail
about it soon.)

I apologize that I haven't published our results earlier.

On Thu, Aug 25, 2005 at 02:31:30PM -0700, Paul Eggert wrote:
> Ralf Wildenhues writes:
> > +   if (v1"" == "") d1 = v1; else { d1 = substr(v1, 1, 1); v1 = 
> > substr(v1,2) }
> > +   if (v2"" == "") d2 = v2; else { d2 = substr(v2, 1, 1); v2 = 
> > substr(v2,2) }
> 
> That looks fairly safe, but even safer would be to use the length function,
> since earlier bits of the code already do that.  I installed this:
[...]
> +     if (length(v1)) { d1 = substr(v1, 1, 1); v1 = substr(v1,2) } else d1=v1
> +     if (length(v2)) { d2 = substr(v2, 1, 1); v2 = substr(v2,2) } else d2=v2

But your fix also induces the failure reported by Ralf:
| 21. m4sh.at:252: testing ...
| ../../autoconf-2.59c/tests/m4sh.at:285: autom4te --language=m4sh script.as -o 
script
| ../../autoconf-2.59c/tests/m4sh.at:286: ./script
| 0a1
| > script: error: version  = 000; should be  < 000
| ../../autoconf-2.59c/tests/m4sh.at:286: exit code was 1, expected 0
| 21. m4sh.at:252: 21. AS_VERSION_COMPARE (m4sh.at:252): FAILED (m4sh.at:286)

The problem is that /usr/xpg4/bin/awk on Solaris 8 (and probably also the above
versions) thinks that empty string might be a numerical string.
Moreover, substr propagates the "numerical string" flag.
So we have:
  /usr/xpg4/bin/awk 'END{d1=v1;d2=substr(v2,1,1); if(v1==v2) print "error"}' \
        v1=  v2=000 /dev/null

This is why the script compares versions "" and "000" as being equal, hence
the error quoted above.

I don't have access to any Solaris.  If you could verify that the above bug,
and hence the failure of test 21, is still present on Solaris 10, it would
be nice.

I plan to document these bugs, but they cannot be described by one sentence,
so it'll take some time until I fond time to do it.
(I hesitated to submit the patch without the corresponding doc. Sorry again.)

Attached please find a patch which fixes the problem.  Ralf verified it
works with /usr/xpg4/bin/awk and /bin/awk on Solaris 8 and 9.
(The patch applies to current CVS.)

OK to commit?

Stepan

Attachment: autoconf-20050826-solaris-version.patch
Description: Text document


reply via email to

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