Skip to content

Commit 6751a32

Browse files
committed
iwyu: Fix warnings in src/bench and treat them as error
1 parent a6ed29d commit 6751a32

58 files changed

Lines changed: 211 additions & 100 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ci/test/03_test_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ fi
229229

230230
if [[ "${RUN_IWYU}" == true ]]; then
231231
# TODO: Consider enforcing IWYU across the entire codebase.
232-
FILES_WITH_ENFORCED_IWYU="/src/(((crypto|index|kernel|primitives|script|univalue/(lib|test)|util|zmq)/.*|bench/(block_assemble|connectblock)|common/license_info|node/(blockstorage|interfaces|miner|mining_args|utxo_snapshot)|rpc/mining|clientversion|core_io|signet|init)\\.cpp)"
232+
FILES_WITH_ENFORCED_IWYU="/src/(((bench|crypto|index|kernel|primitives|script|univalue/(lib|test)|util|zmq)/.*|common/license_info|node/(blockstorage|interfaces|miner|mining_args|utxo_snapshot)|rpc/mining|clientversion|core_io|signet|init)\\.cpp)"
233233
jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns)))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_errors.json"
234234
jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns) | not))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_warnings.json"
235235

src/addrman.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <hash.h>
1212
#include <logging/timer.h>
1313
#include <netaddress.h>
14+
#include <netgroup.h>
1415
#include <protocol.h>
1516
#include <random.h>
1617
#include <serialize.h>

src/addrman.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,22 @@
77
#define BITCOIN_ADDRMAN_H
88

99
#include <netaddress.h>
10-
#include <netgroup.h>
1110
#include <protocol.h>
12-
#include <streams.h>
1311
#include <util/time.h>
1412

13+
#include <cstddef>
1514
#include <cstdint>
15+
#include <ios>
1616
#include <memory>
1717
#include <optional>
18+
#include <string>
19+
#include <tuple>
1820
#include <unordered_set>
1921
#include <utility>
2022
#include <vector>
2123

24+
class NetGroupManager;
25+
2226
/** Over how many buckets entries with tried addresses from a single group (/16 for IPv4) are spread */
2327
static constexpr uint32_t ADDRMAN_TRIED_BUCKETS_PER_GROUP{8};
2428
/** Over how many buckets entries with new addresses originating from a single group are spread */

src/base58.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
#ifndef BITCOIN_BASE58_H
1515
#define BITCOIN_BASE58_H
1616

17-
#include <span.h>
18-
17+
#include <span>
1918
#include <string>
2019
#include <vector>
2120

src/bech32.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
#ifndef BITCOIN_BECH32_H
1515
#define BITCOIN_BECH32_H
1616

17+
#include <cstddef>
1718
#include <cstdint>
1819
#include <string>
20+
#include <utility>
1921
#include <vector>
2022

2123
namespace bech32

src/bench/addrman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
#include <netgroup.h>
1111
#include <protocol.h>
1212
#include <random.h>
13-
#include <span.h>
1413
#include <uint256.h>
1514
#include <util/check.h>
1615
#include <util/time.h>
1716

1817
#include <cstring>
1918
#include <optional>
19+
#include <span>
2020
#include <vector>
2121

2222
/* A "source" is a source address from which we have received a bunch of other addresses. */

src/bench/asmap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
#include <node/data/ip_asn.dat.h>
99
#include <random.h>
1010
#include <util/asmap.h>
11+
#include <util/check.h>
1112

1213
#include <algorithm>
1314
#include <array>
14-
#include <cassert>
1515
#include <span>
1616
#include <string>
1717

src/bench/base58.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#include <base58.h>
66
#include <bench/bench.h>
7-
#include <span.h>
87

98
#include <array>
109
#include <cstring>

src/bench/bech32.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <bench/bench.h>
77
#include <util/strencodings.h>
88

9+
#include <array>
910
#include <vector>
1011

1112
using namespace util::hex_literals;

src/bench/bench.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#include <test/util/setup_common.h> // IWYU pragma: keep
88
#include <util/check.h>
99
#include <util/fs.h>
10+
#include <util/time.h>
1011

11-
#include <chrono>
1212
#include <compare>
1313
#include <fstream>
1414
#include <functional>
@@ -19,8 +19,6 @@
1919
#include <utility>
2020
#include <vector>
2121

22-
using namespace std::chrono_literals;
23-
2422
/**
2523
* Retrieves the available test setup command line arguments that may be used
2624
* in the benchmark. They will be used only if the benchmark utilizes a

0 commit comments

Comments
 (0)