[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

No idea how to fix abs arguments in nanopolish



Hi,

to fix bug #853568 I tried a patch (gcc-7.patch) to fix abs() arguments
in nanopolish[1] but I have no idea how to deal with this:

...
g++ -o src/hmm/nanopolish_pore_model_set.o -c -g -O2 -fdebug-prefix-map=/build/nanopolish-0.5.0=. -fstack-protector-strong -Wformat -Werror=format-security -g -O3 -std=c++11 -fopenmp -Wdate-t
src/common/nanopolish_variant.cpp: In function 'std::vector<Variant> extract_variants(const string&, const string&)':
src/common/nanopolish_variant.cpp:32:69: error: call of overloaded 'abs(std::__cxx11::basic_string<char>::size_type)' is ambiguous
     size_t difference = std::abs(reference.size() - haplotype.size());
                                                                     ^
In file included from /usr/include/c++/7/cstdlib:77:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from src/common/nanopolish_variant.cpp:8:
/usr/include/c++/7/bits/std_abs.h:78:3: note: candidate: constexpr long double std::abs(long double)
   abs(long double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:74:3: note: candidate: constexpr float std::abs(float)
   abs(float __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:70:3: note: candidate: constexpr double std::abs(double)
   abs(double __x)
   ^~~
/usr/include/c++/7/bits/std_abs.h:61:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/include/c++/7/bits/std_abs.h:56:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from src/common/nanopolish_variant.cpp:8:
/usr/include/stdlib.h:735:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
Makefile:98: recipe for target 'src/common/nanopolish_variant.o' failed


Any idea how to patch this?

Kind regards

     Andreas.

[1] https://anonscm.debian.org/git/debian-med/nanopolish.git

-- 
http://fam-tille.de


Reply to: