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: Ralf Wildenhues
Subject: Re: AT_KEYWORDS failure: cmdline OR-combinations
Date: Fri, 19 Aug 2005 16:29:15 +0200
User-agent: Mutt/1.4.1i

Hi Stepan,

* Stepan Kasal wrote on Wed, Aug 17, 2005 at 07:31:12PM CEST:
> On Wed, Aug 17, 2005 at 06:36:46PM +0200, Ralf Wildenhues wrote:
> > [ solaris awk ]
> > >
> > > | 21: m4sh.at:252        AS_VERSION_COMPARE
> > > 
> > > loops endlessly (in awk).
> > 
> > This is for calling AS_VERSION_COMPARE with empty first argument.
> > Is that allowed?  This would fix the test:
> 
> your patch only hides the problem.

Hehe.  You did it again.  :)

> AS_VERSION_COMPARE has two possibilities:
> - either refuse the argument
> - or handle it
> 
> Since we proudly present the awk code as Solaris safe, I'd be glad to
> see it fixed.  Ralph, will you volunteer?

Well, I'll at least give a couple of data points, but if I'm to fix
this, I need help/input.  (s/ph/f/ BTW, also in one other mail, but I've
a bad record for mis-writing your name, so I guess I shouldn't complain :)

This SUSv3 awk(1) statement:
| Comparisons (with the '<' , "<=" , "!=" , "==" , '>' , and ">="
| operators) shall be made numerically if both operands are numeric, if
| one is numeric and the other has a string value that is a numeric
| string, or if one is numeric and the other has the uninitialized value.

is violated by Solaris 9 /usr/xpg4/bin/awk for empty but not for
uninitialized variables:

$ $awk 'END {
        if (0 == v1) print "broken empty right: " awk
        if (v1 == 0) print "broken empty left: " awk
        if (0 != v2) print "broken uninitialized right: " awk
        if (v2 != 0) print "broken uninitialized left: " awk
}' v1= awk=$awk /dev/null
broken empty right: /usr/xpg4/bin/awk
broken empty left: /usr/xpg4/bin/awk

It works with AIX, UNICOS, GNU hawks.

But the simplistic patch below then causes this failure instead:
| #                             -*- compilation -*-
| 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)

Now, there might be another bug hiding -- I don't know.  Maybe someone
else does.  OTOH, I don't know a Solaris boxen where this awk is first
in PATH (I've explicitly set this up).  So maybe we should not worry too
much.

Other than test 21, 66. torture.at:374 makes Solaris `sed' segfault..

Cheers,
Ralf

        * lib/m4sugar/m4sh.m4 (_AS_VERSION_COMPARE_PREPARE): Force
        string comparison when comparing against the empty string.

Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.148
diff -u -r1.148 m4sh.m4
--- lib/m4sugar/m4sh.m4 17 Jun 2005 20:37:37 -0000      1.148
+++ lib/m4sugar/m4sh.m4 19 Aug 2005 16:28:23 -0000
@@ -1074,8 +1074,8 @@
        }
       } else {
        # The normal case, without worrying about digits.
-       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) }
+       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) }
       }
       if (d1 < d2) exit 1
       if (d1 > d2) exit 2




reply via email to

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