Fix compiler warnings emitted when compiling under stock OpenBSD 6.3#13294
Fix compiler warnings emitted when compiling under stock OpenBSD 6.3#13294laanwj merged 1 commit intobitcoin:masterfrom
Conversation
44d565f to
fb5ed74
Compare
src/random.cpp
Outdated
There was a problem hiding this comment.
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.
Updated. Please re-review :-)
fb5ed74 to
f86c2d9
Compare
src/txmempool.cpp
Outdated
There was a problem hiding this comment.
Might as well change childSizes into uint64_t child_sizes = 0; a few lines up.
There was a problem hiding this comment.
Good point! Updated. Please re-review! :-)
src/random.cpp
Outdated
There was a problem hiding this comment.
Could maybe benefit from a comment connecting this block with GetOSRand
There was a problem hiding this comment.
Good point. Added!
71f88d1 to
4ae2178
Compare
|
utACK 4ae2178 |
src/random.cpp
Outdated
There was a problem hiding this comment.
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.
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.
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
…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):