Skip to content

Commit fe9bc5a

Browse files
hebastoMarcoFalke
and
MarcoFalke
committed
ci: Update Clang in "tidy" job
This change switches to the latest IWYU 0.23, which is compatible with Clang 19. Fixed new "modernize-use-starts-ends-with" warnings. The new "bugprone-use-after-move" warning in `result_tests.cpp` is a false positive caused by a bug in Boost.Test versions < 1.87. This has been addressed by introducing a local variable. See upstream references: - Issue: boostorg/test#343 - Fix: boostorg/test#348 Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^[email protected]>
1 parent e8cc790 commit fe9bc5a

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

ci/test/00_setup_env_native_tidy.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export LC_ALL=C.UTF-8
88

99
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04"
1010
export CONTAINER_NAME=ci_native_tidy
11-
export TIDY_LLVM_V="18"
11+
export TIDY_LLVM_V="19"
12+
export APT_LLVM_V="${TIDY_LLVM_V}"
1213
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 qtbase5-dev qttools5-dev qttools5-dev-tools libqrencode-dev libsqlite3-dev libdb++-dev"
1314
export NO_DEPENDS=1
1415
export RUN_UNIT_TESTS=false

src/core_read.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class OpCodeParser
3939
}
4040
mapOpNames[strName] = static_cast<opcodetype>(op);
4141
// Convenience: OP_ADD and just ADD are both recognized:
42-
if (strName.compare(0, 3, "OP_") == 0) { // strName starts with "OP_"
42+
if (strName.starts_with("OP_")) {
4343
mapOpNames[strName.substr(3)] = static_cast<opcodetype>(op);
4444
}
4545
}

src/test/result_tests.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ void ExpectSuccess(const util::Result<T>& result, const bilingual_str& str, Args
6363
{
6464
ExpectResult(result, true, str);
6565
BOOST_CHECK_EQUAL(result.has_value(), true);
66-
BOOST_CHECK_EQUAL(result.value(), T{std::forward<Args>(args)...});
66+
T expected{std::forward<Args>(args)...};
67+
BOOST_CHECK_EQUAL(result.value(), expected);
6768
BOOST_CHECK_EQUAL(&result.value(), &*result);
6869
}
6970

src/torcontrol.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ void TorController::get_socks_cb(TorControlConnection& _conn, const TorControlRe
356356
std::string socks_location;
357357
if (reply.code == 250) {
358358
for (const auto& line : reply.lines) {
359-
if (0 == line.compare(0, 20, "net/listeners/socks=")) {
359+
if (line.starts_with("net/listeners/socks=")) {
360360
const std::string port_list_str = line.substr(20);
361361
std::vector<std::string> port_list = SplitString(port_list_str, ' ');
362362

@@ -367,7 +367,7 @@ void TorController::get_socks_cb(TorControlConnection& _conn, const TorControlRe
367367
if (portstr.empty()) continue;
368368
}
369369
socks_location = portstr;
370-
if (0 == portstr.compare(0, 10, "127.0.0.1:")) {
370+
if (portstr.starts_with("127.0.0.1:")) {
371371
// Prefer localhost - ignore other ports
372372
break;
373373
}

src/wallet/walletdb.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ static DBErrors LoadAddressBookRecords(CWallet* pwallet, DatabaseBatch& batch) E
10131013
// "1" or "p" for present (which was written prior to
10141014
// f5ba424cd44619d9b9be88b8593d69a7ba96db26).
10151015
pwallet->LoadAddressPreviouslySpent(dest);
1016-
} else if (strKey.compare(0, 2, "rr") == 0) {
1016+
} else if (strKey.starts_with("rr")) {
10171017
// Load "rr##" keys where ## is a decimal number, and strValue
10181018
// is a serialized RecentRequestEntry object.
10191019
pwallet->LoadAddressReceiveRequest(dest, strKey.substr(2), strValue);

0 commit comments

Comments
 (0)