mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 11:38:37 +00:00
build: enable -Wunreachable-code-aggressive #36623
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!36623
Loading…
Reference in a new issue
No description provided.
Delete branch "unreachable_aggressive"
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?
Swap
-Wunreachable-codefor-Wunreachable-code-aggressive, which also enables-Wunreachable-code-returnand-Wunreachable-code-break.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.
If your review is incorrectly listed, please copy-paste
<!--meta-tag:bot-skip-->into the comment that the bot should ignore.Conflicts
Reviewers, this pull request conflicts with the following ones:
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.
No verified findings are available from this review.
Review coverage was incomplete.
Reviewed:
1f69c5cfdd9a· Full review report · Previous reportspermalink
It does appear that this is likely removable too.
🚧 At least one of the CI tasks failed.
Task
lint: https://github.com/bitcoin/bitcoin/actions/runs/39967612158/job/120461497226LLM reason (✨ experimental): CI failed the subtree lint check because the LevelDB and minisketch subtrees were modified without a 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.
Happy to do what reviewers prefer here.
FWIW the least worst solution to me seems to be removing the break together with the braces, so this
casegets formatting like thedefaultat the end:github.com/bitcoin/bitcoin@15ba42294e/src/script/interpreter.cpp (L1227-L1228)🐙 This pull request conflicts with the target branch and needs rebase.
OK I pointed Astra at this to try and get more guarantees around removal...
It compiled the interpreter translation unit before and after removing this
break, using GCC 15.3.0 and Clang 19.1.7 at both-O0and-O2(as we use in Guix builds), with assertions enabled.All four pairs produced byte-identical object files when preserving the newline. Deleting the whole line changed only assertion diagnostic line numbers.
Clanker's full report.
This further supports removing the unreachable
breakIMO.I might swap to that once rebased for #36783.
Rebased past #36783 and took @hodlinator's diff.
Now that I've taken the diff, I'm going to mark this as resolved, so review can restart in a clean thread.
ACK
1f69c5cfddReviewed the updated diff and had me clanker rerun GCC/Clang object comparisons at -O0 and -O2. The interpreter changes only assertion diagnostic line numbers, and preserving those gives byte-identical objects.
Also prefer hodlinator’s formatting in interpreter.cpp as the braces serve no scoping purpose and removing them makes the unconditional return clearer IMO.
ACK
1f69c5cfddcrACK
1f69c5cfddlgtm. Should be fine for this codebase, as we already require "unreachable" code to be marked with an abort instead of UB.
review ACK
1f69c5cfdd🐟Show signature
Signature:
Post-merge ACK
1f69c5cfddTrivial change: applying the following whitespace-only patch gives byte-identical assembly with GCC/Clang - can't be simpler than this.
Patch