From 4db9e75b0bbc535c9eac77165270f62b59a29eaa 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 2e9a9b39f3..a0307c7272 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 3aada2c405..6a9364862e 100644 --- a/doc/posix-functions/strtold.texi +++ b/doc/posix-functions/strtold.texi @@ -61,6 +61,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 bece59fd68..6c368c458c 100644 --- a/lib/strtod.c +++ b/lib/strtod.c @@ -73,6 +73,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