[RFC] Enable `-Wunused` #36167

pull fanquake wants to merge 7 commits into bitcoin:master from fanquake:enable_wunused changing 168 files +594 −577
  1. fanquake commented at 2:32 PM on September 4, 2026: member

    We've had a handful of dead code removal PRs over the last month or two:

    Also well as an instance of what was thought to be dead code, but it'd actually just been forgotten to be used: #36137.

    It could be beneficial to get -Wunused & related flags enabled, to catch dead/unused code in CI. A number of changes here need to go to subtrees:

    Enabling some of these flags may also help enforce other stuff, like inline constexpr usage (#35852). i.e:

      /home/runner/work/_temp/src/leveldb/db/dbformat.h:67:29: error: 'leveldb::kMaxSequenceNumber' defined but not used [-Werror=unused-const-variable=]
         67 | static const SequenceNumber kMaxSequenceNumber = ((0x1ull << 56) - 1);
            |                             ^~~~~~~~~~~~~~~~~~
    

    and there are some related changes here.

  2. DrahtBot commented at 2:32 PM on September 4, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36167.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #36182 (fees: return block_policy fee rate estimate when mempool_policy is not ready by ismaelsadeeq)
    • #36097 (mining: replace interrupt methods with cancellation arguments by xyzconstant)
    • #35998 (wallet: Handle or explicitly ignore WalletBatch write failures by achow101)
    • #35911 (Warn on and add missing [[noreturn]] by fanquake)
    • #35906 (First steps towards a stateless, side-effect free validation library by purpleKarrot)
    • #35760 (wallet: make corrupted transaction records fail wallet loading instead of forcing a rescan by achow101)
    • #35752 (wallet: make encryption state updates atomic by l0rinc)
    • #35744 (coins: prevent DB resize from invalidating cursors by l0rinc)
    • #35716 (wallet: Replace mapWallet and wtxOrdered with a boost::multi_index by achow101)
    • #35591 ([DO NOT MERGE] Erlay: bandwidth-efficient transaction relay protocol (Full implementation) by sr-gi)
    • #35322 (logging: streamline Logger state and drop redundant methods by ryanofsky)
    • #35301 (Silent Payments: Implement bip352 (take 2) by Eunovo)
    • #34520 (refactor: Add [[nodiscard]] to functions returning bool+mutable ref by maflcko)
    • #34038 (logging: replace -loglevel with -trace, expose trace logging via RPC by ajtowns)
    • #33324 (blocks: add resumable reobfuscation for existing block files by l0rinc)
    • #32387 (ipc: add windows support by ryanofsky)
    • #31507 (build: Use clang-cl to build on Windows natively by hebasto)
    • #30343 (wallet, logging: Replace WalletLogPrintf() with LogInfo() by ryanofsky)
    • #30342 (kernel, logging: Pass Logger instances to kernel objects by ryanofsky)
    • #29409 (multiprocess: Add capnp wrapper for Chain interface by ryanofsky)
    • #27865 (wallet: Track no-longer-spendable TXOs separately by achow101)
    • #19461 (multiprocess: Add bitcoin-gui -ipcconnect option by ryanofsky)
    • #19460 (multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky)
    • #10102 (Multiprocess bitcoin by ryanofsky)

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

    LLM Linter (✨ experimental)

    Possible typos and grammar issues:

    • serializeable -> serializable [misspelled word in the comment]

    <sup>2026-09-09 10:08:44</sup>

  3. DrahtBot added the label CI failed on Sep 4, 2026
  4. DrahtBot commented at 3:54 PM on September 4, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task lint: https://github.com/bitcoin/bitcoin/actions/runs/33884346846/job/101060370925</sub> <sub>LLM reason (✨ experimental): CI failed the subtree lint check because a subtree directory was modified without the required subtree merge (FAIL: subtree directory was touched without subtree merge).</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  5. fanquake force-pushed on Sep 4, 2026
  6. fanquake force-pushed on Sep 7, 2026
  7. [[nomerge]] leveldb: unused changes 406bb92322
  8. [[nomerge]] minisketch: unused changes 4637652122
  9. [[nomerge]] libmultiprocess changes 8b050c5f4d
  10. [[nomerge]] crc32c changes 7f7e6efd08
  11. refactor: fix -Wunused issues db9860574e
  12. build: add -Wunused and friends 68f5867156
  13. refactor: inline constexpr
    In file included from /home/runner/work/_temp/src/init/common.cpp:11:
    /home/runner/work/_temp/src/logging.h:66:24: error: ‘BCLog::RATELIMIT_MAX_BYTES’ defined but not used [-Werror=unused-const-variable=]
       66 |     constexpr uint64_t RATELIMIT_MAX_BYTES{1_MiB}; // maximum number of bytes per source location that can be logged within the RATELIMIT_WINDOW
          |                        ^~~~~~~~~~~~~~~~~~~
    cc1plus: all warnings being treated as errors
    6e5eb69ff6
  14. fanquake force-pushed on Sep 9, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-09-10 21:50 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me