-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Fix compiler warnings emitted when compiling under stock OpenBSD 6.3 #13294
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
44d565f to
fb5ed74
Compare
src/random.cpp
Outdated
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.
I think we need to encode the full GetOSRand elif tree up to that point. i.e.:
#if !defined(WIN32) && (defined(HAVE_SYS_GETRANDOM) || !(defined(HAVE_GETENTROPY) && defined(__OpenBSD__)))
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.
Updated. Please re-review :-)
fb5ed74 to
f86c2d9
Compare
src/txmempool.cpp
Outdated
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.
Might as well change childSizes into uint64_t child_sizes = 0; a few lines up.
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.
Good point! Updated. Please re-review! :-)
src/random.cpp
Outdated
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.
Could maybe benefit from a comment connecting this block with GetOSRand
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.
Good point. Added!
71f88d1 to
4ae2178
Compare
|
utACK 4ae2178 |
src/random.cpp
Outdated
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.
This is correct but I... think this is somewhat overdoing it, creating an ifdef forest just to avoid a warning.
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.
This code just replicates the already existing #ifdef forest (implicit in the code below) but if we can avoid the warning in a smarter way I'm all ears. What method do you suggest using for avoiding the warning? :-)
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.
One option would be to forward-declare the method here and define it below based on a define that occurs inside the relevant #ifs.
|
@practicalswift Did you have any issues with |
|
@laanwj Would you be okay with the other non- |
Yes, my problem here is the duplicated #ifdef forest, the rest is fine... |
|
@practicalswift I don't think there's a need to split anything out of here. Probably easier to just drop the |
4ae2178 to
a426098
Compare
Nino84
left a comment
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.
Mute page
…k OpenBSD 6.3 a426098 Fix compiler warnings emitted when compiling under stock OpenBSD 6.3 (practicalswift) Pull request description: Fix compiler warnings emitted when compiling under stock OpenBSD 6.3 (OpenBSD clang version 5.0.1, based on LLVM 5.0.1): ``` random.cpp:182:13: warning: unused function 'GetDevURandom' [-Wunused-function] static void GetDevURandom(unsigned char *ent32) ^ txmempool.cpp:707:45: warning: comparison of integers of different signs: 'uint64_t' (aka 'unsigned long long') and 'long long' [-Wsign-compare] assert(it->GetSizeWithDescendants() >= childSizes + it->GetTxSize()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Tree-SHA512: da2ae86218054b10659ea694179433700ac91de8022e06007348168ed5adc3d8c4ad3b32a3fc5783a2cdf1ca7425aff586b839200dd3b226ebff72a7df15f120
Summary: Fix compiler warnings emitted when compiling under stock OpenBSD 6.3 (OpenBSD clang version 5.0.1, based on LLVM 5.0.1): Backport of Bitcoin Core PR13294 bitcoin/bitcoin#13294 Test Plan: `make check-all` is OK on my platform (Linux 5.2.15-200.fc30.x86_64 x86_64) I don't have an OpenBSD 6.3 to test it. It doesn't seem that the changes are going to have problems on it. Reviewers: Fabien, #bitcoin_abc, deadalnix, jasonbcox Reviewed By: #bitcoin_abc, jasonbcox Differential Revision: https://reviews.bitcoinabc.org/D4141
…er stock OpenBSD 6.3 a426098 Fix compiler warnings emitted when compiling under stock OpenBSD 6.3 (practicalswift) Pull request description: Fix compiler warnings emitted when compiling under stock OpenBSD 6.3 (OpenBSD clang version 5.0.1, based on LLVM 5.0.1): ``` random.cpp:182:13: warning: unused function 'GetDevURandom' [-Wunused-function] static void GetDevURandom(unsigned char *ent32) ^ txmempool.cpp:707:45: warning: comparison of integers of different signs: 'uint64_t' (aka 'unsigned long long') and 'long long' [-Wsign-compare] assert(it->GetSizeWithDescendants() >= childSizes + it->GetTxSize()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Tree-SHA512: da2ae86218054b10659ea694179433700ac91de8022e06007348168ed5adc3d8c4ad3b32a3fc5783a2cdf1ca7425aff586b839200dd3b226ebff72a7df15f120
…er stock OpenBSD 6.3 a426098 Fix compiler warnings emitted when compiling under stock OpenBSD 6.3 (practicalswift) Pull request description: Fix compiler warnings emitted when compiling under stock OpenBSD 6.3 (OpenBSD clang version 5.0.1, based on LLVM 5.0.1): ``` random.cpp:182:13: warning: unused function 'GetDevURandom' [-Wunused-function] static void GetDevURandom(unsigned char *ent32) ^ txmempool.cpp:707:45: warning: comparison of integers of different signs: 'uint64_t' (aka 'unsigned long long') and 'long long' [-Wsign-compare] assert(it->GetSizeWithDescendants() >= childSizes + it->GetTxSize()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Tree-SHA512: da2ae86218054b10659ea694179433700ac91de8022e06007348168ed5adc3d8c4ad3b32a3fc5783a2cdf1ca7425aff586b839200dd3b226ebff72a7df15f120
Fix compiler warnings emitted when compiling under stock OpenBSD 6.3 (OpenBSD clang version 5.0.1, based on LLVM 5.0.1):