linbox-team / fflas-ffpack

FFLAS-FFPACK - Finite Field Linear Algebra Subroutines / Package
http://linbox-team.github.io/fflas-ffpack/
GNU Lesser General Public License v2.1
57 stars 23 forks source link

invalid operands of types 'uint64_t' {aka 'long unsigned int'} and 'const Residu_t' {aka 'const float'} to binary 'operator%' #350

Closed d-torrance closed 2 years ago

d-torrance commented 2 years ago

I'm getting the following compilation errors building a Debian package for 2.5.0rc1, building against the givaro 4.2.0rc0 package that was recently uploaded to Debian experimental:

g++ -DHAVE_CONFIG_H -I. -I..  -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -march=native -Wall -DNDEBUG -UDEBUG     -g -g -O2 -ffile-prefix-map=/build/fflas-ffpack-2.5.0~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -c -o test-ftrsv.o test-ftrsv.C
In file included from /usr/include/givaro/givinteger.h:23,
                 from /usr/include/givaro/modular-balanced-double.h:16,
                 from /usr/include/givaro/modular-balanced.h:23,
                 from test-fscal.C:29:
/usr/include/givaro/givranditer.h: In instantiation of 'Givaro::GeneralRingRandIter<Ring>::Element& Givaro::GeneralRingRandIter<Ring>::operator()(Givaro::GeneralRingRandIter<Ring>::Element&) const [with Ring = Givaro::UnparametricZRing<float>; Givaro::GeneralRingRandIter<Ring>::Element = float]':
/usr/include/givaro/givranditer.h:308:36:   required from 'Givaro::GeneralRingRandIter<Ring>::Element& Givaro::GeneralRingRandIter<Ring>::random(Givaro::GeneralRingRandIter<Ring>::Element&) const [with Ring = Givaro::UnparametricZRing<float>; Givaro::GeneralRingRandIter<Ring>::Element = float]'
test-fscal.C:107:10:   required from 'bool test_fscal(const Field&, size_t, size_t, size_t, bool, uint64_t) [with Field = Givaro::ZRing<float>; size_t = long unsigned int; uint64_t = long unsigned int]'
test-fscal.C:254:29:   required from here
/usr/include/givaro/givranditer.h:304:52: error: invalid operands of types 'uint64_t' {aka 'long unsigned int'} and 'const Residu_t' {aka 'const float'} to binary 'operator%'
  304 |             return ring().init(a, _size?_givrand() % _size:_givrand());
      |                                         ~~~~~~~~~~~^~~~~~~
/usr/include/givaro/givranditer.h: In instantiation of 'Givaro::GeneralRingRandIter<Ring>::Element& Givaro::GeneralRingRandIter<Ring>::operator()(Givaro::GeneralRingRandIter<Ring>::Element&) const [with Ring = Givaro::UnparametricZRing<double>; Givaro::GeneralRingRandIter<Ring>::Element = double]':
/usr/include/givaro/givranditer.h:308:36:   required from 'Givaro::GeneralRingRandIter<Ring>::Element& Givaro::GeneralRingRandIter<Ring>::random(Givaro::GeneralRingRandIter<Ring>::Element&) const [with Ring = Givaro::UnparametricZRing<double>; Givaro::GeneralRingRandIter<Ring>::Element = double]'
test-fscal.C:107:10:   required from 'bool test_fscal(const Field&, size_t, size_t, size_t, bool, uint64_t) [with Field = Givaro::ZRing<double>; size_t = long unsigned int; uint64_t = long unsigned int]'
test-fscal.C:258:29:   required from here
/usr/include/givaro/givranditer.h:304:52: error: invalid operands of types 'uint64_t' {aka 'long unsigned int'} and 'const Residu_t' {aka 'const double'} to binary 'operator%'
In file included from /usr/include/givaro/givinteger.h:23,
                 from /usr/include/givaro/modular-balanced-double.h:16,
                 from /usr/include/givaro/modular-balanced.h:23,
                 from test-fadd.C:31:
/usr/include/givaro/givranditer.h: In instantiation of 'Givaro::GeneralRingRandIter<Ring>::Element& Givaro::GeneralRingRandIter<Ring>::operator()(Givaro::GeneralRingRandIter<Ring>::Element&) const [with Ring = Givaro::UnparametricZRing<float>; Givaro::GeneralRingRandIter<Ring>::Element = float]':
/usr/include/givaro/givranditer.h:308:36:   required from 'Givaro::GeneralRingRandIter<Ring>::Element& Givaro::GeneralRingRandIter<Ring>::random(Givaro::GeneralRingRandIter<Ring>::Element&) const [with Ring = Givaro::UnparametricZRing<float>; Givaro::GeneralRingRandIter<Ring>::Element = float]'
../fflas-ffpack/utils/fflas_randommatrix.h:98:26:   required from 'typename Field::Element_ptr FFPACK::RandomMatrix(const Field&, size_t, size_t, typename Field::Element_ptr, size_t, RandIter&) [with Field = Givaro::ZRing<float>; RandIter = Givaro::GeneralRingRandIter<Givaro::UnparametricZRing<float> >; typename Field::Element_ptr = float*; size_t = long unsigned int]'
test-fadd.C:59:23:   required from 'bool test_fadd(const Field&, size_t, size_t, size_t, bool, uint64_t) [with Field = Givaro::ZRing<float>; size_t = long unsigned int; uint64_t = long unsigned int]'
test-fadd.C:336:28:   required from here
/usr/include/givaro/givranditer.h:304:52: error: invalid operands of types 'uint64_t' {aka 'long unsigned int'} and 'const Residu_t' {aka 'const float'} to binary 'operator%'
  304 |             return ring().init(a, _size?_givrand() % _size:_givrand());
      |                                         ~~~~~~~~~~~^~~~~~~
/usr/include/givaro/givranditer.h: In instantiation of 'Givaro::GeneralRingRandIter<Ring>::Element& Givaro::GeneralRingRandIter<Ring>::operator()(Givaro::GeneralRingRandIter<Ring>::Element&) const [with Ring = Givaro::UnparametricZRing<double>; Givaro::GeneralRingRandIter<Ring>::Element = double]':
/usr/include/givaro/givranditer.h:308:36:   required from 'Givaro::GeneralRingRandIter<Ring>::Element& Givaro::GeneralRingRandIter<Ring>::random(Givaro::GeneralRingRandIter<Ring>::Element&) const [with Ring = Givaro::UnparametricZRing<double>; Givaro::GeneralRingRandIter<Ring>::Element = double]'
../fflas-ffpack/utils/fflas_randommatrix.h:98:26:   required from 'typename Field::Element_ptr FFPACK::RandomMatrix(const Field&, size_t, size_t, typename Field::Element_ptr, size_t, RandIter&) [with Field = Givaro::ZRing<double>; RandIter = Givaro::GeneralRingRandIter<Givaro::UnparametricZRing<double> >; typename Field::Element_ptr = double*; size_t = long unsigned int]'
test-fadd.C:59:23:   required from 'bool test_fadd(const Field&, size_t, size_t, size_t, bool, uint64_t) [with Field = Givaro::ZRing<double>; size_t = long unsigned int; uint64_t = long unsigned int]'
test-fadd.C:340:28:   required from here
/usr/include/givaro/givranditer.h:304:52: error: invalid operands of types 'uint64_t' {aka 'long unsigned int'} and 'const Residu_t' {aka 'const double'} to binary 'operator%'
make[5]: *** [Makefile:1271: test-fscal.o] Error 1
ClementPernet commented 2 years ago

Hi, This was fixed in 3409eee56 which happened after rc0 was cut, but will be in rc1, which should happen when linbox-team/givaro/#187 is fixed.

d-torrance commented 2 years ago

Thanks! I've updated the givaro package in Debian experimental with that commit and fflas-ffpack is now building.