Gecode / gecode

Generic Constraint Development Environment
https://www.gecode.org
Other
275 stars 76 forks source link

6.2.0: build fails with gcc 14.x #194

Closed kloczek closed 17 hours ago

kloczek commented 7 months ago

Looks like last version build fails with latest gcc 14.x which is now used in fedora rawhide.

Build fails with ```console [tkloczko@pers-jacek gecode-release-6.2.0]$ make -k make[1]: Entering directory '/home/tkloczko/rpmbuild/BUILD/gecode-release-6.2.0' make[1]: 'gecode/kernel/var-type.hpp' is up to date. make[1]: 'gecode/kernel/var-imp.hpp' is up to date. make[1]: 'libgecodesupport.so.49.0' is up to date. make[1]: 'libgecodekernel.so.49.0' is up to date. make[1]: 'libgecodesearch.so.49.0' is up to date. make[1]: 'libgecodeint.so.49.0' is up to date. make[1]: 'libgecodefloat.so.49.0' is up to date. /usr/bin/g++ -I. -fcx-limited-range -fno-signaling-nans -fno-rounding-math -ffinite-math-only -fno-math-errno -fno-strict-aliasing -O3 -fvisibility=hidden -ggdb -std=c++11 -fPIC -pthread -DNDEBUG -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security \ -c -o gecode/set/cardinality.o gecode/set/cardinality.cpp In file included from ./gecode/set/int.hh:296, from gecode/set/cardinality.cpp:39: ./gecode/set/int/weights.hpp: In member function ‘void Gecode::Set::Int::OverweightValues::init(int, Gecode::SharedArray&, Gecode::SharedArray&, I&)’: ./gecode/set/int/weights.hpp:127:16: error: no match for ‘operator=’ (operand types are ‘const Gecode::SharedArray’ and ‘Gecode::SharedArray’) 127 | elements = elements0; weights = weights0; | ^~~~~~~~~ In file included from ./gecode/kernel.hh:177, from ./gecode/set.hh:43, from gecode/set/cardinality.cpp:38: ./gecode/kernel/data/shared-array.hpp:163:18: note: candidate: ‘Gecode::SharedArray& Gecode::SharedArray::operator=(const Gecode::SharedArray&) [with T = int]’ (near match) 163 | SharedArray& operator =(const SharedArray&) = default; | ^~~~~~~~ ./gecode/kernel/data/shared-array.hpp:163:18: note: passing ‘const Gecode::SharedArray*’ as ‘this’ argument discards qualifiers ./gecode/set/int/weights.hpp:127:37: error: no match for ‘operator=’ (operand types are ‘const Gecode::SharedArray’ and ‘Gecode::SharedArray’) 127 | elements = elements0; weights = weights0; | ^~~~~~~~ ./gecode/kernel/data/shared-array.hpp:163:18: note: candidate: ‘Gecode::SharedArray& Gecode::SharedArray::operator=(const Gecode::SharedArray&) [with T = int]’ (near match) 163 | SharedArray& operator =(const SharedArray&) = default; | ^~~~~~~~ ./gecode/kernel/data/shared-array.hpp:163:18: note: passing ‘const Gecode::SharedArray*’ as ‘this’ argument discards qualifiers make[1]: *** [Makefile:1390: gecode/set/cardinality.o] Error 1 /usr/bin/g++ -I. -fcx-limited-range -fno-signaling-nans -fno-rounding-math -ffinite-math-only -fno-math-errno -fno-strict-aliasing -O3 -fvisibility=hidden -ggdb -std=c++11 -fPIC -pthread -DNDEBUG -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security \ -c -o gecode/set/rel.o gecode/set/rel.cpp In file included from ./gecode/set/int.hh:296, from gecode/set/rel.cpp:39: ./gecode/set/int/weights.hpp: In member function ‘void Gecode::Set::Int::OverweightValues::init(int, Gecode::SharedArray&, Gecode::SharedArray&, I&)’: ./gecode/set/int/weights.hpp:127:16: error: no match for ‘operator=’ (operand types are ‘const Gecode::SharedArray’ and ‘Gecode::SharedArray’) 127 | elements = elements0; weights = weights0; | ^~~~~~~~~ In file included from ./gecode/kernel.hh:177, from ./gecode/set.hh:43, from ./gecode/set/rel.hh:43, from gecode/set/rel.cpp:37: ./gecode/kernel/data/shared-array.hpp:163:18: note: candidate: ‘Gecode::SharedArray& Gecode::SharedArray::operator=(const Gecode::SharedArray&) [with T = int]’ (near match) 163 | SharedArray& operator =(const SharedArray&) = default; | ^~~~~~~~ ./gecode/kernel/data/shared-array.hpp:163:18: note: passing ‘const Gecode::SharedArray*’ as ‘this’ argument discards qualifiers ./gecode/set/int/weights.hpp:127:37: error: no match for ‘operator=’ (operand types are ‘const Gecode::SharedArray’ and ‘Gecode::SharedArray’) 127 | elements = elements0; weights = weights0; | ^~~~~~~~ ./gecode/kernel/data/shared-array.hpp:163:18: note: candidate: ‘Gecode::SharedArray& Gecode::SharedArray::operator=(const Gecode::SharedArray&) [with T = int]’ (near match) 163 | SharedArray& operator =(const SharedArray&) = default; | ^~~~~~~~ ./gecode/kernel/data/shared-array.hpp:163:18: note: passing ‘const Gecode::SharedArray*’ as ‘this’ argument discards qualifiers make[1]: *** [Makefile:1390: gecode/set/rel.o] Error 1 /usr/bin/g++ -I. -fcx-limited-range -fno-signaling-nans -fno-rounding-math -ffinite-math-only -fno-math-errno -fno-strict-aliasing -O3 -fvisibility=hidden -ggdb -std=c++11 -fPIC -pthread -DNDEBUG -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security \ -c -o gecode/set/int.o gecode/set/int.cpp In file included from ./gecode/set/int.hh:296, from gecode/set/int.cpp:38: ./gecode/set/int/weights.hpp: In member function ‘void Gecode::Set::Int::OverweightValues::init(int, Gecode::SharedArray&, Gecode::SharedArray&, I&)’: ./gecode/set/int/weights.hpp:127:16: error: no match for ‘operator=’ (operand types are ‘const Gecode::SharedArray’ and ‘Gecode::SharedArray’) 127 | elements = elements0; weights = weights0; | ^~~~~~~~~ In file included from ./gecode/kernel.hh:177, from ./gecode/set.hh:43, from gecode/set/int.cpp:36: ./gecode/kernel/data/shared-array.hpp:163:18: note: candidate: ‘Gecode::SharedArray& Gecode::SharedArray::operator=(const Gecode::SharedArray&) [with T = int]’ (near match) 163 | SharedArray& operator =(const SharedArray&) = default; | ^~~~~~~~ ./gecode/kernel/data/shared-array.hpp:163:18: note: passing ‘const Gecode::SharedArray*’ as ‘this’ argument discards qualifiers ./gecode/set/int/weights.hpp:127:37: error: no match for ‘operator=’ (operand types are ‘const Gecode::SharedArray’ and ‘Gecode::SharedArray’) 127 | elements = elements0; weights = weights0; | ^~~~~~~~ ./gecode/kernel/data/shared-array.hpp:163:18: note: candidate: ‘Gecode::SharedArray& Gecode::SharedArray::operator=(const Gecode::SharedArray&) [with T = int]’ (near match) 163 | SharedArray& operator =(const SharedArray&) = default; | ^~~~~~~~ ./gecode/kernel/data/shared-array.hpp:163:18: note: passing ‘const Gecode::SharedArray*’ as ‘this’ argument discards qualifiers make[1]: *** [Makefile:1390: gecode/set/int.o] Error 1 make[1]: Target 'libgecodeset.so.49.0' not remade because of errors. ```
janzizazizka commented 3 months ago

This is fixed with https://github.com/Gecode/gecode/commit/c810c96b1ce5d3692e93439f76c4fa7d3daf9fbb on the 6.3.0 release branch. You can cherry-pick the change to fix the problem.