-
Notifications
You must be signed in to change notification settings - Fork 38.7k
fix util_tests.cpp clang warnings #6241
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
Conversation
|
I don't get it. Why do you need unsigned integer here? If these are truly outside the 64 bit signed integer range, these tests should not be passing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OH wait! This should be n == -9223372036854775808LL (missed the -). There should be no need to make it unsigned, though.
0fd0194 to
d0656d0
Compare
|
I really had my brain in "off mode" when i was writing this PR. I just added the same changes clang did warn about. Still get a warning: |
d0656d0 to
40c7bd6
Compare
|
I believe you need to use *_MIN are usually defined that way, anyway: # define LLONG_MIN (-LLONG_MAX - 1LL) |
So I'm starting to understand. The C compiler itself uses 64 bit integers internally, and it parses the token '9223372036854775808' not That means there is no way to represent the smallest integer without doing arithmetic, that's kind of stupid. But ok, fine with shutting up this warning, I just don't want another issue about this where it causes a warning in yet another compiler. |
was introduced with bitcoin#6121
40c7bd6 to
c946ebe
Compare
|
@theuni Okay. I see and understand this now better. Thanks. |
|
utACK |
|
Ok, thanks, it passes travis. Going to merge this. If there is another compiler that starts to complain about that line we're just going to ignore it. We're writing software for users, not to make compilers happy. |
c946ebe fix util_tests.cpp clang warnings (Jonas Schnelli)
…=<try> Convert entire source tree from json_spirit to UniValue This PR cherry-picks bitcoin/bitcoin#6121 and then migrates the Zcash-specific code to UniValue. Also cherry-picks: - bitcoin/bitcoin#6241 - bitcoin/bitcoin#6234 Closes #1985.
…=str4d Convert entire source tree from json_spirit to UniValue This PR cherry-picks bitcoin/bitcoin#6121 and then migrates the Zcash-specific code to UniValue. Also cherry-picks: - bitcoin/bitcoin#6241 - bitcoin/bitcoin#6234 Closes #1985.
was introduced with #6121.
Fixes two warnings: