git: 18716b688cfb - 2024Q4 - math/givaro: fix build with clang 19
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 20 Nov 2024 08:50:17 UTC
The branch 2024Q4 has been updated by dim:
URL: https://cgit.FreeBSD.org/ports/commit/?id=18716b688cfbad2fcb3a34d6520d982b6aa3c13a
commit 18716b688cfbad2fcb3a34d6520d982b6aa3c13a
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-11-18 10:12:37 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-11-20 08:50:07 +0000
math/givaro: fix build with clang 19
Clang 19 has become more strict about errors in member functions, which
results in errors building math/givaro:
./givaro/givaro/givaro/random-integer.h:94:51: error: no viable overloaded '='
94 | const_cast<Integer_Domain&>(_ring)=R._ring;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
./givaro/givaro/givaro/random-integer.h:94:51: note: type 'Integer_Domain' (aka 'ZRing<Integer>') is incomplete
94 | const_cast<Integer_Domain&>(_ring)=R._ring;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from givintprime.C:19:
In file included from ./givaro/givintprime.h:24:
In file included from ./givaro/givaro/givinteger.h:25:
../../../src/kernel/ring/givaro/zring.h:123:13: warning: misleading indentation; statement is not part of the previous 'while' [-Wmisleading-indentation]
123 | return a; }
| ^
../../../src/kernel/ring/givaro/zring.h:121:11: note: previous statement is here
121 | { while (isZero(init(a, g())))
| ^
The `const_cast` line has been removed by upstream as part of
https://github.com/linbox-team/givaro/commit/b0cf33e1, but that commit
is rather large. It is enough to only delete the line.
Also fix a failure that occurs when running "make test":
../src/kernel/recint/rfiddling.h:170:29: error: no member named 'Low' in 'rint<K>'
This is because the expression `max.Low.Value` should actually be
`max.Value.Low`.
PR: 282830
Approved by: pi (maintainer)
MFH: 2024Q4
(cherry picked from commit b47d453f0aac2e1b349475f9e7fd44fde0a35d76)
---
math/givaro/files/patch-src_kernel_integer_random-integer.h | 10 ++++++++++
math/givaro/files/patch-src_kernel_recint_rfiddling.h | 11 +++++++++++
2 files changed, 21 insertions(+)
diff --git a/math/givaro/files/patch-src_kernel_integer_random-integer.h b/math/givaro/files/patch-src_kernel_integer_random-integer.h
new file mode 100644
index 000000000000..901ddd8ea8e3
--- /dev/null
+++ b/math/givaro/files/patch-src_kernel_integer_random-integer.h
@@ -0,0 +1,10 @@
+--- src/kernel/integer/random-integer.h.orig 2021-12-14 10:00:03 UTC
++++ src/kernel/integer/random-integer.h
+@@ -91,7 +91,6 @@ namespace Givaro
+ if (this != &R) {
+ _bits = R._bits;
+ _integer = R._integer;
+- const_cast<Integer_Domain&>(_ring)=R._ring;
+ }
+ return *this;
+ }
diff --git a/math/givaro/files/patch-src_kernel_recint_rfiddling.h b/math/givaro/files/patch-src_kernel_recint_rfiddling.h
new file mode 100644
index 000000000000..5591e9e210bf
--- /dev/null
+++ b/math/givaro/files/patch-src_kernel_recint_rfiddling.h
@@ -0,0 +1,11 @@
+--- src/kernel/recint/rfiddling.h.orig 2021-12-14 10:00:03 UTC
++++ src/kernel/recint/rfiddling.h
+@@ -167,7 +167,7 @@ namespace RecInt
+ template <size_t K>
+ inline rint<K> rint<K>::maxFFLAS() {
+ rint<K> max;
+- set_highest_bit(max.Low.Value);
++ set_highest_bit(max.Value.Low);
+ return max;
+ }
+