Skip to content

Commit db5d000

Browse files
Merge #6638: fix: resolve or sidestep compiler warnings, re-enable -Werror for Clang, merge bitcoin#13633
c7748cd revert: don't build using `-Werror` when using Clang (Kittywhiskers Van Gogh) 1015f9b fix: resolve `-Wunreachable-code` warnings, add comment for explanation (Kittywhiskers Van Gogh) 10cb3e4 fix: resolve `-Wlogical-op-parentheses` warnings (Kittywhiskers Van Gogh) 7459b1e fix: resolve `-Wunused-private-field` warnings (Kittywhiskers Van Gogh) 7a52083 fix: resolve `-Wmissing-field-initializers` warnings (Kittywhiskers Van Gogh) 184b463 fix: resolve `-Wdelete-non-abstract-non-virtual-dtor` warnings (Kittywhiskers Van Gogh) 53d29e9 fix: sidestep `-Wunused-function` warnings with `[[maybe_unused]]` (Kittywhiskers Van Gogh) 9315e69 move-only: keep functions used in wallet-enabled segments within macro (Kittywhiskers Van Gogh) 6729d69 fix: add missing lock annotation in lambda expression (Kittywhiskers Van Gogh) f6d1eb9 chore: drop extraneous unused `ApplyStats()` definition (Kittywhiskers Van Gogh) df9c926 chore: drop unused `EraseOldDBData()` (Kittywhiskers Van Gogh) c9cb9a6 merge bitcoin#13633: Drop dead code from Stacks (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * Depends on #6637 * Dependency for #6639 * While [bitcoin#13633](bitcoin#13633) was originally marked as DNM in the backports spreadsheet for being SegWit-related, it's not SegWit-_dependent_ and is for dead code removal, which is necessary due to the enforcement of `-Wunused-function`. It has therefore been included. * `EraseOldDBData()` fell into disuse after [dash#6579](#6579) but wasn't removed then. It has been removed now due to `-Wunused-function` enforcement. * An extraneous `ApplyStats()` definition was left over when backporting [bitcoin#19145](bitcoin#19145). It has been removed now due to `-Wunused-function` enforcement. * [bitcoin#25337](bitcoin#25337) ([commit](a7d4127)) did not include a lock annotation for the lambda expression in `ListReceived()`. It has been added alongside `AssertLockHeld`s for both the lambda expression and the function. This was done to pass `-Wthread-safety` enforcement. * `ParsePubKeyIDFromAddress()`, `ParseBLSPubKey()` and `ValidatePlatformPort()` have been moved inside the `ENABLE_WALLET` macro conditional to avoid `-Wunused-function` warnings if building with wallets disabled. * Some dead code cannot be removed because they are either part of partial backports that may be completed in the future or complicate backports in the future that may expect their presence. To keep `-Wunused-function` happy, they have been marked with `[[maybe_unused]]` and this annotation should be removed when they are used. ## Breaking Changes None expected. ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)** - [x] I have made corresponding changes to the documentation **(note: N/A)** - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK c7748cd PastaPastaPasta: utACK c7748cd Tree-SHA512: 5d746773a1f49c33f373250ba459a5da4301fea0cb5202d26717808d8a4985920cbdfec0903ed884f20561f8d40082b4ea796e78912bacff00e0645d355ec9f2
2 parents 90ea1da + c7748cd commit db5d000

27 files changed

+58
-109
lines changed

ci/test/00_setup_env_mac.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ export RUN_UNIT_TESTS=false
1515
export RUN_FUNCTIONAL_TESTS=false
1616
export GOAL="all deploy"
1717
export BITCOIN_CONFIG="--with-gui --enable-reduce-exports --disable-miner --with-boost-process"
18-
export NO_WERROR=1

ci/test/00_setup_env_native_fuzz.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ export RUN_FUNCTIONAL_TESTS=false
1616
export RUN_FUZZ_TESTS=true
1717
export GOAL="install"
1818
export BITCOIN_CONFIG="--enable-zmq --disable-ccache --enable-fuzz --with-sanitizers=fuzzer,address,undefined,integer CC='clang-18 -ftrivial-auto-var-init=pattern' CXX='clang++-18 -ftrivial-auto-var-init=pattern' --with-boost-process"
19-
export NO_WERROR=1

ci/test/00_setup_env_native_multiprocess.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ export BITCOIN_CONFIG="--with-boost-process --enable-debug CC=clang-18 CXX=clang
1717
# Additional flags for RUN_TIDY
1818
export BITCOIN_CONFIG="${BITCOIN_CONFIG} --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0 -Wno-error=documentation'"
1919
export BITCOIND=dash-node # Used in functional tests
20-
export NO_WERROR=1

ci/test/00_setup_env_native_tsan.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ export GOAL="install"
1515
export BITCOIN_CONFIG="--enable-zmq --with-sanitizers=thread CC=clang-18 CXX=clang++-18 CXXFLAGS='-g' --with-boost-process"
1616
export CPPFLAGS="-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION"
1717
export PYZMQ=true
18-
export NO_WERROR=1

ci/test/00_setup_env_native_ubsan.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ export DEP_OPTS="NO_UPNP=1 DEBUG=1"
1313
export GOAL="install"
1414
export BITCOIN_CONFIG="--enable-zmq --enable-reduce-exports --enable-crash-hooks --with-sanitizers=undefined CC=clang-18 CXX=clang++-18"
1515
export PYZMQ=true
16-
export NO_WERROR=1

ci/test/00_setup_env_native_valgrind.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ export NO_DEPENDS=1
1212
export TEST_RUNNER_EXTRA="--exclude rpc_bind,feature_bind_extra --timeout-factor=4" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547
1313
export GOAL="install"
1414
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no CC=clang-18 CXX=clang++-18" # TODO enable GUI
15-
export NO_WERROR=1

src/coinjoin/client.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ PeerMsgRet CCoinJoinClientQueueManager::ProcessDSQueue(const CNode& peer, CConnm
105105

106106
// if the queue is ready, submit if we can
107107
if (dsq.fReady &&
108-
m_walletman.ForAnyCJClientMan([this, &connman, &dmn](std::unique_ptr<CCoinJoinClientManager>& clientman) {
108+
m_walletman.ForAnyCJClientMan([&connman, &dmn](std::unique_ptr<CCoinJoinClientManager>& clientman) {
109109
return clientman->TrySubmitDenominate(dmn->proTxHash, connman);
110110
})) {
111111
LogPrint(BCLog::COINJOIN, "DSQUEUE -- CoinJoin queue is ready, masternode=%s, queue=%s\n", dmn->proTxHash.ToString(), dsq.ToString());
@@ -161,14 +161,12 @@ void CCoinJoinClientManager::ProcessMessage(CNode& peer, CChainState& active_cha
161161
}
162162
}
163163

164-
CCoinJoinClientSession::CCoinJoinClientSession(const std::shared_ptr<CWallet>& wallet, CoinJoinWalletManager& walletman,
165-
CCoinJoinClientManager& clientman, CDeterministicMNManager& dmnman,
166-
CMasternodeMetaMan& mn_metaman, const CMasternodeSync& mn_sync,
167-
const llmq::CInstantSendManager& isman,
164+
CCoinJoinClientSession::CCoinJoinClientSession(const std::shared_ptr<CWallet>& wallet, CCoinJoinClientManager& clientman,
165+
CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_metaman,
166+
const CMasternodeSync& mn_sync, const llmq::CInstantSendManager& isman,
168167
const std::unique_ptr<CCoinJoinClientQueueManager>& queueman,
169168
bool is_masternode) :
170169
m_wallet(wallet),
171-
m_walletman(walletman),
172170
m_clientman(clientman),
173171
m_dmnman(dmnman),
174172
m_mn_metaman(mn_metaman),
@@ -998,8 +996,7 @@ bool CCoinJoinClientManager::DoAutomaticDenominating(ChainstateManager& chainman
998996
AssertLockNotHeld(cs_deqsessions);
999997
LOCK(cs_deqsessions);
1000998
if (int(deqSessions.size()) < CCoinJoinClientOptions::GetSessions()) {
1001-
deqSessions.emplace_back(m_wallet, m_walletman, *this, m_dmnman, m_mn_metaman, m_mn_sync, m_isman, m_queueman,
1002-
m_is_masternode);
999+
deqSessions.emplace_back(m_wallet, *this, m_dmnman, m_mn_metaman, m_mn_sync, m_isman, m_queueman, m_is_masternode);
10031000
}
10041001
for (auto& session : deqSessions) {
10051002
if (!CheckAutomaticBackup()) return false;
@@ -1905,9 +1902,8 @@ void CoinJoinWalletManager::Add(const std::shared_ptr<CWallet>& wallet)
19051902
{
19061903
LOCK(cs_wallet_manager_map);
19071904
m_wallet_manager_map.try_emplace(wallet->GetName(),
1908-
std::make_unique<CCoinJoinClientManager>(wallet, *this, m_dmnman, m_mn_metaman,
1909-
m_mn_sync, m_isman, m_queueman,
1910-
m_is_masternode));
1905+
std::make_unique<CCoinJoinClientManager>(wallet, m_dmnman, m_mn_metaman, m_mn_sync,
1906+
m_isman, m_queueman, m_is_masternode));
19111907
}
19121908

19131909
void CoinJoinWalletManager::DoMaintenance(CConnman& connman)

src/coinjoin/client.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ class CCoinJoinClientSession : public CCoinJoinBaseSession
139139
{
140140
private:
141141
const std::shared_ptr<CWallet> m_wallet;
142-
CoinJoinWalletManager& m_walletman;
143142
CCoinJoinClientManager& m_clientman;
144143
CDeterministicMNManager& m_dmnman;
145144
CMasternodeMetaMan& m_mn_metaman;
@@ -201,10 +200,9 @@ class CCoinJoinClientSession : public CCoinJoinBaseSession
201200
void SetNull() override EXCLUSIVE_LOCKS_REQUIRED(cs_coinjoin);
202201

203202
public:
204-
explicit CCoinJoinClientSession(const std::shared_ptr<CWallet>& wallet, CoinJoinWalletManager& walletman,
205-
CCoinJoinClientManager& clientman, CDeterministicMNManager& dmnman,
206-
CMasternodeMetaMan& mn_metaman, const CMasternodeSync& mn_sync,
207-
const llmq::CInstantSendManager& isman,
203+
explicit CCoinJoinClientSession(const std::shared_ptr<CWallet>& wallet, CCoinJoinClientManager& clientman,
204+
CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_metaman,
205+
const CMasternodeSync& mn_sync, const llmq::CInstantSendManager& isman,
208206
const std::unique_ptr<CCoinJoinClientQueueManager>& queueman, bool is_masternode);
209207

210208
void ProcessMessage(CNode& peer, CChainState& active_chainstate, CConnman& connman, const CTxMemPool& mempool, std::string_view msg_type, CDataStream& vRecv);
@@ -266,7 +264,6 @@ class CCoinJoinClientManager
266264
{
267265
private:
268266
const std::shared_ptr<CWallet> m_wallet;
269-
CoinJoinWalletManager& m_walletman;
270267
CDeterministicMNManager& m_dmnman;
271268
CMasternodeMetaMan& m_mn_metaman;
272269
const CMasternodeSync& m_mn_sync;
@@ -305,12 +302,11 @@ class CCoinJoinClientManager
305302
CCoinJoinClientManager(CCoinJoinClientManager const&) = delete;
306303
CCoinJoinClientManager& operator=(CCoinJoinClientManager const&) = delete;
307304

308-
explicit CCoinJoinClientManager(const std::shared_ptr<CWallet>& wallet, CoinJoinWalletManager& walletman,
309-
CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_metaman,
310-
const CMasternodeSync& mn_sync, const llmq::CInstantSendManager& isman,
305+
explicit CCoinJoinClientManager(const std::shared_ptr<CWallet>& wallet, CDeterministicMNManager& dmnman,
306+
CMasternodeMetaMan& mn_metaman, const CMasternodeSync& mn_sync,
307+
const llmq::CInstantSendManager& isman,
311308
const std::unique_ptr<CCoinJoinClientQueueManager>& queueman, bool is_masternode) :
312309
m_wallet(wallet),
313-
m_walletman(walletman),
314310
m_dmnman(dmnman),
315311
m_mn_metaman(mn_metaman),
316312
m_mn_sync(mn_sync),

src/coinjoin/coinjoin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ class CCoinJoinBaseSession
317317
int nSessionDenom{0}; // Users must submit a denom matching this
318318

319319
CCoinJoinBaseSession() = default;
320+
virtual ~CCoinJoinBaseSession() = default;
320321

321322
int GetState() const { return nState; }
322323
std::string GetStateString() const;

src/evo/creditpool.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@ CCreditPoolManager::CCreditPoolManager(CEvoDB& _evoDb)
235235
{
236236
}
237237

238-
CCreditPoolDiff::CCreditPoolDiff(CCreditPool starter, const CBlockIndex *pindexPrev, const Consensus::Params& consensusParams, const CAmount blockSubsidy) :
238+
CCreditPoolDiff::CCreditPoolDiff(CCreditPool starter, const CBlockIndex* pindexPrev,
239+
const Consensus::Params& consensusParams, const CAmount blockSubsidy) :
239240
pool(std::move(starter)),
240-
pindexPrev(pindexPrev),
241-
params(consensusParams)
241+
pindexPrev(pindexPrev)
242242
{
243243
assert(pindexPrev);
244244

0 commit comments

Comments
 (0)