On 8/12/24 10:30 AM, Laur Aliste wrote:

Bash Version: 5.2
Patch Level: 21
Release Status: release

Description:
     One of my old script that's been in use for 10+ years is using
built-in bash printf
     for rounding float value to int via `printf`; as of today (Aug 12)
it started
     returning erroneous and inconsistent results.
     Note it doesn't require float input value - trying to format full integers
     reproduces the problem the same.

It's probably a bug with configure, which a gcc update has triggered.
I've attached a patch.


     Bash version hasn't been updated for ages so assuming it has to be
a dependency issue.

My question is why the (admittedly old) gnulib replacement strtod/strtold
is messing things up.

--
``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-20231106/configure.ac       Fri Aug 11 14:52:31 2023
--- configure.ac        Tue Nov 21 12:00:25 2023
***************
*** 899,903 ****
                [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])
--- 900,904 ----
                [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-20231106/configure  Fri Aug 18 16:27:53 2023
--- configure   Tue Nov 21 12:00:30 2023
***************
*** 15923,15927 ****
  main (void)
  {
! long double r; char *foo, bar; r = strtold(foo, &bar);
  
    ;
--- 15932,15936 ----
  main (void)
  {
! long double r; char *foo, *bar; r = strtold(foo, &bar);
  
    ;

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to