1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-06-15 15:25:49 +00:00
Files
Bruno Haible 6ee553a6cc strtof, strtod, strtold: Return NaNs with correct sign.
Reported by Mohammad-Reza Nabipoor <mnabipoor@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-04/msg00136.html>.

* m4/strtof.m4 (gl_FUNC_STRTOF): Add test whether strtod works on signed
NaNs.
* m4/strtod.m4 (gl_FUNC_STRTOD): Likewise.
* m4/strtold.m4 (gl_FUNC_STRTOLD): Likewise.
* lib/strtod.c: Include isnan?-nolibm.h.
(HAS_MINUS_NAN_BUG): New macro.
(STRTOD): Add separate implementation for HAS_MINUS_NAN_BUG.
* modules/strtof (Files): Add m4/signbit.m4.
(Depends-on): Add isnanf-nolibm, signbit-no-c++.
* modules/strtod (Files): Add m4/signbit.m4.
(Depends-on): Add isnand-nolibm, signbit-no-c++.
* modules/strtold (Files): Add m4/signbit.m4.
(Depends-on): Add isnanl-nolibm, signbit-no-c++.
* tests/test-strtof.h (test_function): Enable the test of sign bits of
NaN.
* tests/test-strtod.h (test_function): Likewise.
* tests/test-strtold.h (test_function): Likewise.
* doc/posix-functions/strtof.texi: Document the bug regarding "-nan".
* doc/posix-functions/strtod.texi: Likewise.
* doc/posix-functions/strtold.texi: Likewise.
2026-05-02 15:27:52 +02:00

42 lines
861 B
Plaintext

Description:
strtof() function: convert string to 'float'.
Files:
lib/strtof.c
lib/strtod.c
m4/strtof.m4
m4/signbit.m4
m4/ldexpf.m4
Depends-on:
stdlib-h
c-ctype [test $HAVE_STRTOF = 0 || test $REPLACE_STRTOF = 1]
math-h [test $HAVE_STRTOF = 0 || test $REPLACE_STRTOF = 1]
bool [test $HAVE_STRTOF = 0 || test $REPLACE_STRTOF = 1]
isinf-no-c++ [test $HAVE_STRTOF = 0 || test $REPLACE_STRTOF = 1]
isnanf-nolibm [test $REPLACE_STRTOF = 1]
signbit-no-c++ [test $REPLACE_STRTOF = 1]
configure.ac:
gl_FUNC_STRTOF
gl_CONDITIONAL([GL_COND_OBJ_STRTOF],
[test $HAVE_STRTOF = 0 || test $REPLACE_STRTOF = 1])
AM_COND_IF([GL_COND_OBJ_STRTOF], [
gl_PREREQ_STRTOF
])
gl_STDLIB_MODULE_INDICATOR([strtof])
Makefile.am:
if GL_COND_OBJ_STRTOF
lib_SOURCES += strtof.c
endif
Include:
<stdlib.h>
License:
LGPL
Maintainer:
all