-
Notifications
You must be signed in to change notification settings - Fork 99
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
Fix g++6 compile error #18
base: master
Are you sure you want to change the base?
Conversation
Hi @cryptokat thanks for the PR! If abs() doesn't link properly in g++ 6, I think the right move is to find the g++6 specific version of the function, and include it with ifdefs. Removing abs causes tests to fail: we do want the absolute value there. |
@vijay03 How does it make sense to use abs here when both a and b are unsigned? |
I might be missing something here, but even with unsigned, if b is greater than a, a - b results in a large number instead of the difference which we want. A hacky way to do this would be:
|
8d47945
to
cebee6e
Compare
this error would be emitted when compiling with g++6 ``` /pebblesdb/src/db/db_test.cc: In function ‘void leveldb::print_timer_info(std::__cxx11::string, uint64_t, uint64_t)’: /pebblesdb/src/db/db_test.cc:2237:25: error: call of overloaded ‘abs(uint64_t)’ is ambiguous uint64_t diff = abs(a-b); ```
cebee6e
to
ab673c0
Compare
It turns out that Here's a stack trace:
|
Thanks for catching this! Could you report this as an issue? |
this error would be emitted when compiling with g++6