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
Bruno Haible
b368b69ba7
isinf-no-c++: New module.
...
Reported by G. Branden Robinson <g.branden.robinson@gmail.com > in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-12/msg00150.html >.
* modules/isinf-no-c++: New file, based on modules/isinf.
* modules/isinf: Essentially an alias of isinf-no-c++ now.
* modules/isinf-no-c++-tests: Renamed from modules/isinf-tests.
* lib/math.in.h (isinf): Test also GNULIB_ISINF_NO_CXX.
* m4/math_h.m4 (gl_MATH_H_REQUIRE_DEFAULTS): Initialize
GNULIB_ISINF_NO_CXX.
* modules/math-h (Makefile.am): Substitute GNULIB_ISINF_NO_CXX.
* modules/fmod (Depends-on): Add isinf-no-c++. Remove isinf.
* modules/fmodl (Depends-on): Likewise.
* modules/hypot (Depends-on): Likewise.
* modules/hypotl (Depends-on): Likewise.
* modules/modf (Depends-on): Likewise.
* modules/modfl (Depends-on): Likewise.
* modules/remainder (Depends-on): Likewise.
* modules/remainderf (Depends-on): Likewise.
* modules/remainderl (Depends-on): Likewise.
* modules/strtod (Depends-on): Likewise.
* modules/strtof (Depends-on): Likewise.
* modules/strtold (Depends-on): Likewise.
2025-12-19 23:35:28 +01:00
Bruno Haible
51aa7ef138
strtof: Work around mingw bug with overflow.
...
* lib/strtod.c (STRTOD): Recognize overflow.
* modules/strtof (Depends-on): Add isinf.
* modules/strtod (Depends-on): Likewise.
* modules/strtold (Depends-on): Likewise.
* doc/posix-functions/strtof.texi: Update mingw version.
2025-09-16 16:30:38 +02:00
Bruno Haible
6ebad7abf8
Rename module stdbool-h to bool.
...
Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-12/msg00193.html >.
* modules/bool: Renamed from modules/stdbool-h.
* modules/bool-tests: Renamed from modules/stdbool-h-tests.
* modules/bool-c++-tests: Renamed from modules/stdbool-h-c++-tests.
* tests/test-bool.c: Renamed from tests/test-stdbool-h.c.
* tests/test-bool-c++.cc: Renamed from tests/test-stdbool-h-c++.cc.
* tests/test-bool-c++2.cc: Renamed from tests/test-stdbool-h-c++2.cc.
* modules/stdbool-h-c99-tests: Update.
* modules/stdbool-h-c99-c++-tests: Update.
* tests/test-stdbool-h-c99.c: Update.
* tests/test-stdbool-h-c99-c++.cc: Update.
* doc/posix-headers/stdbool.texi: Update.
* doc/gnulib-readme.texi: Update.
* doc/gnulib.texi: Update.
* modules/* (Depends-on): Update.
* modules/stdbool: Update.
2024-12-28 06:20:34 +01:00
Bruno Haible
60e90236d9
Rename module stdlib to stdlib-h.
...
* modules/stdlib-h: Renamed from modules/stdlib.
* modules/stdlib-h-tests: Renamed from modules/stdlib-tests.
* modules/stdlib-h-c++-tests: Renamed from modules/stdlib-c++-tests.
* tests/test-stdlib-h.c: Renamed from tests/test-stdlib.c.
* tests/test-stdlib-h-c++.cc: Renamed from tests/test-stdlib-c++.cc.
* tests/test-stdlib-h-c++2.cc: Renamed from tests/test-stdlib-c++2.cc.
* doc/posix-headers/stdlib.texi: Update.
* doc/posix-functions/exit.texi: Update.
* modules/* (Depends-on): Update.
* modules/stdlib: New file.
2024-12-27 23:36:35 +01:00
Bruno Haible
3c501171cf
Rename module stdbool to stdbool-h.
...
* modules/stdbool-h: Renamed from modules/stdbool.
* modules/stdbool-h-tests: Renamed from modules/stdbool-tests.
* modules/stdbool-h-c++-tests: Renamed from modules/stdbool-c++-tests.
* tests/test-stdbool-h.c: Renamed from tests/test-stdbool.c.
* tests/test-stdbool-h-c++.cc: Renamed from tests/test-stdbool-c++.cc.
* tests/test-stdbool-h-c++2.cc: Renamed from tests/test-stdbool-c++2.cc.
* tests/test-stdbool-h-c99.c: Update.
* tests/test-stdbool-h-c99-c++.cc: Update.
* doc/posix-headers/stdbool.texi: Update.
* doc/gnulib-readme.texi: Update.
* doc/gnulib.texi: Update.
* modules/* (Depends-on): Update.
* modules/stdbool: New file.
2024-12-27 23:35:24 +01:00
Bruno Haible
d171b9454f
Rename module math to math-h.
...
* modules/math-h: Renamed from modules/math.
* modules/math-h-tests: Renamed from modules/math-tests.
* modules/math-h-c++-tests: Renamed from modules/math-c++-tests.
* tests/test-math-h.c: Renamed from tests/test-math.c.
* tests/test-math-h-c++.cc: Renamed from tests/test-math-c++.cc.
* tests/test-math-h-c++2.cc: Renamed from tests/test-math-c++2.cc.
* doc/posix-headers/math.texi: Update.
* modules/* (Depends-on): Update.
* modules/math: New file.
2024-12-27 23:14:22 +01:00
Bruno Haible
01a485ed9b
strtof: New module.
...
* lib/stdlib.in.h (strtof): New declaration.
* lib/strtod.c: Support USE_FLOAT.
* lib/strtof.c: New file.
* m4/strtof.m4: New file, based on m4/strtod.m4.
* m4/ldexpf.m4 (gl_CHECK_LDEXPF_NO_LIBM): New macro, based on
m4/ldexp.m4.
* m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize
GNULIB_STRTOF.
* modules/stdlib (Makefile.am): Substitute GNULIB_STRTOF, HAVE_STRTOF,
REPLACE_STRTOF.
* modules/strtof: New file.
* tests/test-stdlib-c++.cc (strtof): Check signature.
* doc/posix-functions/strtof.texi: Mention the new module and the bugs
that it fixes.
(gl_STDLIB_H_DEFAULTS): Initialize HAVE_STRTOF, REPLACE_STRTOF.
2024-02-22 01:16:32 +01:00