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: Paul Eggert
Subject: Re: AT_KEYWORDS failure: cmdline OR-combinations
Date: Fri, 26 Aug 2005 11:54:22 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Stepan Kasal <address@hidden> writes:

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

No need to apologize!  It's low priority, surely, since nobody really
needs /usr/xpg4/bin/awk.  Every Solaris implementation has nawk, and
nawk will work.

Perhaps we ought to filter out Solaris /usr/xpg4/bin/awk in our check
for valid awk implementations, by using this test case.  If it has
this bug, it's likely to have others.  Hardly anybody uses this Awk,
so there's little surprise that it's buggy.  (But this is low priority
too.)

>   /usr/xpg4/bin/awk 'END{d1=v1;d2=substr(v2,1,1); if(v1==v2) print "error"}' \
>       v1=  v2=000 /dev/null
> ...
>
> 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.

The above bug is still present on Solaris 10 (sparc).

> Attached please find a patch which fixes the problem.

Thanks.  I'd prefer the following patch, since it's a bit clearer.  If
I understand you aright, it'll also fix the problem.  I installed it.

2005-08-26  Paul Eggert  <address@hidden>

        * lib/m4sugar/m4sh.m4 (_AS_VERSION_COMPARE_PREPARE):
        The previous patch didn't work, so try a better one.

--- m4sh.m4     25 Aug 2005 21:29:54 -0000      1.149
+++ m4sh.m4     26 Aug 2005 18:49:23 -0000      1.150
@@ -1030,7 +1030,7 @@ m4_defun([_AS_VERSION_COMPARE_PREPARE],
   # Use only awk features that work with 7th edition Unix awk (1978).
   # My, what an old awk you have, Mr. Solaris!
   END {
-    while (length(v1) || length(v2)) {
+    while (length(v1) && length(v2)) {
       # Set d1 to be the next thing to compare from v1, and likewise for d2.
       # Normally this is a single character, but if v1 and v2 contain digits,
       # compare them as integers and fractions as strverscmp does.
@@ -1074,12 +1074,16 @@ m4_defun([_AS_VERSION_COMPARE_PREPARE],
        }
       } else {
        # The normal case, without worrying about digits.
-       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
+       d1 = substr(v1, 1, 1); v1 = substr(v1, 2)
+       d2 = substr(v2, 1, 1); v2 = substr(v2, 2)
       }
       if (d1 < d2) exit 1
       if (d1 > d2) exit 2
     }
+    # Beware Solaris /usr/xgp4/bin/awk (at least through Solaris 10),
+    # which mishandles some comparisons of empty strings to integers.
+    if (length(v2)) exit 1
+    if (length(v1)) exit 2
   }
 ']])
 




reply via email to

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