What changed, and why it matters
This commit is a routine maintenance update for Bitcoin Core's automated code-quality ('tidy') CI job. It upgrades the Clang compiler version used for style checks from 20 to 21 and adjusts several source files to satisfy new style warnings. There is no functional behavior change, no bug fix affecting consensus, networking, or wallets, and no security-relevant change.
No security action required. Treat as normal CI/tooling maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff updates ci/test/00_setup_env_native_tidy.sh to use LLVM/Clang 21 and IWYU 0.25. It then applies purely stylistic refactorings to suppress or fix new clang-tidy ‘modernize-use-default-member-init’ warnings: default member initializers replace constructor initializer lists in RecentRequestEntry, TransactionFilterProxy, CoinEntry, and CZMQAbstractNotifier. In interpreter.cpp, a NOLINTBEGIN/END block is added around two const bool members because the warning is identified as a false positive caused by a clang-tidy bug fixed in Clang 22 (llvm/llvm-project#160394). No logic, serialization, or consensus semantics are altered.
Changed components
ci/test/00_setup_env_native_tidy.shsrc/qt/recentrequeststablemodel.hsrc/qt/transactionfilterproxy.cppsrc/qt/transactionfilterproxy.hsrc/script/interpreter.cppsrc/txdb.cppsrc/zmq/zmqabstractnotifier.hInspect captured patch +12 / −11
diff --git a/ci/test/00_setup_env_native_tidy.sh b/ci/test/00_setup_env_native_tidy.sh
index c14e59b7..5a2fa300 100755
--- a/ci/test/00_setup_env_native_tidy.sh
+++ b/ci/test/00_setup_env_native_tidy.sh
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
export CONTAINER_NAME=ci_native_tidy
-export TIDY_LLVM_V="20"
+export TIDY_LLVM_V="21"
export APT_LLVM_V="${TIDY_LLVM_V}"
export PACKAGES="clang-${TIDY_LLVM_V} libclang-${TIDY_LLVM_V}-dev llvm-${TIDY_LLVM_V}-dev libomp-${TIDY_LLVM_V}-dev clang-tidy-${TIDY_LLVM_V} jq libevent-dev libboost-dev libzmq3-dev systemtap-sdt-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev libsqlite3-dev libcapnp-dev capnproto"
export NO_DEPENDS=1
diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h
index 151f8322..7a5b71c9 100644
--- a/src/qt/recentrequeststablemodel.h
+++ b/src/qt/recentrequeststablemodel.h
@@ -18,10 +18,10 @@ class WalletModel;
class RecentRequestEntry
{
public:
- RecentRequestEntry() : nVersion(RecentRequestEntry::CURRENT_VERSION) {}
+ RecentRequestEntry() = default;
static const int CURRENT_VERSION = 1;
- int nVersion;
+ int nVersion{RecentRequestEntry::CURRENT_VERSION};
int64_t id{0};
QDateTime date;
SendCoinsRecipient recipient;
diff --git a/src/qt/transactionfilterproxy.cpp b/src/qt/transactionfilterproxy.cpp
index 1ad77fd7..1f455576 100644
--- a/src/qt/transactionfilterproxy.cpp
+++ b/src/qt/transactionfilterproxy.cpp
@@ -12,9 +12,7 @@
#include <optional>
TransactionFilterProxy::TransactionFilterProxy(QObject* parent)
- : QSortFilterProxyModel(parent),
- m_search_string(),
- typeFilter(ALL_TYPES)
+ : QSortFilterProxyModel(parent)
{
}
diff --git a/src/qt/transactionfilterproxy.h b/src/qt/transactionfilterproxy.h
index d0f7031a..a8570c5b 100644
--- a/src/qt/transactionfilterproxy.h
+++ b/src/qt/transactionfilterproxy.h
@@ -44,7 +44,7 @@ private:
std::optional<QDateTime> dateFrom;
std::optional<QDateTime> dateTo;
QString m_search_string;
- quint32 typeFilter;
+ quint32 typeFilter{ALL_TYPES};
CAmount minAmount{0};
bool showInactive{true};
};
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp
index abd99fc3..57214838 100644
--- a/src/script/interpreter.cpp
+++ b/src/script/interpreter.cpp
@@ -1254,8 +1254,12 @@ private:
const CScript& scriptCode; //!< output script being consumed
const unsigned int nIn; //!< input index of txTo being signed
const bool fAnyoneCanPay; //!< whether the hashtype has the SIGHASH_ANYONECANPAY flag set
+ // Temporary workaround for a clang-tidy bug fixed in version 22.
+ // See: https://github.com/llvm/llvm-project/issues/160394.
+ // NOLINTBEGIN(modernize-use-default-member-init)
const bool fHashSingle; //!< whether the hashtype is SIGHASH_SINGLE
const bool fHashNone; //!< whether the hashtype is SIGHASH_NONE
+ // NOLINTEND(modernize-use-default-member-init)
public:
CTransactionSignatureSerializer(const T& txToIn, const CScript& scriptCodeIn, unsigned int nInIn, int nHashTypeIn) :
diff --git a/src/txdb.cpp b/src/txdb.cpp
index bb6ee2eb..93cd5948 100644
--- a/src/txdb.cpp
+++ b/src/txdb.cpp
@@ -38,8 +38,8 @@ namespace {
struct CoinEntry {
COutPoint* outpoint;
- uint8_t key;
- explicit CoinEntry(const COutPoint* ptr) : outpoint(const_cast<COutPoint*>(ptr)), key(DB_COIN) {}
+ uint8_t key{DB_COIN};
+ explicit CoinEntry(const COutPoint* ptr) : outpoint(const_cast<COutPoint*>(ptr)) {}
SERIALIZE_METHODS(CoinEntry, obj) { READWRITE(obj.key, obj.outpoint->hash, VARINT(obj.outpoint->n)); }
};
diff --git a/src/zmq/zmqabstractnotifier.h b/src/zmq/zmqabstractnotifier.h
index 17fa7bba..47132cd5 100644
--- a/src/zmq/zmqabstractnotifier.h
+++ b/src/zmq/zmqabstractnotifier.h
@@ -21,7 +21,6 @@ class CZMQAbstractNotifier
public:
static const int DEFAULT_ZMQ_SNDHWM {1000};
- CZMQAbstractNotifier() : outbound_message_high_water_mark(DEFAULT_ZMQ_SNDHWM) {}
virtual ~CZMQAbstractNotifier();
template <typename T>
@@ -61,7 +60,7 @@ protected:
void* psocket{nullptr};
std::string type;
std::string address;
- int outbound_message_high_water_mark; // aka SNDHWM
+ int outbound_message_high_water_mark{DEFAULT_ZMQ_SNDHWM}; // aka SNDHWM
};
#endif // BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.