Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

typecast abs() to long int to resolve ambiguity in g++ 7.3.0#102

Open
lmogil wants to merge 1 commit intogenome:masterfrom
lmogil:gcc-7.3.0-abs-typecast
Open

typecast abs() to long int to resolve ambiguity in g++ 7.3.0#102
lmogil wants to merge 1 commit intogenome:masterfrom
lmogil:gcc-7.3.0-abs-typecast

Conversation

@lmogil
Copy link

@lmogil lmogil commented Oct 30, 2018

I couldn't build without this change. Error message below.

bddata.cpp:192:38: error: call of overloaded 'abs(unsigned int)' is ambiguous
    if (abs(second.PosB - second.PosB1) > distance) {
                                      ^
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 bddata.cpp:1:
/usr/include/stdlib.h:837:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant