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

fixed abs() compilation for Android classpath on OSX #441

Merged
merged 2 commits into from
Jun 24, 2015

Conversation

bigfatbrowncat
Copy link
Contributor

Trying to build Android class path (avian-pack) on OS X. Having a problem:

src/classpath-android.cpp:1209:10: error: taking the absolute value of unsigned type 'uintptr_t' (aka 'unsigned long') has no effect [-Werror,-Wabsolute-value]
  return llabs(arguments[0]);
         ^
src/classpath-android.cpp:1209:10: note: remove the call to 'llabs' since unsigned values cannot be negative
  return llabs(arguments[0]);
         ^~~~~
src/classpath-android.cpp:1215:22: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value]
  return floatToBits(abs(bitsToFloat(arguments[0])));
                     ^
src/classpath-android.cpp:1215:22: note: use function 'std::abs' instead
  return floatToBits(abs(bitsToFloat(arguments[0])));
                     ^~~
                     std::abs
src/classpath-android.cpp:1215:22: note: include the header <cmath> or explicitly provide a declaration for 'std::abs'
2 errors generated.

This is the solution. Although we are not linking against standard library, we are using abs and llabs from it. Additionally i've fixed a nasty type conversion bug.

@bigfatbrowncat
Copy link
Contributor Author

That's strange... "Trace" test failed, but I changed nothing except classpath-android.cpp, so that shouldn't be my fault...

@dicej
Copy link
Member

dicej commented Jun 23, 2015

@bigfatbrowncat it's probably not your fault. See issue #429

@bigfatbrowncat
Copy link
Contributor Author

Fixed code just as you proposed. Thanks!

dicej added a commit that referenced this pull request Jun 24, 2015
fixed abs() compilation for Android classpath on OSX
@dicej dicej merged commit 0797665 into ReadyTalk:master Jun 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants