On 8/6/24 5:58 AM, anonymous wrote:
jesusm@liet:[~]$ bash --version
GNU bash, version 5.2.32(1)-release (x86_64-slackware-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
jesusm@liet:[~]$ printf "%f\n" 1.2
-nan
jesusm@liet:[~]$ /bin/printf "%f\n" 1.2
1.200000
jesusm@liet:[~]$
Nothing changed here between 5.2.26 and 5.2.32; you probably updated your
compiler and fell victim to this:
https://lists.gnu.org/archive/html/bug-bash/2023-11/msg00104.html
I attached a patch.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/
*** ../bash-5.2.32/configure.ac Fri Sep 23 10:12:27 2022
--- configure.ac Tue Aug 6 09:19:00 2024
***************
*** 886,890 ****
[AC_LANG_PROGRAM(
[[#include <stdlib.h>]],
! [[long double r; char *foo, bar; r = strtold(foo, &bar);]]
)],
[bash_cv_strtold_broken=no],[bash_cv_strtold_broken=yes])
--- 886,890 ----
[AC_LANG_PROGRAM(
[[#include <stdlib.h>]],
! [[long double r; char *foo, *bar; r = strtold(foo, &bar);]]
)],
[bash_cv_strtold_broken=no],[bash_cv_strtold_broken=yes])
*** ../bash-5.2.32/configure Wed Jul 31 09:44:19 2024
--- configure Tue Aug 6 09:20:18 2024
***************
*** 15677,15681 ****
main (void)
{
! long double r; char *foo, bar; r = strtold(foo, &bar);
;
--- 15677,15681 ----
main (void)
{
! long double r; char *foo, *bar; r = strtold(foo, &bar);
;