Document FreeBSD quirk. Fix FreeBSD build: Use std::min<int>(...) to allow for compilation under certain FreeBSD versions.#13503
Conversation
|
So this was originally applied in #2695:
Then reverted in #9598 to:
Now we're re-adding (int) again but only for FreeBSD. I've just built master (3f398d7) successfully on a FreeBSD 11.1 VM, so I'm curious to know which version of FreeBSD this is broken on? Regardless of the above, the current patch doesn't compile: |
d0f7f6b to
2944db6
Compare
|
@fanquake @ken2812221 Sorry about the bashism :-) Not fixed! |
|
If this is fixed in FreeBSD 11.1 I'm not sure we have a problem to solve :-) |
|
Closing this temporarily while waiting for input from @anton48. If we can reproduce under FreeBSD 11.1 I'll re-open. |
|
@practicalswift @fanquake the source of the problem is not a version of FreeBSD itself, but version of clang. currently there are two production versions of FreeBSD: 11.1 and 10.4. former contains clang 4, latter clang 3.4. "new" code in init.cpp can be compiled with clang 4, but not with 3.4. @practicalswift your patch with "if defined(FreeBSD)" works for me at 10.3, 10.4 and 11.1. |
|
Agree with @fanquake. Having different code for each platform makes testing a nightmare. Btw. I believe you can specify the function template you want to call with |
2944db6 to
74a6179
Compare
74a6179 to
629a47a
Compare
|
@fanquake @MarcoFalke Thanks for reviewing. Feedback addressed. Please re-review :-) @anton48 Can you confirm that the updated version works as expected for you? |
|
@practicalswift by updated version you mean |
|
@anton48 Yes, that's the new version. Thanks for confirming. |
|
I'm confused. I build bitcoin core on FreeBSD all the time and have never needed this. |
|
The cast to int was only recently removed in master and I believe it only fails on FreeBSD 10, not 11. |
|
utACK 629a47a |
1 similar comment
|
utACK 629a47a |
|
utACK 629a47a for fixing the FreeBSD 10.x build. |
…<int>(...) to allow for compilation under certain FreeBSD versions. 629a47a Document FreeBSD quirk. Fix FreeBSD build. (practicalswift) Pull request description: * Document FreeBSD quirk. * Fix FreeBSD build: Cast to `int` to allow `std::min` to work under FreeBSD. Context: #9598 (comment) Tree-SHA512: 5ca7a5fa9e1f3efae241b9be64c9b019ec713c11dcc3edaaed383477ea48ac0dc82549ffebbe9069e8c3f6eff30acd6e4542b4aa31d307f022f4f51e5851a82c
…td::min<int>(...) to allow for compilation under certain FreeBSD versions. 629a47a Document FreeBSD quirk. Fix FreeBSD build. (practicalswift) Pull request description: * Document FreeBSD quirk. * Fix FreeBSD build: Cast to `int` to allow `std::min` to work under FreeBSD. Context: bitcoin#9598 (comment) Tree-SHA512: 5ca7a5fa9e1f3efae241b9be64c9b019ec713c11dcc3edaaed383477ea48ac0dc82549ffebbe9069e8c3f6eff30acd6e4542b4aa31d307f022f4f51e5851a82c
…<int>(...) to allow for compilation under certain FreeBSD versions. Summary: 629a47a Document FreeBSD quirk. Fix FreeBSD build. (practicalswift) Pull request description: * Document FreeBSD quirk. * Fix FreeBSD build: Cast to `int` to allow `std::min` to work under FreeBSD. Context: bitcoin/bitcoin#9598 (comment) Tree-SHA512: 5ca7a5fa9e1f3efae241b9be64c9b019ec713c11dcc3edaaed383477ea48ac0dc82549ffebbe9069e8c3f6eff30acd6e4542b4aa31d307f022f4f51e5851a82c Backport of Core [[bitcoin/bitcoin#13503 | PR13503]] Test Plan: ninja ninja check-all Repeat with FreeBSD build. Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D6481
…<int>(...) to allow for compilation under certain FreeBSD versions. Summary: 629a47a Document FreeBSD quirk. Fix FreeBSD build. (practicalswift) Pull request description: * Document FreeBSD quirk. * Fix FreeBSD build: Cast to `int` to allow `std::min` to work under FreeBSD. Context: bitcoin/bitcoin#9598 (comment) Tree-SHA512: 5ca7a5fa9e1f3efae241b9be64c9b019ec713c11dcc3edaaed383477ea48ac0dc82549ffebbe9069e8c3f6eff30acd6e4542b4aa31d307f022f4f51e5851a82c Backport of Core [[bitcoin/bitcoin#13503 | PR13503]] Test Plan: ninja ninja check-all Repeat with FreeBSD build. Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D6481
…td::min<int>(...) to allow for compilation under certain FreeBSD versions. 629a47a Document FreeBSD quirk. Fix FreeBSD build. (practicalswift) Pull request description: * Document FreeBSD quirk. * Fix FreeBSD build: Cast to `int` to allow `std::min` to work under FreeBSD. Context: bitcoin#9598 (comment) Tree-SHA512: 5ca7a5fa9e1f3efae241b9be64c9b019ec713c11dcc3edaaed383477ea48ac0dc82549ffebbe9069e8c3f6eff30acd6e4542b4aa31d307f022f4f51e5851a82c
ee7891a doc: Remove outdated comments (Hennadii Stepanov) Pull request description: The first removed comment was introduced in #5288, the second one in #13503. Both are outdated since #14336. ACKs for top commit: duncandean: crACK ee7891a Tree-SHA512: a2d6071919e81c916bfc2178109bbc464417321bcc567ed0644448c5faea8e58cb08a7657afa1b6ffe1fb63e114a2a47b31c893e471839ba9d49a3986e68b2a7
ee7891a doc: Remove outdated comments (Hennadii Stepanov) Pull request description: The first removed comment was introduced in bitcoin#5288, the second one in bitcoin#13503. Both are outdated since bitcoin#14336. ACKs for top commit: duncandean: crACK ee7891a Tree-SHA512: a2d6071919e81c916bfc2178109bbc464417321bcc567ed0644448c5faea8e58cb08a7657afa1b6ffe1fb63e114a2a47b31c893e471839ba9d49a3986e68b2a7
…td::min<int>(...) to allow for compilation under certain FreeBSD versions. 629a47a Document FreeBSD quirk. Fix FreeBSD build. (practicalswift) Pull request description: * Document FreeBSD quirk. * Fix FreeBSD build: Cast to `int` to allow `std::min` to work under FreeBSD. Context: bitcoin#9598 (comment) Tree-SHA512: 5ca7a5fa9e1f3efae241b9be64c9b019ec713c11dcc3edaaed383477ea48ac0dc82549ffebbe9069e8c3f6eff30acd6e4542b4aa31d307f022f4f51e5851a82c
intto allowstd::minto work under FreeBSD.Context: #9598 (comment)