mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:47:36 +00:00
WIP: build: Enable -Wunused #36167
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36167
Loading…
Reference in a new issue
No description provided.
Delete branch "enable_wunused"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We've had a handful of dead code removal PRs recently:
Also well as an instance of what was thought to be dead code, but it'd just been forgotten to be used: #36137.
It could be beneficial to get
-Wunusedenabled, to catch dead/unused code in CI.Enabling some of these flags may also help enforce other stuff, like
inline constexprusage (#35852). i.e:Based on:
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.
Conflicts
Reviewers, this pull request conflicts with the following ones:
avgfeeratekey ingetblockstatsby fanquake)[[noreturn]]by fanquake)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.
🚧 At least one of the CI tasks failed.
Task
lint: https://github.com/bitcoin/bitcoin/actions/runs/33884346846/job/101060370925LLM reason (✨ experimental): CI failed the
subtreelint check because a subtree directory was modified without the required subtree merge (FAIL: subtree directory was touched without subtree merge).Hints
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.
Nice, but I think those should:
Haven't tried this, but what about just a small pull to add:
And leave the
-Wno-unused-parameteras-is for now?Those should catch most of the issues mentioned in OP (except for the unused parameter ones)?
Split a portion out into #36275.
🐙 This pull request conflicts with the target branch and needs rebase.
This is a draft pull request, so Ralph reviewed only its concept. Code review runs on the first push after it is marked ready for review.
Earlier concerns neither republished nor resolved: 5 suggestions. See the Run archive linked from the Review report for their assessments.
Design and approach
Catching dead code and accidentally omitted uses through CI is worth pursuing, but this draft has not demonstrated additional detection sufficient to justify the broad cleanup. The submitted policy retains
-Wno-unused-parameter, while the baseline already requests broad and specific unused-code warnings. The historical overlap concern strengthens the need for evidence, without proving redundancy on every supported compiler.Before investing in detailed review, show an actionable mistake that the pinned base accepts but the submitted policy rejects on a supported CI compiler, alongside an intentional-non-use case that remains quiet. That would make the detection benefit assessable against annotation churn and compiler-dependent maintenance. If the intended benefit instead depends on enabling unused-parameter diagnostics later, state that scope explicitly. The current evidence does not establish that the approach should be abandoned.
Review coverage was incomplete.
Reviewed:
2322fd4802fb· Review report · Previous reportspermalink
still not sure about enabling the unused-param one. I think we want to use
selfhere more, not remove it. But using it would require touching this line again.Maybe some of the other warnings can be enabled https://github.com/bitcoin/bitcoin/pull/36167#discussion_r4025132623?
I'll split more of this out.
Are there any PRs currently doing this? I'll split more of this out.
Sure, see https://github.com/bitcoin/bitcoin/pull/36384
🐙 This pull request conflicts with the target branch and needs rebase.
can you split this one out? Possibly also -Wunused-macros (if meaningful, etc)?
Put them into #36509.
🐙 This pull request conflicts with the target branch and needs rebase.
🐙 This pull request conflicts with the target branch and needs rebase.
Also, for the context, I wonder if we can pipe it through
selfand then instead remove theJSONRPCRequestinstead ofRPCMethod:🐙 This pull request conflicts with the target branch and needs rebase.
🐙 This pull request conflicts with the target branch and needs rebase.
🐙 This pull request conflicts with the target branch and needs rebase.