-
Notifications
You must be signed in to change notification settings - Fork 37.8k
build: Disable deprecated-copy warning only when external warnings are enabled #22258
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
build: Disable deprecated-copy warning only when external warnings are enabled #22258
Conversation
Tested warnings-free on Focal with:
Also tested on Fedora 34 with clang and gcc. |
@fanquake (or someone else) Can you test this one please: #18738 (comment) |
Concept ACK |
fa9824c
to
1111457
Compare
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
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.
tACK 1111457
… external warnings are enabled 1111457 build: Disable deprecated-copy warning only when external warnings are enabled (MarcoFalke) Pull request description: Fixes bitcoin#18967 Alternative to bitcoin#22240 ACKs for top commit: fanquake: tACK 1111457 Tree-SHA512: 0fc826f26ebbeab662fa7eed2a5cc1630c6c4e612deb91734885fc8bae0352be657ec48ae94ff55a984ac36d27b95cea8d947cc5cf408231d56addecf79db83f
According to Clang 13.0.0 we have
cc @ajtowns the below fixes it: diff --git i/src/policy/rbf.cpp w/src/policy/rbf.cpp
index 8125b41c41..10859d256d 100644
--- i/src/policy/rbf.cpp
+++ w/src/policy/rbf.cpp
@@ -23,13 +23,13 @@ RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool)
}
// If all the inputs have nSequence >= maxint-1, it still might be
// signaled for RBF if any unconfirmed parents have signaled.
uint64_t noLimit = std::numeric_limits<uint64_t>::max();
std::string dummy;
- CTxMemPoolEntry entry = *pool.mapTx.find(tx.GetHash());
+ const CTxMemPoolEntry& entry = *pool.mapTx.find(tx.GetHash());
pool.CalculateMemPoolAncestors(entry, setAncestors, noLimit, noLimit, noLimit, noLimit, dummy, false);
for (CTxMemPool::txiter it : setAncestors) {
if (SignalsOptInRBF(it->GetTx())) {
return RBFTransactionState::REPLACEABLE_BIP125;
}
diff --git i/src/util/epochguard.h w/src/util/epochguard.h
index 1570ec4eb4..79c0abb4eb 100644
--- i/src/util/epochguard.h
+++ w/src/util/epochguard.h
@@ -42,12 +42,16 @@ public:
Epoch& operator=(const Epoch&) = delete;
bool guarded() const { return m_guarded; }
class Marker
{
+ public:
+ Marker() = default;
+ Marker(const Marker& other) = default;
+
private:
uint64_t m_marker = 0;
// only allow modification via Epoch member functions
friend class Epoch;
Marker& operator=(const Marker&) = delete; |
… external warnings are enabled 1111457 build: Disable deprecated-copy warning only when external warnings are enabled (MarcoFalke) Pull request description: Fixes bitcoin#18967 Alternative to bitcoin#22240 ACKs for top commit: fanquake: tACK 1111457 Tree-SHA512: 0fc826f26ebbeab662fa7eed2a5cc1630c6c4e612deb91734885fc8bae0352be657ec48ae94ff55a984ac36d27b95cea8d947cc5cf408231d56addecf79db83f
… external warnings are enabled 1111457 build: Disable deprecated-copy warning only when external warnings are enabled (MarcoFalke) Pull request description: Fixes bitcoin#18967 Alternative to bitcoin#22240 ACKs for top commit: fanquake: tACK 1111457 Tree-SHA512: 0fc826f26ebbeab662fa7eed2a5cc1630c6c4e612deb91734885fc8bae0352be657ec48ae94ff55a984ac36d27b95cea8d947cc5cf408231d56addecf79db83f
… external warnings are enabled 1111457 build: Disable deprecated-copy warning only when external warnings are enabled (MarcoFalke) Pull request description: Fixes bitcoin#18967 Alternative to bitcoin#22240 ACKs for top commit: fanquake: tACK 1111457 Tree-SHA512: 0fc826f26ebbeab662fa7eed2a5cc1630c6c4e612deb91734885fc8bae0352be657ec48ae94ff55a984ac36d27b95cea8d947cc5cf408231d56addecf79db83f
… external warnings are enabled 1111457 build: Disable deprecated-copy warning only when external warnings are enabled (MarcoFalke) Pull request description: Fixes bitcoin#18967 Alternative to bitcoin#22240 ACKs for top commit: fanquake: tACK 1111457 Tree-SHA512: 0fc826f26ebbeab662fa7eed2a5cc1630c6c4e612deb91734885fc8bae0352be657ec48ae94ff55a984ac36d27b95cea8d947cc5cf408231d56addecf79db83f
… external warnings are enabled 1111457 build: Disable deprecated-copy warning only when external warnings are enabled (MarcoFalke) Pull request description: Fixes bitcoin#18967 Alternative to bitcoin#22240 ACKs for top commit: fanquake: tACK 1111457 Tree-SHA512: 0fc826f26ebbeab662fa7eed2a5cc1630c6c4e612deb91734885fc8bae0352be657ec48ae94ff55a984ac36d27b95cea8d947cc5cf408231d56addecf79db83f
… external warnings are enabled 1111457 build: Disable deprecated-copy warning only when external warnings are enabled (MarcoFalke) Pull request description: Fixes bitcoin#18967 Alternative to bitcoin#22240 ACKs for top commit: fanquake: tACK 1111457 Tree-SHA512: 0fc826f26ebbeab662fa7eed2a5cc1630c6c4e612deb91734885fc8bae0352be657ec48ae94ff55a984ac36d27b95cea8d947cc5cf408231d56addecf79db83f
Fixes #18967
Alternative to #22240