[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Problem with array index in connection with "sorted_in"
From: |
Nelson H. F. Beebe |
Subject: |
Re: [bug-gawk] Problem with array index in connection with "sorted_in" |
Date: |
Thu, 21 Jul 2016 07:58:12 -0600 |
Christian Schneider <address@hidden> reports unexpected
output from gawk 4.1.1 (Debian 8) for this test:
echo -ne "1.0\n2.0\n" | gawk '
BEGIN {
PROCINFO["sorted_in"] = "@ind_num_asc"
}
{
A[$1] = 0
}
END {
for (I in A) B[I] = A[I]
for (I in B) SCRATCH = A[I]
for (I in A) print I
}'
The expected output is
1.0
2.0
but gawk 4.1.1 (Debian 8) reported
1
1.0
2
2.0
I just ran a test on Solaris SPARC with 86 versions of gawk from 3.0.0
to 4.1.3h, including 4.1.1, and all gave the expected output.
I also ran a similar test on CentOS 6 (== RedHat 6) on x86-64, with 84
versions of gawk, and got the expected output on most of them.
However, for these versions
4.0.73
4.0.74
4.0.75
4.0.76
4.1.0
4.1.0e
4.1.0f
4.1.0h
4.1.1
4.1.1b
4.1.1c
4.1.1d
4.1.2
4.1.3
4.1.60
I got the erroneous output that Christian reported. Thus, I conclude
that (a) the bug is fixed in the latest versions 4.1.3g and 4.1.3h,
and (b) the bug is platform dependent.
-------------------------------------------------------------------------------
- Nelson H. F. Beebe Tel: +1 801 581 5254 -
- University of Utah FAX: +1 801 581 4148 -
- Department of Mathematics, 110 LCB Internet e-mail: address@hidden -
- 155 S 1400 E RM 233 address@hidden address@hidden -
- Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------