Skip to content

Warn on and add missing [[noreturn]] - #35911

Draft
fanquake wants to merge 5 commits into
bitcoin:masterfrom
fanquake:missing_noreturn
Draft

fanquake wants to merge 5 commits into
bitcoin:masterfrom
fanquake:missing_noreturn

Conversation

@fanquake

@fanquake fanquake commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

Missing [[noreturn]] attributes can cause compiler false positives and other issues; see discussion in #35896 (comment). Add missing attributes, and turn on compiler warnings.

This produces C++23 related warnings under Clang:

[819/1115] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/threadpool_tests.cpp.o
../src/test/threadpool_tests.cpp:212:64: warning: an attribute specifier sequence in this position is a C++23 extension [-Wc++23-lambda-attributes]
  212 |         futures.emplace_back(Submit(threadPool, [&make_err, i] [[noreturn]] () {
      |                                                                ^
1 warning generated.

Related:
bitcoin-core/libmultiprocess#339.
bitcoin-core/leveldb-subtree#64.
arun11299/cpp-subprocess#132.

@DrahtBot

DrahtBot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

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

Code Coverage & Benchmarks

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

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
Concept ACK hebasto, stickies-v

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:

  • #bitcoin-core/gui/762 (Update about logo icon (colour) to denote the chain type of the QT instance in About/ Help Message Window/ Dialog by pablomartin4btc)
  • #36244 (validation, net: Process blocks asynchronously and reduce cs_main contention by w0xlt)
  • #36167 ([RFC] Enable -Wunused by fanquake)
  • #35932 (ipc: make ipc::disconnectIncoming wait for in-progress calls to complete by ryanofsky)
  • #35744 (coins: prevent DB resize from invalidating cursors by l0rinc)
  • #34132 (coins, dbwrapper: remove error catcher, make point-read failures fatal by l0rinc)
  • #32387 (ipc: add windows support by ryanofsky)
  • #29409 (multiprocess: Add capnp wrapper for Chain interface by ryanofsky)
  • #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.

@maflcko maflcko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. lgtm. Left some style nits, but feel free to ignore.

../src/test/fuzz/fuzz.cpp:239:26: warning: code will never be executed [-Wunreachable-code]

This looks like a compiler bug?

Comment thread src/test/util/setup_common.cpp Outdated
Comment thread src/test/threadpool_tests.cpp Outdated
Comment thread src/util/subprocess.h
@DrahtBot

DrahtBot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🚧 At least one of the CI tasks failed.
Task test ancestor commits: https://github.com/bitcoin/bitcoin/actions/runs/31089666107/job/92577355450
LLM reason (✨ experimental): CI failed at build time because clang with -Werror rejected fuzz test code in src/test/fuzz/fuzz.cpp (invalid noreturn function return and unreachable code).

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.

Comment thread src/test/fuzz/fuzz.cpp Outdated
@fanquake

fanquake commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

Opened bitcoin-core/leveldb-subtree#64 for the leveldb changes.

@DrahtBot

DrahtBot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🚧 At least one of the CI tasks failed.
Task lint: https://github.com/bitcoin/bitcoin/actions/runs/31093313597/job/92589235946
LLM reason (✨ experimental): CI failed because the lint check subtree detected that a subtree directory was modified without the required 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.

Comment thread CMakeLists.txt

@hebasto hebasto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

@hebasto hebasto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you submit commit 2b6dee1 in a separate PR? That way, we can review and land it sooner to unbreak the nightly CI.

@fanquake

fanquake commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

Could you submit commit 2b6dee1 in a separate PR?

It is part of #35896.

@DrahtBot

DrahtBot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🚧 At least one of the CI tasks failed.
Task lint: https://github.com/bitcoin/bitcoin/actions/runs/31164196113/job/92821231499
LLM reason (✨ experimental): CI failed because the linter’s “subtree” check detected modified subtree directories without a corresponding 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.

@stickies-v

Copy link
Copy Markdown
Contributor

Concept ACK

fanquake added a commit to fanquake/bitcoin that referenced this pull request Aug 12, 2026
I don't think there's a code path that can reach RunCommandParseJSON if
we compile with `-DENABLE_EXTERNAL_SIGNER=OFF`. This also requires more
workarounds in bitcoin#35911.
fanquake added a commit to fanquake/bitcoin that referenced this pull request Aug 12, 2026
I don't think there's a code path that can reach RunCommandParseJSON if
we compile with `-DENABLE_EXTERNAL_SIGNER=OFF`. This also requires more
workarounds in bitcoin#35911.
fanquake added a commit to fanquake/bitcoin that referenced this pull request Aug 14, 2026
I don't think there's a code path that can reach RunCommandParseJSON if
we compile with `-DENABLE_EXTERNAL_SIGNER=OFF`. This also requires more
workarounds in bitcoin#35911.

Co-authored-by: stickies-v <stickies-v@protonmail.com>
fanquake added a commit that referenced this pull request Aug 14, 2026
…SON`

8b5da67 common: remove ::runtime_error from RunCommandParseJSON (fanquake)

Pull request description:

  I don't think there's a code path that can reach `RunCommandParseJSON` if we compile with `ENABLE_EXTERNAL_SIGNER=OFF`. If there is a reason for having the code this way, it could  be good to document.

  This also requires more workarounds in #35911.

ACKs for top commit:
  stickies-v:
    re-ACK 8b5da67
  sedited:
    ACK 8b5da67
  willcl-ark:
    ACK 8b5da67

Tree-SHA512: b0c50372fed35afe47713310851f0b58cd1803fbe87a3a5a75877772172a3881283394a91663251de22a9972f56b46d84ddc868686dec8b970474cfaf5dc0d32
This was referenced Aug 14, 2026
@fanquake

Copy link
Copy Markdown
Member Author

Not sure it's worth trying to pull any changes out here, so this will remain drafted until the next libmultiprocess subtree update.

Comment thread src/test/fuzz/util/net.h
~FuzzedSock() override;

FuzzedSock& operator=(Sock&& other) override;
[[noreturn]] FuzzedSock& operator=(Sock&& other) override;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this still fails to compile on Windows for both clang-cl and MSVC? IIRC I tried this last week on godbolt and for some reason inlining the impl into the header worked around the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants