Skip to content
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

Compilations warnings on OSX with clang #1461

Closed
urkle opened this issue Aug 22, 2015 · 2 comments
Closed

Compilations warnings on OSX with clang #1461

urkle opened this issue Aug 22, 2015 · 2 comments

Comments

@urkle
Copy link

urkle commented Aug 22, 2015

When compiling with clang on OS X this warning is produced. this should be std::abs (or fabs)

src/eval.cpp:34:50: warning: using integer absolute value function 'abs' when argument is of floating point type
      [-Wabsolute-value]
  inline double mod(double x, double y) { return abs(fmod(x, y)); } // x/0 checked by caller
                                                 ^
src/eval.cpp:34:50: note: use function 'std::abs' instead
  inline double mod(double x, double y) { return abs(fmod(x, y)); } // x/0 checked by caller
                                                 ^~~
                                                 std::abs
@xzyfer
Copy link
Contributor

xzyfer commented Aug 24, 2015

Although I cannot reproduce this on OSX I agree with the conclusion. In the future please provide enough system information for a reproduction.

$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

@xzyfer xzyfer modified the milestone: 3.3 Aug 24, 2015
@xzyfer xzyfer changed the title using int abs in method taking a double. Compilations warnings on OSX with clang Aug 24, 2015
@xzyfer xzyfer added this to the 3.3 milestone Aug 24, 2015
@xzyfer xzyfer mentioned this issue Aug 24, 2015
20 tasks
@urkle
Copy link
Author

urkle commented Aug 24, 2015

Will do.. Ideally I'd be including a patch as well :) FYI.. (Xcode 6.4)

$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer//usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.5.0
Thread model: posix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants