Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jul 2021 01:23:05 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 257288] awk - loop over array index goes in reverse
Message-ID:  <bug-257288-227-x45v7Ygwjo@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-257288-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-257288-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D257288

Warner Losh <imp@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Open

--- Comment #2 from Warner Losh <imp@FreeBSD.org> ---
>From the gawk manual on the for (i in array) construct:

"The order in which elements of the array are accessed by this statement is
determined by the internal arrangement of the array elements within awk and=
 in
standard awk cannot be controlled or changed. This can lead to problems if =
new
elements are added to array by statements in the loop body; it is not
predictable whether the for loop will reach them. Similarly, changing var
inside the loop may produce strange results. It is best to avoid such thing=
s."

So I think this is a "not a bug" situation. I'll let the originator offer a
dissenting view before closing, however.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-257288-227-x45v7Ygwjo>