This PR continues the ongoing effort to enforce IWYU warnings.
See Developer Notes.
src/primitives and treat them as errors
#34352
This PR continues the ongoing effort to enforce IWYU warnings.
See Developer Notes.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34352.
See the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.
Reviewers, this pull request conflicts with the following ones:
src/zmq and treat them as errors by hebasto)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.
ACK fdc9fe2da6a8640b11a2871f8b653764652f8c1f
This PR fixes the src/primitives warnings as reported by iwyu on master:
0/home/admin/actions-runner/_work/_temp/src/primitives/transaction.h should add these lines:
1#include <compare> // for operator<
2
3/home/admin/actions-runner/_work/_temp/src/primitives/transaction.h should remove these lines:
4- #include <uint256.h> // lines 14-14
5
6/home/admin/actions-runner/_work/_temp/src/primitives/transaction.cpp should add these lines:
7#include <span> // for as_bytes, span
8
9/home/admin/actions-runner/_work/_temp/src/primitives/transaction.cpp should remove these lines:
10- #include <uint256.h> // lines 15-15
11
12
13/home/admin/actions-runner/_work/_temp/src/primitives/block.h should add these lines:
14#include <cinttypes> // for uint32_t, int64_t, int32_t
15#include <string> // for string
16#include <utility> // for move
17#include <vector> // for vector
18
19/home/admin/actions-runner/_work/_temp/src/primitives/block.h should remove these lines:
20
21
22/home/admin/actions-runner/_work/_temp/src/primitives/block.cpp should add these lines:
23#include <memory> // for shared_ptr
24#include <span> // for as_bytes
25#include <sstream> // for basic_stringstream, basic_ostream, operator<<, basic_ios, basic_iostream, basic_istream, stringstream
26
27/home/admin/actions-runner/_work/_temp/src/primitives/block.cpp should remove these lines:
There is one deviation from the suggestion from the tool, in src/primitives/block.h not <cinttypes> is included but <cstdint>. This deviation is preferable, this include is a subset of <cinttypes> and is the ‘correct’ choice for the project.
After these changes the iwyu does not warn anymore:
0(/home/admin/actions-runner/_work/_temp/src/primitives/transaction.h has correct #includes/fwd-decls)
1
2(/home/admin/actions-runner/_work/_temp/src/primitives/transaction_identifier.h has correct #includes/fwd-decls)
3
4(/home/admin/actions-runner/_work/_temp/src/primitives/transaction.cpp has correct #includes/fwd-decls)
5
6(/home/admin/actions-runner/_work/_temp/src/primitives/block.h has correct #includes/fwd-decls)
7
8(/home/admin/actions-runner/_work/_temp/src/primitives/transaction.h has correct #includes/fwd-decls)
9
10(/home/admin/actions-runner/_work/_temp/src/primitives/transaction_identifier.h has correct #includes/fwd-decls)
11
12(/home/admin/actions-runner/_work/_temp/src/primitives/block.cpp has correct #includes/fwd-decls)
13
14(/home/admin/actions-runner/_work/_temp/src/primitives/block.h has correct #includes/fwd-decls)
15
16(/home/admin/actions-runner/_work/_temp/src/primitives/transaction.h has correct #includes/fwd-decls)
17
18(/home/admin/actions-runner/_work/_temp/src/primitives/transaction_identifier.h has correct #includes/fwd-decls)
19
20(/home/admin/actions-runner/_work/_temp/src/primitives/block.h has correct #includes/fwd-decls)
21
22(/home/admin/actions-runner/_work/_temp/src/primitives/transaction.h has correct #includes/fwd-decls)
23
24(/home/admin/actions-runner/_work/_temp/src/primitives/transaction_identifier.h has correct #includes/fwd-decls)
also the folder is added to the iwyu enforcing list
review ACK fdc9fe2da6a8640b11a2871f8b653764652f8c1f 📀
Signature:
0untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
2trusted comment: review ACK fdc9fe2da6a8640b11a2871f8b653764652f8c1f 📀
3UB5Ype1A3WQdjfSaWb9SnYMwmdF45Ywya3AnUIggRLx85yULrAqgnuFbcjGPdknf4TpJfWFwPXoghJHe8dYXBw==
in the pull description, i think it is fine and sufficient to just link to https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#using-iwyu instead of all prior PRs
Thanks! Amended.