bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash 5.2: broken built-in printf for float numbers


From: Greg Wooledge
Subject: Re: Bash 5.2: broken built-in printf for float numbers
Date: Thu, 7 Nov 2024 09:29:29 -0500

On Thu, Nov 07, 2024 at 10:16:46 +0100, Thomas Dreibholz wrote:
> Hi,
> 
> Bash 5.2 has a broken built-in printf for float numbers.
> 
> Example: printf "%5.1f" 1024 should print "1024.0" (with standard locale
> LC_ALL=C.UTF-8)
> 
> Testing the Bash shell in different versions of recent Debian and Ubuntu
> setups, the output is wrong. Bug tracker for Debian:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1081424 .Depending on the
> Debian/Ubuntu patch version of Bash, the output made by Bash is either
> complete garbage (random), or "nan" or "-0.0". The output of the external
> command /usr/bin/printf is always correct.

The bug report you linked to says "Debian 11 and Debian 12 are fine"
and that the problem is only in Debian's "testing" and "unstable"
releases.

What you're seeing is a known bug that's triggered by some newer
compilers.  See
<https://lists.gnu.org/archive/html/bug-bash/2024-09/msg00068.html>
for details.

The bug is fixed in <https://ftp.gnu.org/gnu/bash/bash-5.2-patches/bash52-033>
so you might want to inform the Debian people that this patch should
be applied.



reply via email to

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