[Debian-med-packaging] C++ help needed for spaced: call of overloaded 'abs(uint32_t&)' is ambiguous

Andreas Tille andreas at an3as.eu
Mon Jul 9 12:11:34 BST 2018


Hi,

I take the freedom to ask for some C++ help for the new version of
spaced[1]:

...
g++ -DHAVE_CONFIG_H -I. -I..   -Wall -Wextra -std=c++11 -Wno-char-subscripts -Wdate-time -D_FORTIFY_SOURCE=2 -fopenmp -g -O2 -fdebug-prefix-map=/build/spaced-1.2.0-201605+dfsg=. -fstack-protector-strong -       Wformat -Werror=format-security -c -o spaced-patternset.o `test -f 'patternset.cpp' || echo './'`patternset.cpp
...
patternset.cpp: In member function 'void patternset::CheckParams()':
patternset.cpp:187:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if(size < 0){
     ~~~~~^~~
patternset.cpp:188:23: error: call of overloaded 'abs(uint32_t&)' is ambiguous
   size = std::abs(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 patternset.h:24,
                 from patternset.cpp:21:
/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)
   ^~~
...


Any hint how to fix this?

Kind regards

       Andreas.


[1] https://salsa.debian.org/med-team/spaced

-- 
http://fam-tille.de



More information about the Debian-med-packaging mailing list