From b6f859f54289bd8cf4471af9020183bce3782b388112c2f3f326833dead9a979 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 29 Nov 2023 01:09:09 +0000 Subject: [PATCH] - Add 0001-string-resolve-testsuite-failure-with-aarch64.patch OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libHX?expand=0&rev=123 --- ...solve-testsuite-failure-with-aarch64.patch | 38 +++++++++++++++++++ libHX.changes | 1 + 2 files changed, 39 insertions(+) create mode 100644 0001-string-resolve-testsuite-failure-with-aarch64.patch diff --git a/0001-string-resolve-testsuite-failure-with-aarch64.patch b/0001-string-resolve-testsuite-failure-with-aarch64.patch new file mode 100644 index 0000000..9c94c99 --- /dev/null +++ b/0001-string-resolve-testsuite-failure-with-aarch64.patch @@ -0,0 +1,38 @@ +From 763c993419a6d59e6d2e1d7d60bc8d23981b5a94 Mon Sep 17 00:00:00 2001 +From: Jan Engelhardt +Date: Tue, 28 Nov 2023 23:22:58 +0100 +Subject: [PATCH] string: resolve testsuite failure with aarch64 + +Fixes: v4.17-9-g323210d +--- + src/string.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/string.c b/src/string.c +index 11f3c9f..8e12b4a 100644 +--- a/src/string.c ++++ b/src/string.c +@@ -1030,8 +1030,19 @@ EXPORT_SYMBOL unsigned long long HX_strtoull_unit(const char *s, + errno = ERANGE; + return ULLONG_MAX; + } ++ /* ++ * https://eel.is/c++draft/conv.double#2: values ++ * unrepresentable in the target type (such as forcing -5.2f ++ * into a uint) is UB. Thus check for range and apply the ++ * negation after the conversion to ULL. ++ */ ++ if (q > ULLONG_MAX) { ++ errno = ERANGE; ++ return ULLONG_MAX; ++ } ++ unsigned long long r = q; + errno = 0; +- return neg ? -q : q; ++ return neg ? -r : r; + } + if (exponent == 0) + exponent = 1000; +-- +2.43.0 + diff --git a/libHX.changes b/libHX.changes index ef531e9..c8680b3 100644 --- a/libHX.changes +++ b/libHX.changes @@ -9,6 +9,7 @@ Mon Nov 27 11:25:47 UTC 2023 - Jan Engelhardt * string: HX_strtoull_units & HX_strtoull_(n)sec now set errno=ERANGE for nonrepresentable results * string: HX_strtoull_sec rejects unitless numbers now +- Add 0001-string-resolve-testsuite-failure-with-aarch64.patch ------------------------------------------------------------------- Sun Nov 12 11:09:23 UTC 2023 - Jan Engelhardt