ThomasDickey / original-mawk

bug-reports for mawk (originally on GoogleCode)
http://invisible-island.net/mawk/mawk.html
17 stars 2 forks source link

printf %ld regression from 20200725a to 20200731 on 32-bit big-endian platforms #69

Closed zv-io closed 12 months ago

zv-io commented 1 year ago

On 32-bit big-endian platforms (such as ppc or sparc), there was a regression in the printf %ld format specifier. Minimal reproducer:

# 32-bit ppc and sparc
$ echo 1 | awk '{printf "%d\n%ld\n", $1,$1}'
1
0
# 32-bit x86, arm, etc.
$ echo 1 | awk '{printf "%d\n%ld\n", $1,$1}'
1
1

More information:

I can provide access to a 32-bit PowerPC or SPARC environment, though QEMU user may be sufficient for debugging/testing.

ThomasDickey commented 1 year ago

agreed - Zach van Rijn sent mail about this on April 19. I was able to reproduce the problem, and intend working on mawk once I'm done with fixes for byacc.

ThomasDickey commented 1 year ago

The relevant change-log item is indeed Debian #303825 though the relationship could use a couple of lines for clarity. I'll do that. At the moment, I'm studying a (simple) fix for this problem.

ThomasDickey commented 1 year ago

Released fix (20230525)