- Move the "Assertions and Checks" section from "tips and tricks" (building and debugging) to "guidelines" (coding). (Can be reviewed via
--color-moved=dimmed-zebra) - Add missing point on
AssertUnreachableandNONFATAL_UNREACHABLEto the dev notes.
doc: AssertUnreachable and NONFATAL_UNREACHABLE #36952
pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2611-doc-Unreachable changing 2 files +35 −36-
maflcko commented at 2:02 PM on November 23, 2026: member
-
faab9adae4
doc: AssertUnreachable and NONFATAL_UNREACHABLE
* Move the "Assertions and Checks" section from "tips and tricks" to "guidelines". (Can be reviewed via --color-moved=dimmed-zebra) * Add missing point on AssertUnreachable and NONFATAL_UNREACHABLE. * Compress the NONFATAL_UNREACHABLE docstring.
- DrahtBot added the label Docs on Nov 23, 2026
-
DrahtBot commented at 2:02 PM on November 23, 2026: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
External sites
- Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36952
- Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36952.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36952#author-ralph
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline and AI policy for information on the review process.
Type Reviewers ACK hodlinator If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #36900 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36900.svg"></sub> (doc: document how to reference killed mutant by brunoerg)
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-->
- fanquake requested review from ryanofsky on Nov 23, 2026
-
in doc/developer-notes.md:698 in faab9adae4
693 | + but a failed assumption does not result in a fatal bug. A failed 694 | + assumption may or may not result in a slightly degraded user experience, 695 | + but it is safe to continue program execution. 696 | +* `AssertUnreachable()` should be used to mark code that can never be reached, 697 | + for example after a `switch` that handles every enum value. Like `Assert`, it 698 | + aborts if it is reached. `NONFATAL_UNREACHABLE()` is the counterpart for code
hodlinator commented at 9:38 AM on November 24, 2026:nit: I generally prefer including parens in function/macro references but they aren't used in the the rest of this section so could omit them for consistency.
* `AssertUnreachable` should be used to mark code that can never be reached, for example after a `switch` that handles every enum value. Like `Assert`, it aborts if it is reached. `NONFATAL_UNREACHABLE` is the counterpart for code
maflcko commented at 9:46 AM on November 24, 2026:I think from the context it should be clear that something is passed to the functions above. However, here it is cheap and could make sense to clarify nothing is passed.
So I think I'll leave as-is for now.
hodlinator approvedhodlinator commented at 9:39 AM on November 24, 2026: contributorACK faab9adae42d6182f455fb7fdbed1c6d9e41e797
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-11-30 03:50 UTC
More mirrored repositories can be found on mirror.b10c.me