From 6238a4c0bed4d286e0e570d12faf4d481783609a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 1 Sep 2024 23:25:42 +0200 Subject: [PATCH] strtold: Work around a Haiku bug. * lib/strtod.c (HAVE_UNDERLYING_STRTOD): Set to 0 for 'long double' parsing on Haiku. * doc/posix-functions/strtold.texi: Mention the bug. --- ChangeLog | 7 +++++++ doc/posix-functions/strtold.texi | 5 +++++ lib/strtod.c | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index f6fab69fb8..cf5c09ded9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-09-01 Bruno Haible + + strtold: Work around a Haiku bug. + * lib/strtod.c (HAVE_UNDERLYING_STRTOD): Set to 0 for 'long double' + parsing on Haiku. + * doc/posix-functions/strtold.texi: Mention the bug. + 2024-09-01 Bruno Haible math: Remove workaround for an older Haiku bug. diff --git a/doc/posix-functions/strtold.texi b/doc/posix-functions/strtold.texi index 7b13b2dd93..b3bd208f02 100644 --- a/doc/posix-functions/strtold.texi +++ b/doc/posix-functions/strtold.texi @@ -68,6 +68,11 @@ This function fails to set @code{errno} upon underflow on some platforms: @c https://cygwin.com/ml/cygwin/2019-12/msg00072.html Cygwin 2.9. +@item +This function maps denormalized numbers to zero on some platforms: +@c https://dev.haiku-os.org/ticket/19040 +Haiku 2024. + @item This function leaks memory on mingw 5.0 and allocates an unbounded amount of stack on mingw 9.0. diff --git a/lib/strtod.c b/lib/strtod.c index 9504f2945b..fed43a05f8 100644 --- a/lib/strtod.c +++ b/lib/strtod.c @@ -54,6 +54,10 @@ See and . */ # define HAVE_UNDERLYING_STRTOD 0 +# elif defined __HAIKU__ + /* Haiku's strtold maps denormalized numbers to zero. + */ +# define HAVE_UNDERLYING_STRTOD 0 # else # define HAVE_UNDERLYING_STRTOD HAVE_STRTOLD # endif -- 2.39.5