cole-trapnell-lab / cufflinks

Boost Software License 1.0
312 stars 116 forks source link

Please use std::fabs instead of just fabs in C++ to avoid conflicts #116

Open yurivict opened 5 years ago

yurivict commented 5 years ago

clang-8 compiler complains about fabs on BSDs:

In file included from codons.cpp:1:
In file included from ./codons.h:3:
In file included from ./GBase.h:13:
/usr/include/c++/v1/math.h:761:41: error: no member named 'fabsf' in the global namespace; did you mean 'fabs'?
abs(float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);}
                                      ~~^
/usr/include/math.h:255:8: note: 'fabs' declared here
double  fabs(double) __pure2;
        ^
In file included from codons.cpp:1:
In file included from ./codons.h:3:
In file included from ./GBase.h:13:
/usr/include/c++/v1/math.h:769:47: error: no member named 'fabsl' in the global namespace; did you mean 'fabs'?
abs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
                                            ~~^
/usr/include/math.h:255:8: note: 'fabs' declared here
double  fabs(double) __pure2;
        ^

Same with all other mathematical functions. They are safer when invoked from the std:: namespace.