Hi Andreas, On Thu, 3 Dec 2020 at 03:04, Andreas Tille <andr...@an3as.eu> wrote:
> Control: tags -1 help > > Hi, > > I guess this bug is relatively easy to fix by some explicit typing - but > I'm lacking the C++ knowledge to find out where. > Attaching a patch for this, it goes past this. However, the build-time tests fail on 32-bit arches - on exploring the test files, it looks like (with some confidence at least) that its due to large valued numbers in test files, which is (probably) beyond what a 32-bit arch can digest. Maybe it is sensible to disable tests (both build-time and autopkgtest) for that 32-bit arch, but I leave that up to you to check and decide :-) Kind regards Nilesh
--- a/include/jellyfish/rectangular_binary_matrix.hpp +++ b/include/jellyfish/rectangular_binary_matrix.hpp @@ -118,7 +118,7 @@ uint64_t *p = _columns; while(*p == 0 && p < _columns + _c) ++p; - return (p - _columns) == _c; + return static_cast<unsigned int>(p - _columns) == _c; } // Randomize the content of the matrix --- a/include/jellyfish/mer_dna.hpp +++ b/include/jellyfish/mer_dna.hpp @@ -693,7 +693,7 @@ char buffer[mer.k() + 1]; is.read(buffer, mer.k()); - if(is.gcount() != mer.k()) + if(static_cast<unsigned int>(is.gcount()) != mer.k()) goto error; buffer[mer.k()] = '\0'; if(!mer.from_chars(buffer)) --- a/unit_tests/test_mer_dna.cc +++ b/unit_tests/test_mer_dna.cc @@ -466,7 +466,7 @@ // Get bits by right-shifting typename TypeParam::Type cm(m); - for(unsigned int j = 1; j < start; j += 2) + for(unsigned long int j = 1; start>=0 && j < static_cast<unsigned int>(start); j += 2) cm.shift_right(0); // Shift by 2 bits typename TypeParam::Type::base_type y = cm.word(0); if(start & 0x1)