New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve ambiguous abs() call #439
Conversation
Signed-off-by: Christoph Willing <chris.willing@linux.com>
Codecov Report
@@ Coverage Diff @@
## develop #439 +/- ##
========================================
Coverage 42.37% 42.37%
========================================
Files 129 129
Lines 13276 13276
========================================
Hits 5626 5626
Misses 7650 7650
Continue to review full report at Codecov.
|
Hmmm. OOC, is the call still ambiguous if it's written as I have no objection to the use of What compiler/system gave you that error, BTW? Compiling with the various GCC and Clang versions in our CI matrix didn't flag it, interestingly. |
Yes the problem remains when using std::abs(). From the error msg the compiler seems to find only int abs(int) (from stdlib.h), or long int std::abs(long int) and long long int std::abs(long long int) (both from cstdlib). Since we want abs(double), using fabs() resolves the problem. It could be due to age of compiler gcc-g++-5.5.0 but we're stuck with that on Slackware 14.2 until release of 15.0 which has gcc-g++-9.2.0 (probably still some months away). Here's the full error message:
|
Huh... so odd that it still considers |
Signed-off-by: Christoph Willing chris.willing@linux.com
This resolves compilatin problem:
by using fabs(double) from cmath rather than trying abs(int) from stdlib.h or std::abs(long long int) from cstdlib