diff --git a/mpfr-4.1.0.tar.xz b/mpfr-4.1.0.tar.xz deleted file mode 100644 index 72953b5d6cb3d19c4a5a61ea28d98f1aff3f95b5..0000000000000000000000000000000000000000 Binary files a/mpfr-4.1.0.tar.xz and /dev/null differ diff --git a/mpfr-4.2.0.tar.xz b/mpfr-4.2.0.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..9d272a160de58f5a4e5a0b569b539d608d1cf3f1 Binary files /dev/null and b/mpfr-4.2.0.tar.xz differ diff --git a/mpfr-tests-tsprintf.c-Modified-a-buggy-test-of-the-thousa.patch b/mpfr-tests-tsprintf.c-Modified-a-buggy-test-of-the-thousa.patch new file mode 100644 index 0000000000000000000000000000000000000000..be5b1afe7894de4e623254f23ee2ecf15a9f338f --- /dev/null +++ b/mpfr-tests-tsprintf.c-Modified-a-buggy-test-of-the-thousa.patch @@ -0,0 +1,56 @@ +From 5172494c09718ffcb7ef1f19b3b211e3bce8781a Mon Sep 17 00:00:00 2001 +From: Vincent Lefevre +Date: Tue, 10 Jan 2023 17:05:17 +0100 +Subject: [PATCH] [tests/tsprintf.c] Modified a buggy test of the thousands + separator. + +The test + + check_vsprintf ("+01,234,567 :", "%0+ -'13.10Pd:", (mpfr_prec_t) 1234567); + +is based on the output from glibc up to 2.36, which is incorrect: + + https://sourceware.org/bugzilla/show_bug.cgi?id=23432 + +The GNU C Library has apparently been partially fixed in its Git +repository for the future 2.37, since a tsprintf failure has been +reported (this is a bug in this test, not in the MPFR library): + + https://sympa.inria.fr/sympa/arc/mpfr/2023-01/msg00001.html + +So, modified the test to avoid the particular case of leading zeros +due to the precision field larger than the number of digits. This +case has already been tested without the thousands separator (where +there are no issues with the C libraries), so that we do not miss +much testing. Added a comment explaining the issue and a possible +solution for future testing of this particular case (if need be). +--- + tests/tsprintf.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/tests/tsprintf.c b/tests/tsprintf.c +index c68b2ba71..c0182503b 100644 +--- a/tests/tsprintf.c ++++ b/tests/tsprintf.c +@@ -1719,7 +1719,17 @@ test_locale (void) + check_sprintf ("000000001,000", "%'013.4Rg", x); + + #ifdef PRINTF_GROUPFLAG +- check_vsprintf ("+01,234,567 :", "%0+ -'13.10Pd:", (mpfr_prec_t) 1234567); ++ /* Do not test the thousands separator with a precision field larger ++ than the number of digits (thus needing leading zeros), such as ++ "%0+ -'13.10Pd:" (used up to MPFR 4.2.0), since the GNU libc is ++ buggy: https://sourceware.org/bugzilla/show_bug.cgi?id=23432 ++ We don't know about the other implementations. ++ If we wanted to check that and avoid a failure of the test because of ++ a buggy C library (while MPFR would be consistent with the C library), ++ we could compare the MPFR output with both the correct output and the ++ output from the C library (possibly buggy). But to do that in a clean ++ way, this would require a change in the check_vsprintf() call. */ ++ check_vsprintf ("+1,234,567 :", "%0+ -'13Pd:", (mpfr_prec_t) 1234567); + #endif + + mpfr_clear (x); +-- +2.33.0 + diff --git a/mpfr.spec b/mpfr.spec index f15e1573c1bdd661e4cc59a54850735f316c4968..9b9703190291976578af1dc411e7febb71417270 100644 --- a/mpfr.spec +++ b/mpfr.spec @@ -1,6 +1,6 @@ Name: mpfr -Version: 4.1.0 -Release: 3 +Version: 4.2.0 +Release: 2 Summary: A C library for multiple-precision floating-point computations URL: http://www.mpfr.org/ License: LGPLv3+ and GPLv3+ and GFDL-1.2-only @@ -10,6 +10,8 @@ Requires: gmp >= 4.2.3 Source0: http://www.mpfr.org/%{name}-%{version}/%{name}-%{version}.tar.xz +Patch1: mpfr-tests-tsprintf.c-Modified-a-buggy-test-of-the-thousa.patch + %description MPFR is a C library for arbitrary-precision binary floating-point computation with correct rounding, based on Multi-Precision Library. The computation is @@ -78,6 +80,12 @@ fi %{_libdir}/pkgconfig/mpfr.pc %changelog +* Fri Aug 4 2023 Wenyu Liu - 4.2.0-2 +- Modified a buggy test of the thousands separator. + +* Fri Aug 4 2023 Wenyu Liu - 4.2.0-1 +- update to 4.2.0 + * Thu Aug 4 2022 Chenyx - 4.1.0-3 - License compliance rectification