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

Open
fanquake wants to merge 4 commits from missing_noreturn into master AGit
fanquake commented 2026-08-06 09:34:14 +00:00 (Migrated from github.com)
Missing `[[noreturn]]` attributes can cause compiler false positives and other issues; see discussion in https://github.com/bitcoin/bitcoin/pull/35896#discussion_r3726612556. Add missing attributes, and turn on compiler warnings. Some `[[noreturn]]` additions may appear redundant, however they suppress warnings for various compiler versions, see discussion in https://github.com/bitcoin/bitcoin/pull/35911#discussion_r4658191746, and could be dropped in future, when support for those compilers is removed. Related: https://github.com/bitcoin-core/libmultiprocess/pull/339. https://github.com/bitcoin-core/leveldb-subtree/pull/64. https://github.com/arun11299/cpp-subprocess/pull/132.
DrahtBot commented 2026-08-06 09:34:21 +00:00 (Migrated from github.com)

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.

Type Reviewers
Concept ACK hebasto
Stale ACK 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:

  • #37047 (fuzz: unpoison argc/argv in LLVMFuzzerInitialize under MSan by fanquake)
  • #37034 (init: avoid pointing to a disabled debug log on failure by l0rinc)
  • #36820 (refactor: remove more dead code by fanquake)
  • #36631 (fuzz: add a custom mutator for PSBT by brunoerg)
  • #36167 (build: Enable -Wunused by fanquake)
  • #35355 (Use atomics for determining whether trace logging is enabled by ajtowns)
  • #34132 (coins,dbwrapper: make database point-read failures fatal by l0rinc)

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.

<!--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/35911 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/35911.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/35911#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | Concept ACK | [hebasto](https://github.com/bitcoin/bitcoin/pull/35911#pullrequestreview-4876387027) | | Stale ACK | [stickies-v](https://github.com/bitcoin/bitcoin/pull/35911#issuecomment-7106225161) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#37047](https://github.com/bitcoin/bitcoin/pull/37047) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/37047.svg"></sub> (fuzz: unpoison argc/argv in LLVMFuzzerInitialize under MSan by fanquake) * [#37034](https://github.com/bitcoin/bitcoin/pull/37034) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/37034.svg"></sub> (init: avoid pointing to a disabled debug log on failure by l0rinc) * [#36820](https://github.com/bitcoin/bitcoin/pull/36820) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36820.svg"></sub> (refactor: remove more dead code by fanquake) * [#36631](https://github.com/bitcoin/bitcoin/pull/36631) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36631.svg"></sub> (fuzz: add a custom mutator for PSBT by brunoerg) * [#36167](https://github.com/bitcoin/bitcoin/pull/36167) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36167.svg"></sub> (build: Enable `-Wunused` by fanquake) * [#35355](https://github.com/bitcoin/bitcoin/pull/35355) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35355.svg"></sub> (Use atomics for determining whether trace logging is enabled by ajtowns) * [#34132](https://github.com/bitcoin/bitcoin/pull/34132) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/34132.svg"></sub> (coins,dbwrapper: make database point-read failures fatal by l0rinc) 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-->
maflcko (Migrated from github.com) reviewed 2026-08-06 09:59:36 +00:00
maflcko (Migrated from github.com) left a comment

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?

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?
maflcko (Migrated from github.com) commented 2026-08-06 09:53:27 +00:00

nit: Can probably split/clang-format this long line into 3 or so?

        futures.emplace_back(Submit(threadPool, [&make_err, i]() __attribute__((noreturn)) {
          throw std::runtime_error(make_err(i));
           }));
nit: Can probably split/clang-format this long line into 3 or so? ```suggestion futures.emplace_back(Submit(threadPool, [&make_err, i]() __attribute__((noreturn)) { throw std::runtime_error(make_err(i)); })); ```
maflcko (Migrated from github.com) commented 2026-08-06 09:52:19 +00:00

nit: Should probably use std::exit https://en.cppreference.com/cpp/utility/program/exit

to avoid confusing with the one from C23?

But either is fine and I don't think this matters.

nit: Should probably use `std::exit` https://en.cppreference.com/cpp/utility/program/exit to avoid confusing with the one from C23? But either is fine and I don't think this matters.
maflcko (Migrated from github.com) commented 2026-08-06 09:53:59 +00:00

Could also add upstream, but doesn't matter for this pull.

Could also add upstream, but doesn't matter for this pull.
DrahtBot commented 2026-08-06 10:05:41 +00:00 (Migrated from github.com)

🚧 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.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `test ancestor commits`: https://github.com/bitcoin/bitcoin/actions/runs/31089666107/job/92577355450</sub> <sub>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).</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>
fanquake (Migrated from github.com) reviewed 2026-08-06 10:06:24 +00:00
fanquake (Migrated from github.com) commented 2026-08-06 10:06:24 +00:00
Opened https://github.com/arun11299/cpp-subprocess/pull/132.
maflcko (Migrated from github.com) reviewed 2026-08-06 10:10:42 +00:00
maflcko (Migrated from github.com) commented 2026-08-06 10:10:42 +00:00

Oh, I missed: This one is wrong:

cd /home/runner/work/bitcoin/bitcoin/ci_build/src/test/fuzz/util && /usr/bin/ccache /usr/bin/clang++ -DABORT_ON_FAILED_ASSUME -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_NO_CXX98_FUNCTION_BASE -DDEBUG -DDEBUG_LOCKCONTENTION -DDEBUG_LOCKORDER -DPROVIDE_FUZZ_MAIN_FUNCTION -DRPC_DOC_CHECK -I/home/runner/work/bitcoin/bitcoin/ci_build/src -I/home/runner/work/bitcoin/bitcoin/src -I/home/runner/work/bitcoin/bitcoin/src/univalue/include -Wno-error=unused-member-function -Wno-error=unused-function -O0 -ftrapv -g3 -std=c++20 -fPIC -fmacro-prefix-map=/home/runner/work/bitcoin/bitcoin/src=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wgnu -Wcovered-switch-default -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter -Werror -MD -MT src/test/fuzz/util/CMakeFiles/test_fuzz.dir/__/fuzz.cpp.o -MF CMakeFiles/test_fuzz.dir/__/fuzz.cpp.o.d -o CMakeFiles/test_fuzz.dir/__/fuzz.cpp.o -c /home/runner/work/bitcoin/bitcoin/src/test/fuzz/fuzz.cpp  -O3 -g2
/home/runner/work/bitcoin/bitcoin/src/test/fuzz/fuzz.cpp:168:1: error: function declared 'noreturn' should not return [-Werror,-Winvalid-noreturn]
  168 | }
      | ^
/home/runner/work/bitcoin/bitcoin/src/test/fuzz/fuzz.cpp:239:26: error: code will never be executed [-Werror,-Wunreachable-code]
  239 |     std::vector<uint8_t> buffer;
      |                          ^~~~~~
2 errors generated.
Oh, I missed: This one is wrong: ``` cd /home/runner/work/bitcoin/bitcoin/ci_build/src/test/fuzz/util && /usr/bin/ccache /usr/bin/clang++ -DABORT_ON_FAILED_ASSUME -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_NO_CXX98_FUNCTION_BASE -DDEBUG -DDEBUG_LOCKCONTENTION -DDEBUG_LOCKORDER -DPROVIDE_FUZZ_MAIN_FUNCTION -DRPC_DOC_CHECK -I/home/runner/work/bitcoin/bitcoin/ci_build/src -I/home/runner/work/bitcoin/bitcoin/src -I/home/runner/work/bitcoin/bitcoin/src/univalue/include -Wno-error=unused-member-function -Wno-error=unused-function -O0 -ftrapv -g3 -std=c++20 -fPIC -fmacro-prefix-map=/home/runner/work/bitcoin/bitcoin/src=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wgnu -Wcovered-switch-default -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter -Werror -MD -MT src/test/fuzz/util/CMakeFiles/test_fuzz.dir/__/fuzz.cpp.o -MF CMakeFiles/test_fuzz.dir/__/fuzz.cpp.o.d -o CMakeFiles/test_fuzz.dir/__/fuzz.cpp.o -c /home/runner/work/bitcoin/bitcoin/src/test/fuzz/fuzz.cpp -O3 -g2 /home/runner/work/bitcoin/bitcoin/src/test/fuzz/fuzz.cpp:168:1: error: function declared 'noreturn' should not return [-Werror,-Winvalid-noreturn] 168 | } | ^ /home/runner/work/bitcoin/bitcoin/src/test/fuzz/fuzz.cpp:239:26: error: code will never be executed [-Werror,-Wunreachable-code] 239 | std::vector<uint8_t> buffer; | ^~~~~~ 2 errors generated.
fanquake commented 2026-08-06 10:34:13 +00:00 (Migrated from github.com)
Opened https://github.com/bitcoin-core/leveldb-subtree/pull/64 for the leveldb changes.
DrahtBot commented 2026-08-06 10:36:41 +00:00 (Migrated from github.com)

🚧 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.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `lint`: https://github.com/bitcoin/bitcoin/actions/runs/31093313597/job/92589235946</sub> <sub>LLM reason (✨ experimental): CI failed because the lint check `subtree` detected that a subtree directory was modified without the required 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>
fanquake (Migrated from github.com) reviewed 2026-08-06 10:38:44 +00:00
fanquake (Migrated from github.com) commented 2026-08-06 10:38:44 +00:00

Added a commit for this.

Added a commit for this.
Sjors (Migrated from github.com) reviewed 2026-08-06 11:57:33 +00:00
Sjors (Migrated from github.com) commented 2026-08-06 11:57:33 +00:00

Documentation says:

Note these are only possible candidates, not absolute ones.

So this might give us false positives, but those could be suppressed?

https://gcc.gnu.org/onlinedocs/gcc-4.2.2/gcc/Warning-Options.html

Documentation says: > Note these are only possible candidates, not absolute ones. So this might give us false positives, but those could be suppressed? https://gcc.gnu.org/onlinedocs/gcc-4.2.2/gcc/Warning-Options.html
fanquake (Migrated from github.com) reviewed 2026-08-06 12:39:33 +00:00
fanquake (Migrated from github.com) commented 2026-08-06 12:39:33 +00:00

https://gcc.gnu.org/onlinedocs/gcc-4.2.2/gcc/Warning-Options.html

Your documentation is about 20 years out of date. The modern docs say:

Warn about functions that might be candidates for attributes pure, const, noreturn, malloc or returns_nonnull. The compiler only warns for functions visible in other compilation units or (in the case of pure and const) if it cannot prove that the function returns normally. A function returns normally if it doesn’t contain an infinite loop or return abnormally by throwing, calling abort or trapping. This analysis requires option -fipa-pure-const, which is enabled by default at -O and higher. Higher optimization levels improve the accuracy of the analysis.

> https://gcc.gnu.org/onlinedocs/gcc-4.2.2/gcc/Warning-Options.html Your documentation is about 20 years out of date. The [modern docs](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsuggest-attribute_003d) say: > Warn about functions that might be candidates for attributes pure, const, noreturn, malloc or returns_nonnull. The compiler only warns for functions visible in other compilation units or (in the case of pure and const) if it cannot prove that the function returns normally. A function returns normally if it doesn’t contain an infinite loop or return abnormally by throwing, calling abort or trapping. This analysis requires option -fipa-pure-const, which is enabled by default at -O and higher. Higher optimization levels improve the accuracy of the analysis.
maflcko (Migrated from github.com) reviewed 2026-08-06 12:41:43 +00:00
maflcko (Migrated from github.com) commented 2026-08-06 12:41:43 +00:00

Mabye a bug in clang: https://github.com/bitcoin/bitcoin/actions/runs/31093885302/job/92591251807?pr=35911#step:11:3252:

cd "/home/runner/work/_temp/build_ ₿🧪_/src/test/fuzz/util" && /usr/bin/ccache /usr/bin/clang++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_NO_CXX98_FUNCTION_BASE -DPROVIDE_FUZZ_MAIN_FUNCTION -I"/home/runner/work/_temp/build_ ₿🧪_/src" -I/home/runner/work/_temp/src -I/home/runner/work/_temp/src/univalue/include -ftrivial-auto-var-init=pattern -O2 -g -std=c++20 -fPIC -fmacro-prefix-map=/home/runner/work/_temp/src=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection -fsanitize=address,float-divide-by-zero,integer,undefined -Wall -Wextra -Wgnu -Wcovered-switch-default -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wthread-safety-pointer -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wmissing-noreturn -Wno-unused-parameter -Werror -MD -MT src/test/fuzz/util/CMakeFiles/test_fuzz.dir/__/fuzz.cpp.o -MF CMakeFiles/test_fuzz.dir/__/fuzz.cpp.o.d -o CMakeFiles/test_fuzz.dir/__/fuzz.cpp.o -c /home/runner/work/_temp/src/test/fuzz/fuzz.cpp -DARENA_DEBUG -DDEBUG_LOCKORDER -std=c++23
/home/runner/work/_temp/src/test/fuzz/fuzz.cpp:94:1: error: function 'initialize' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
   94 | {
      | ^
1 error generated.

Mabye a bug in clang: https://github.com/bitcoin/bitcoin/actions/runs/31093885302/job/92591251807?pr=35911#step:11:3252: ``` cd "/home/runner/work/_temp/build_ ₿🧪_/src/test/fuzz/util" && /usr/bin/ccache /usr/bin/clang++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_NO_CXX98_FUNCTION_BASE -DPROVIDE_FUZZ_MAIN_FUNCTION -I"/home/runner/work/_temp/build_ ₿🧪_/src" -I/home/runner/work/_temp/src -I/home/runner/work/_temp/src/univalue/include -ftrivial-auto-var-init=pattern -O2 -g -std=c++20 -fPIC -fmacro-prefix-map=/home/runner/work/_temp/src=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection -fsanitize=address,float-divide-by-zero,integer,undefined -Wall -Wextra -Wgnu -Wcovered-switch-default -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wthread-safety-pointer -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wmissing-noreturn -Wno-unused-parameter -Werror -MD -MT src/test/fuzz/util/CMakeFiles/test_fuzz.dir/__/fuzz.cpp.o -MF CMakeFiles/test_fuzz.dir/__/fuzz.cpp.o.d -o CMakeFiles/test_fuzz.dir/__/fuzz.cpp.o -c /home/runner/work/_temp/src/test/fuzz/fuzz.cpp -DARENA_DEBUG -DDEBUG_LOCKORDER -std=c++23 /home/runner/work/_temp/src/test/fuzz/fuzz.cpp:94:1: error: function 'initialize' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn] 94 | { | ^ 1 error generated. ```
hebasto (Migrated from github.com) reviewed 2026-08-06 15:39:19 +00:00
hebasto (Migrated from github.com) left a comment

Concept ACK.

Concept ACK.
hebasto (Migrated from github.com) reviewed 2026-08-06 16:26:28 +00:00
hebasto (Migrated from github.com) left a comment

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

Could you submit commit 2b6dee1f51651ecf7245552b467417cc72a28fe3 in a separate PR? That way, we can review and land it sooner to unbreak the nightly CI.
fanquake commented 2026-08-06 16:28:35 +00:00 (Migrated from github.com)

Could you submit commit github.com/bitcoin/bitcoin@2b6dee1f51 in a separate PR?

It is part of #35896.

> Could you submit commit https://github.com/bitcoin/bitcoin/commit/2b6dee1f51651ecf7245552b467417cc72a28fe3 in a separate PR? It is part of #35896.
fanquake (Migrated from github.com) reviewed 2026-08-06 16:36:53 +00:00
fanquake (Migrated from github.com) commented 2026-08-06 16:36:53 +00:00

Split this up.

Split this up.
DrahtBot commented 2026-08-07 10:04:12 +00:00 (Migrated from github.com)

🚧 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.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `lint`: https://github.com/bitcoin/bitcoin/actions/runs/31164196113/job/92821231499</sub> <sub>LLM reason (✨ experimental): CI failed because the linter’s “subtree” check detected modified subtree directories without a corresponding 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>
stickies-v commented 2026-08-11 10:30:31 +00:00 (Migrated from github.com)

Concept ACK

Concept ACK
fanquake commented 2026-08-18 10:13:52 +00:00 (Migrated from github.com)

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

Not sure it's worth trying to pull any changes out here, so this will remain drafted until the next libmultiprocess subtree update.
maflcko (Migrated from github.com) reviewed 2026-08-31 08:41:28 +00:00
maflcko (Migrated from github.com) commented 2026-08-31 08:41:28 +00:00

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.

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.
First-time contributor

Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive linked from the Review report for their assessments.

🟠 Minor · IPC [[noreturn]] declarations conflict with returning proxy overrides

submitSolutionOld7 and makeMiningOld2 now promise [[noreturn]], but their generated IPC proxies can return after a normal remote reply; no current C++ caller through a proxy was found.

Location: src/interfaces/mining.h:81 (head).

Review coverage was incomplete.


Reviewed: e15168a20a14 · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:e1a29e5e677c47d383756f0fcf8f3760725c91d1104dd3ccb2f333b6217eba26:47880f5569fd2047d249266f337c4f2a509adf7d96c3ccb1c7644c2c2a650bff --> <!-- ralph-base:2f3f6397bb92beccaccce16742f0574d1617fb3e --> <!-- ralph-head:e15168a20a14df9858cc61d0eeb40bb56aa50aa1 --> <!-- ralph-case:671e6feb5e499a55307326c4d15d1bc791e238341ebf470bbf718a54084c3b02 --> Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive linked from the Review report for their assessments. **🟠 Minor · IPC `[[noreturn]]` declarations conflict with returning proxy overrides** `submitSolutionOld7` and `makeMiningOld2` now promise `[[noreturn]]`, but their generated IPC proxies can return after a normal remote reply; no current C++ caller through a proxy was found. Location: [`src/interfaces/mining.h:81`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/e15168a20a14df9858cc61d0eeb40bb56aa50aa1/src/interfaces/mining.h#L81>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`e15168a20a14`](<https://git.fish.foo/bitcoin/bitcoin/commit/e15168a20a14df9858cc61d0eeb40bb56aa50aa1>) · [Review report](<https://review.fish.foo/report/35911-e15168a20a14df9858cc61d0eeb40bb56aa50aa1-3501-14.html>) · [Previous reports](<https://review.fish.foo/traces/35911/>) [permalink](<https://review.fish.foo/report/35911-e15168a20a14df9858cc61d0eeb40bb56aa50aa1-3501-14.html>)
DrahtBot commented 2026-11-04 13:10:05 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
fanquake commented 2026-11-05 16:44:22 +00:00 (Migrated from github.com)

Rebased and should now be reviewable.

Rebased and should now be reviewable.
fanquake commented 2026-11-06 11:14:50 +00:00 (Migrated from github.com)

Rebased again, after #36036.

Rebased again, after #36036.
hebasto (Migrated from github.com) reviewed 2026-11-09 19:50:25 +00:00
hebasto (Migrated from github.com) left a comment

Assuming that the added attributes were prompted by compiler warnings, I wonder which exact compiler was used.

I’m asking because on Fedora 45 with Clang 23.1.5, I was able to build without any compiler warnings after applying the following partial revert of the first commit:

diff --git a/src/interfaces/init.h b/src/interfaces/init.h
index daf6b8d58e..2f3aeb6aff 100644
--- a/src/interfaces/init.h
+++ b/src/interfaces/init.h
@@ -48,7 +48,7 @@ public:
     virtual Ipc* ipc() { return nullptr; }
     virtual bool canListenIpc() { return false; }
     virtual const char* exeName() { return nullptr; }
-    [[noreturn]] virtual void makeMiningOld2() { throw std::runtime_error("Old mining interface (@2) not supported. Please update your client!"); }
+    virtual void makeMiningOld2() { throw std::runtime_error("Old mining interface (@2) not supported. Please update your client!"); }
 };
 
 //! Return implementation of Init interface for the node process. If the argv
diff --git a/src/interfaces/mining.h b/src/interfaces/mining.h
index 323859708c..c8e969711b 100644
--- a/src/interfaces/mining.h
+++ b/src/interfaces/mining.h
@@ -78,7 +78,7 @@ public:
 
     //! Deprecated older method preserved to return an explicit error for IPC
     //! clients using mining.capnp @7.
-    [[noreturn]] virtual bool submitSolutionOld7(uint32_t, uint32_t, uint32_t, CTransactionRef)
+    virtual bool submitSolutionOld7(uint32_t, uint32_t, uint32_t, CTransactionRef)
     {
         throw std::runtime_error("Old submitSolution (@7) not supported. Please update your client!");
     }
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
index ea55988cf0..4f375a90f2 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -286,7 +286,7 @@ static RPCMethod generatetodescriptor()
 
 static RPCMethod generate()
 {
-    return RPCMethod{"generate", "has been replaced by the -generate cli option. Refer to -help for more information.", {}, {}, RPCExamples{""}, [] [[noreturn]] (const RPCMethod& self, const JSONRPCRequest& request) -> UniValue {
+    return RPCMethod{"generate", "has been replaced by the -generate cli option. Refer to -help for more information.", {}, {}, RPCExamples{""}, [](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue {
         throw JSONRPCError(RPC_METHOD_NOT_FOUND, self.ToString());
     }};
 }
diff --git a/src/sync.cpp b/src/sync.cpp
index 7ee098e7b7..1acbe3cf06 100644
--- a/src/sync.cpp
+++ b/src/sync.cpp
@@ -104,7 +104,7 @@ LockData& GetLockData() {
     return lock_data;
 }
 
-[[noreturn]] static void potential_deadlock_detected(const LockPair& mismatch, const LockStack& s1, const LockStack& s2)
+static void potential_deadlock_detected(const LockPair& mismatch, const LockStack& s1, const LockStack& s2)
 {
     LogError("POTENTIAL DEADLOCK DETECTED");
     LogError("Previous lock order was:");
@@ -140,7 +140,7 @@ LockData& GetLockData() {
     throw std::logic_error(strprintf("potential deadlock detected: %s -> %s -> %s", mutex_b, mutex_a, mutex_b));
 }
 
-[[noreturn]] static void double_lock_detected(const void* mutex, const LockStack& lock_stack)
+static void double_lock_detected(const void* mutex, const LockStack& lock_stack)
 {
     LogError("DOUBLE LOCK DETECTED");
     LogError("Lock order:");
diff --git a/src/test/fuzz/util/net.h b/src/test/fuzz/util/net.h
index 602dc093e4..520c6732da 100644
--- a/src/test/fuzz/util/net.h
+++ b/src/test/fuzz/util/net.h
@@ -192,7 +192,7 @@ public:
 
     ~FuzzedSock() override;
 
-    [[noreturn]] FuzzedSock& operator=(Sock&& other) override;
+    FuzzedSock& operator=(Sock&& other) override;
 
     ssize_t Send(const void* data, size_t len, int flags) const override;
 
diff --git a/src/test/threadpool_tests.cpp b/src/test/threadpool_tests.cpp
index 3576428552..4811d73215 100644
--- a/src/test/threadpool_tests.cpp
+++ b/src/test/threadpool_tests.cpp
@@ -209,9 +209,7 @@ BOOST_AUTO_TEST_CASE(task_exception_propagates_to_future)
     std::vector<std::future<void>> futures;
     futures.reserve(num_tasks);
     for (int i = 0; i < num_tasks; i++) {
-        futures.emplace_back(Submit(threadPool, [&make_err, i] [[noreturn]] () {
-          throw std::runtime_error(make_err(i));
-        }));
+        futures.emplace_back(Submit(threadPool, [&make_err, i] { throw std::runtime_error(make_err(i)); }));
     }
 
     for (int i = 0; i < num_tasks; i++) {
diff --git a/src/test/util/net.h b/src/test/util/net.h
index 1f2e97b88e..8014bbcc36 100644
--- a/src/test/util/net.h
+++ b/src/test/util/net.h
@@ -201,7 +201,7 @@ public:
     bool WaitMany(std::chrono::milliseconds timeout, EventsPerSock& events_per_sock) const override;
 
 private:
-    [[noreturn]] ZeroSock& operator=(Sock&& other) override;
+    ZeroSock& operator=(Sock&& other) override;
 };
 
 /**
@@ -226,7 +226,7 @@ public:
     }
 
 private:
-    [[noreturn]] StaticContentsSock& operator=(Sock&& other) override;
+    StaticContentsSock& operator=(Sock&& other) override;
 
     const std::string m_contents;
     mutable size_t m_consumed{0};
@@ -362,7 +362,7 @@ public:
     bool WaitMany(std::chrono::milliseconds timeout, EventsPerSock& events_per_sock) const override;
 
 private:
-    [[noreturn]] DynSock& operator=(Sock&&) override;
+    DynSock& operator=(Sock&&) override;
 
     std::shared_ptr<Pipes> m_pipes;
     Queue* const m_accept_sockets;
diff --git a/src/wallet/dump.cpp b/src/wallet/dump.cpp
index ae50d777a1..c76ccd427b 100644
--- a/src/wallet/dump.cpp
+++ b/src/wallet/dump.cpp
@@ -51,7 +51,7 @@ bool DumpWallet(const ArgsManager& args, WalletDatabase& db, bilingual_str& erro
     struct DumpWalletError {
         bilingual_str message;
     };
-    auto throw_error = [] [[noreturn]] (bilingual_str message) {
+    auto throw_error = [](bilingual_str message) {
         throw DumpWalletError{std::move(message)};
     };
     auto throw_write_error = [&] {
Assuming that the added attributes were prompted by compiler warnings, I wonder which exact compiler was used. I’m asking because on Fedora 45 with Clang 23.1.5, I was able to build without any compiler warnings after applying the following partial revert of the first commit: ```diff diff --git a/src/interfaces/init.h b/src/interfaces/init.h index daf6b8d58e..2f3aeb6aff 100644 --- a/src/interfaces/init.h +++ b/src/interfaces/init.h @@ -48,7 +48,7 @@ public: virtual Ipc* ipc() { return nullptr; } virtual bool canListenIpc() { return false; } virtual const char* exeName() { return nullptr; } - [[noreturn]] virtual void makeMiningOld2() { throw std::runtime_error("Old mining interface (@2) not supported. Please update your client!"); } + virtual void makeMiningOld2() { throw std::runtime_error("Old mining interface (@2) not supported. Please update your client!"); } }; //! Return implementation of Init interface for the node process. If the argv diff --git a/src/interfaces/mining.h b/src/interfaces/mining.h index 323859708c..c8e969711b 100644 --- a/src/interfaces/mining.h +++ b/src/interfaces/mining.h @@ -78,7 +78,7 @@ public: //! Deprecated older method preserved to return an explicit error for IPC //! clients using mining.capnp @7. - [[noreturn]] virtual bool submitSolutionOld7(uint32_t, uint32_t, uint32_t, CTransactionRef) + virtual bool submitSolutionOld7(uint32_t, uint32_t, uint32_t, CTransactionRef) { throw std::runtime_error("Old submitSolution (@7) not supported. Please update your client!"); } diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index ea55988cf0..4f375a90f2 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -286,7 +286,7 @@ static RPCMethod generatetodescriptor() static RPCMethod generate() { - return RPCMethod{"generate", "has been replaced by the -generate cli option. Refer to -help for more information.", {}, {}, RPCExamples{""}, [] [[noreturn]] (const RPCMethod& self, const JSONRPCRequest& request) -> UniValue { + return RPCMethod{"generate", "has been replaced by the -generate cli option. Refer to -help for more information.", {}, {}, RPCExamples{""}, [](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue { throw JSONRPCError(RPC_METHOD_NOT_FOUND, self.ToString()); }}; } diff --git a/src/sync.cpp b/src/sync.cpp index 7ee098e7b7..1acbe3cf06 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -104,7 +104,7 @@ LockData& GetLockData() { return lock_data; } -[[noreturn]] static void potential_deadlock_detected(const LockPair& mismatch, const LockStack& s1, const LockStack& s2) +static void potential_deadlock_detected(const LockPair& mismatch, const LockStack& s1, const LockStack& s2) { LogError("POTENTIAL DEADLOCK DETECTED"); LogError("Previous lock order was:"); @@ -140,7 +140,7 @@ LockData& GetLockData() { throw std::logic_error(strprintf("potential deadlock detected: %s -> %s -> %s", mutex_b, mutex_a, mutex_b)); } -[[noreturn]] static void double_lock_detected(const void* mutex, const LockStack& lock_stack) +static void double_lock_detected(const void* mutex, const LockStack& lock_stack) { LogError("DOUBLE LOCK DETECTED"); LogError("Lock order:"); diff --git a/src/test/fuzz/util/net.h b/src/test/fuzz/util/net.h index 602dc093e4..520c6732da 100644 --- a/src/test/fuzz/util/net.h +++ b/src/test/fuzz/util/net.h @@ -192,7 +192,7 @@ public: ~FuzzedSock() override; - [[noreturn]] FuzzedSock& operator=(Sock&& other) override; + FuzzedSock& operator=(Sock&& other) override; ssize_t Send(const void* data, size_t len, int flags) const override; diff --git a/src/test/threadpool_tests.cpp b/src/test/threadpool_tests.cpp index 3576428552..4811d73215 100644 --- a/src/test/threadpool_tests.cpp +++ b/src/test/threadpool_tests.cpp @@ -209,9 +209,7 @@ BOOST_AUTO_TEST_CASE(task_exception_propagates_to_future) std::vector<std::future<void>> futures; futures.reserve(num_tasks); for (int i = 0; i < num_tasks; i++) { - futures.emplace_back(Submit(threadPool, [&make_err, i] [[noreturn]] () { - throw std::runtime_error(make_err(i)); - })); + futures.emplace_back(Submit(threadPool, [&make_err, i] { throw std::runtime_error(make_err(i)); })); } for (int i = 0; i < num_tasks; i++) { diff --git a/src/test/util/net.h b/src/test/util/net.h index 1f2e97b88e..8014bbcc36 100644 --- a/src/test/util/net.h +++ b/src/test/util/net.h @@ -201,7 +201,7 @@ public: bool WaitMany(std::chrono::milliseconds timeout, EventsPerSock& events_per_sock) const override; private: - [[noreturn]] ZeroSock& operator=(Sock&& other) override; + ZeroSock& operator=(Sock&& other) override; }; /** @@ -226,7 +226,7 @@ public: } private: - [[noreturn]] StaticContentsSock& operator=(Sock&& other) override; + StaticContentsSock& operator=(Sock&& other) override; const std::string m_contents; mutable size_t m_consumed{0}; @@ -362,7 +362,7 @@ public: bool WaitMany(std::chrono::milliseconds timeout, EventsPerSock& events_per_sock) const override; private: - [[noreturn]] DynSock& operator=(Sock&&) override; + DynSock& operator=(Sock&&) override; std::shared_ptr<Pipes> m_pipes; Queue* const m_accept_sockets; diff --git a/src/wallet/dump.cpp b/src/wallet/dump.cpp index ae50d777a1..c76ccd427b 100644 --- a/src/wallet/dump.cpp +++ b/src/wallet/dump.cpp @@ -51,7 +51,7 @@ bool DumpWallet(const ArgsManager& args, WalletDatabase& db, bilingual_str& erro struct DumpWalletError { bilingual_str message; }; - auto throw_error = [] [[noreturn]] (bilingual_str message) { + auto throw_error = [](bilingual_str message) { throw DumpWalletError{std::move(message)}; }; auto throw_write_error = [&] { ```
fanquake commented 2026-11-09 22:19:20 +00:00 (Migrated from github.com)

Assuming that the added attributes were prompted by compiler warnings, I wonder which exact compiler was used.

They have just been added to functions that don't return; irrespective of whether any particular compiler, or version of, may or may not have warned.

> Assuming that the added attributes were prompted by compiler warnings, I wonder which exact compiler was used. They have just been added to functions that don't return; irrespective of whether any particular compiler, or version of, may or may not have warned.
maflcko (Migrated from github.com) reviewed 2026-11-10 19:38:17 +00:00
maflcko (Migrated from github.com) commented 2026-11-10 19:38:17 +00:00

Not sure how this passes now, but I don' think we want to merge this in its current form. Devs will just have to fight the compiler matrix, without knowing what to do:

  • assert(false) doesn't work on Clang-Cl.
  • Assert(false) doesn't' work on GCC.
  • Randomly placed std::abort are unclear if they mean unreachable code or just a "normal" abort, because the program can't continue for whatever reason. Also, they don't have any debug prints.

I've fixed this in https://github.com/bitcoin/bitcoin/pull/36087

Not sure how this passes now, but I don' think we want to merge this in its current form. Devs will just have to fight the compiler matrix, without knowing what to do: * `assert(false)` doesn't work on Clang-Cl. * `Assert(false)` doesn't' work on GCC. * Randomly placed `std::abort` are unclear if they mean unreachable code or just a "normal" abort, because the program can't continue for whatever reason. Also, they don't have any debug prints. I've fixed this in https://github.com/bitcoin/bitcoin/pull/36087
fanquake (Migrated from github.com) reviewed 2026-11-10 20:21:00 +00:00
fanquake (Migrated from github.com) commented 2026-11-10 20:21:00 +00:00

Sure. Rebased on that branch.

Sure. Rebased on that branch.
DrahtBot commented 2026-11-16 19:49:38 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
DrahtBot commented 2026-11-18 11:33:46 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task lint: https://github.com/bitcoin/bitcoin/actions/runs/44286334548/job/134739857781
LLM reason (✨ experimental): CI failed lint checks: assert_falsy flags assert(false) in src/test/fuzz/util/wallet.h, and the scripted-diff check also failed.

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.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `lint`: https://github.com/bitcoin/bitcoin/actions/runs/44286334548/job/134739857781</sub> <sub>LLM reason (✨ experimental): CI failed lint checks: `assert_falsy` flags `assert(false)` in `src/test/fuzz/util/wallet.h`, and the scripted-diff check also failed.</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>
DrahtBot commented 2026-11-20 22:50:55 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
fanquake commented 2026-11-21 08:51:54 +00:00 (Migrated from github.com)

Rebased.

Rebased.
maflcko (Migrated from github.com) reviewed 2026-11-22 12:57:15 +00:00
maflcko (Migrated from github.com) commented 2026-11-22 12:57:15 +00:00

basically the same question from before ( https://github.com/bitcoin/bitcoin/pull/35911#pullrequestreview-5831762867):

A human reader will already see the throw, so for them this attribute doesn't add anything. And similarly for a compiler it doesn't add anything either, because it will be cast away from the lambda?

(Same for other lambdas, and virtual functions, etc)

basically the same question from before ( https://github.com/bitcoin/bitcoin/pull/35911#pullrequestreview-5831762867): A human reader will already see the `throw`, so for them this attribute doesn't add anything. And similarly for a compiler it doesn't add anything either, because it will be cast away from the lambda? (Same for other lambdas, and virtual functions, etc)
fanquake (Migrated from github.com) reviewed 2026-11-22 14:58:03 +00:00
fanquake (Migrated from github.com) commented 2026-11-22 14:58:03 +00:00

Took at look, and Clang <=21 (Ubuntu clang version 21.1.8 (6ubuntu1)), and I assume the equivalent version of Apple Clang, will warn without the attributes (some output below). I would rather leave a few (possibly redundant) annotations in place, and then just drop them once support for < Clang 22 is dropped?

[163/1145] Building CXX object src/wallet/CMakeFiles/bitcoin_wallet.dir/dump.cpp.o
/root/bitcoin/src/wallet/dump.cpp:54:24: warning: function 'operator()' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
   54 |     auto throw_error = [](bilingual_str message) {
      |                        ^
1 warning generated.
[276/1145] Building CXX object src/CMakeFiles/bitcoin_node.dir/node/interfaces.cpp.o
In file included from /root/bitcoin/src/node/interfaces.cpp:23:
/root/bitcoin/src/interfaces/mining.h:81:18: warning: function 'submitSolutionOld7' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
   81 |     virtual bool submitSolutionOld7(uint32_t, uint32_t, uint32_t, CTransactionRef)
      |                  ^
1 warning generated.
[282/1145] Building CXX object src/CMakeFiles/bitcoin_node.dir/rpc/node.cpp.o
In file included from /root/bitcoin/src/rpc/node.cpp:18:
In file included from /root/bitcoin/src/interfaces/init.h:15:
/root/bitcoin/src/interfaces/mining.h:81:18: warning: function 'submitSolutionOld7' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
   81 |     virtual bool submitSolutionOld7(uint32_t, uint32_t, uint32_t, CTransactionRef)
      |                  ^
In file included from /root/bitcoin/src/rpc/node.cpp:18:
/root/bitcoin/src/interfaces/init.h:51:18: warning: function 'makeMiningOld2' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
   51 |     virtual void makeMiningOld2() { throw std::runtime_error("Old mining interface (@2) not supported. Please update your client!"); }
      |                  ^
2 warnings generated.
[314/1145] Building CXX object src/CMakeFiles/bitcoin_node.dir/rpc/mining.cpp.o
/root/bitcoin/src/rpc/mining.cpp:288:146: warning: function 'operator()' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
  288 |     return RPCMethod{"generate", "has been replaced by the -generate cli option. Refer to -help for more information.", {}, {}, RPCExamples{""}, [](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue {
      |                                                                                                                                                  ^
1 warning generated.
Took at look, and Clang <=21 (`Ubuntu clang version 21.1.8 (6ubuntu1)`), and I assume the equivalent version of Apple Clang, will warn without the attributes (some output below). I would rather leave a few (possibly redundant) annotations in place, and then just drop them once support for < Clang 22 is dropped? ```bash [163/1145] Building CXX object src/wallet/CMakeFiles/bitcoin_wallet.dir/dump.cpp.o /root/bitcoin/src/wallet/dump.cpp:54:24: warning: function 'operator()' could be declared with attribute 'noreturn' [-Wmissing-noreturn] 54 | auto throw_error = [](bilingual_str message) { | ^ 1 warning generated. [276/1145] Building CXX object src/CMakeFiles/bitcoin_node.dir/node/interfaces.cpp.o In file included from /root/bitcoin/src/node/interfaces.cpp:23: /root/bitcoin/src/interfaces/mining.h:81:18: warning: function 'submitSolutionOld7' could be declared with attribute 'noreturn' [-Wmissing-noreturn] 81 | virtual bool submitSolutionOld7(uint32_t, uint32_t, uint32_t, CTransactionRef) | ^ 1 warning generated. [282/1145] Building CXX object src/CMakeFiles/bitcoin_node.dir/rpc/node.cpp.o In file included from /root/bitcoin/src/rpc/node.cpp:18: In file included from /root/bitcoin/src/interfaces/init.h:15: /root/bitcoin/src/interfaces/mining.h:81:18: warning: function 'submitSolutionOld7' could be declared with attribute 'noreturn' [-Wmissing-noreturn] 81 | virtual bool submitSolutionOld7(uint32_t, uint32_t, uint32_t, CTransactionRef) | ^ In file included from /root/bitcoin/src/rpc/node.cpp:18: /root/bitcoin/src/interfaces/init.h:51:18: warning: function 'makeMiningOld2' could be declared with attribute 'noreturn' [-Wmissing-noreturn] 51 | virtual void makeMiningOld2() { throw std::runtime_error("Old mining interface (@2) not supported. Please update your client!"); } | ^ 2 warnings generated. [314/1145] Building CXX object src/CMakeFiles/bitcoin_node.dir/rpc/mining.cpp.o /root/bitcoin/src/rpc/mining.cpp:288:146: warning: function 'operator()' could be declared with attribute 'noreturn' [-Wmissing-noreturn] 288 | return RPCMethod{"generate", "has been replaced by the -generate cli option. Refer to -help for more information.", {}, {}, RPCExamples{""}, [](const RPCMethod& self, const JSONRPCRequest& request) -> UniValue { | ^ 1 warning generated. ```
DrahtBot commented 2026-11-22 15:45:57 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task Alpine (musl): https://github.com/bitcoin/bitcoin/actions/runs/45035866867/job/137249377761
LLM reason (✨ experimental): The build failed because -Werror promoted GCC’s suggest-attribute=noreturn warnings in src/test/util/net.cpp to errors.

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.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `Alpine (musl)`: https://github.com/bitcoin/bitcoin/actions/runs/45035866867/job/137249377761</sub> <sub>LLM reason (✨ experimental): The build failed because `-Werror` promoted GCC’s `suggest-attribute=noreturn` warnings in `src/test/util/net.cpp` to errors.</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>
fanquake (Migrated from github.com) reviewed 2026-11-22 17:21:22 +00:00
fanquake (Migrated from github.com) commented 2026-11-22 17:21:22 +00:00

In Win Cross, Alpine, 32bit Arm i686 & previous releases:

/home/runner/work/_temp/src/test/util/net.cpp:238:11: error: function might be candidate for attribute ‘noreturn’ [-Werror=suggest-attribute=noreturn]
  238 | ZeroSock& ZeroSock::operator=(Sock&& other)
      |           ^~~~~~~~
/home/runner/work/_temp/src/test/util/net.cpp: In member function ‘virtual StaticContentsSock& StaticContentsSock::operator=(Sock&&)’:
/home/runner/work/_temp/src/test/util/net.cpp:258:21: error: function might be candidate for attribute ‘noreturn’ [-Werror=suggest-attribute=noreturn]
  258 | StaticContentsSock& StaticContentsSock::operator=(Sock&& other)
      |                     ^~~~~~~~~~~~~~~~~~
/home/runner/work/_temp/src/test/util/net.cpp: In member function ‘virtual DynSock& DynSock::operator=(Sock&&)’:
/home/runner/work/_temp/src/test/util/net.cpp:378:10: error: function might be candidate for attribute ‘noreturn’ [-Werror=suggest-attribute=noreturn]
  378 | DynSock& DynSock::operator=(Sock&&)
      |          ^~~~~~~
In Win Cross, Alpine, 32bit Arm i686 & previous releases: ```bash /home/runner/work/_temp/src/test/util/net.cpp:238:11: error: function might be candidate for attribute ‘noreturn’ [-Werror=suggest-attribute=noreturn] 238 | ZeroSock& ZeroSock::operator=(Sock&& other) | ^~~~~~~~ /home/runner/work/_temp/src/test/util/net.cpp: In member function ‘virtual StaticContentsSock& StaticContentsSock::operator=(Sock&&)’: /home/runner/work/_temp/src/test/util/net.cpp:258:21: error: function might be candidate for attribute ‘noreturn’ [-Werror=suggest-attribute=noreturn] 258 | StaticContentsSock& StaticContentsSock::operator=(Sock&& other) | ^~~~~~~~~~~~~~~~~~ /home/runner/work/_temp/src/test/util/net.cpp: In member function ‘virtual DynSock& DynSock::operator=(Sock&&)’: /home/runner/work/_temp/src/test/util/net.cpp:378:10: error: function might be candidate for attribute ‘noreturn’ [-Werror=suggest-attribute=noreturn] 378 | DynSock& DynSock::operator=(Sock&&) | ^~~~~~~ ```
maflcko (Migrated from github.com) reviewed 2026-11-23 07:16:03 +00:00
maflcko (Migrated from github.com) commented 2026-11-23 07:16:03 +00:00

ok, I see. Seems fine then

ok, I see. Seems fine then
fanquake (Migrated from github.com) reviewed 2026-11-23 11:01:30 +00:00
fanquake (Migrated from github.com) commented 2026-11-23 11:01:30 +00:00

Added a link to this to the PR description.

Added a link to this to the PR description.
stickies-v (Migrated from github.com) approved these changes 2026-11-23 13:33:05 +00:00
stickies-v (Migrated from github.com) left a comment
ACK 75b8304271d312acc2f49c7ad1f46fad2a853d79
stickies-v (Migrated from github.com) commented 2026-11-23 13:29:08 +00:00

nit: it's a bit awkward to mark a virtual method as [[noreturn]] when an override can be implemented to return.

The libmultiprocess generated ProxyClient method overrides can return. I don't think anything in-tree calls makeMiningOld2 (or submitSolutionOld7) via IPC, but if that changes, a newer client (with noreturn) that calls an older server (that may return) can cause UB. The IPC interface is experimental, but at the same time the only reason we have these Old functions to handle version mismatches gracefully. Perhaps it makes sense to just not mark these kinds of functions as virtual?

nit: it's a bit awkward to mark a `virtual` method as `[[noreturn]]` when an override can be implemented to return. The libmultiprocess generated `ProxyClient` method overrides can return. I don't think anything in-tree calls `makeMiningOld2` (or `submitSolutionOld7`) via IPC, but if that changes, a newer client (with `noreturn`) that calls an older server (that may return) can cause UB. The IPC interface is experimental, but at the same time the only reason we have these `Old` functions to handle version mismatches gracefully. Perhaps it makes sense to just not mark these kinds of functions as `virtual`?
stickies-v (Migrated from github.com) commented 2026-11-23 11:17:34 +00:00

nit: I think this can be done with a lot less code churn by just moving LLVMFuzzerInitialize next to initialize?

git diff on 75b8304271
diff --git a/src/test/fuzz/fuzz.cpp b/src/test/fuzz/fuzz.cpp
index 97e185a577..b740ec0ac8 100644
--- a/src/test/fuzz/fuzz.cpp
+++ b/src/test/fuzz/fuzz.cpp
@@ -90,47 +90,6 @@ const std::function<std::string()> G_TEST_GET_FULL_NAME{[]{
     return std::string{g_fuzz_target};
 }};
 
-#if defined(PROVIDE_FUZZ_MAIN_FUNCTION)
-static bool read_stdin(std::vector<uint8_t>& data)
-{
-    std::istream::char_type buffer[1024];
-    std::streamsize length;
-    while ((std::cin.read(buffer, 1024), length = std::cin.gcount()) > 0) {
-        data.insert(data.end(), buffer, buffer + length);
-    }
-    return length == 0;
-}
-#endif
-
-#if defined(PROVIDE_FUZZ_MAIN_FUNCTION) && !defined(__AFL_LOOP)
-static bool read_file(fs::path p, std::vector<uint8_t>& data)
-{
-    uint8_t buffer[1024];
-    FILE* f = fsbridge::fopen(p, "rb");
-    if (f == nullptr) return false;
-    do {
-        const size_t length = fread(buffer, sizeof(uint8_t), sizeof(buffer), f);
-        if (ferror(f)) return false;
-        data.insert(data.end(), buffer, buffer + length);
-    } while (!feof(f));
-    fclose(f);
-    return true;
-}
-#endif
-
-#if defined(PROVIDE_FUZZ_MAIN_FUNCTION) && !defined(__AFL_LOOP)
-static fs::path g_input_path;
-[[noreturn]] void signal_handler(int signal)
-{
-    if (signal == SIGABRT) {
-        std::cerr << "Error processing input " << g_input_path << std::endl;
-    } else {
-        std::cerr << "Unexpected signal " << signal << " received\n";
-    }
-    std::_Exit(EXIT_FAILURE);
-}
-#endif
-
 // Whether or not these return depends on the build config.
 #if defined(__GNUC__)
 #pragma GCC diagnostic push
@@ -214,13 +173,6 @@ static void initialize()
     ResetCoverageCounters();
 }
 
-// This function is used by libFuzzer
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
-{
-    test_one_input({data, size});
-    return 0;
-}
-
 // This function is used by libFuzzer
 extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv)
 {
@@ -232,6 +184,54 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv)
 #pragma GCC diagnostic pop
 #endif
 
+#if defined(PROVIDE_FUZZ_MAIN_FUNCTION)
+static bool read_stdin(std::vector<uint8_t>& data)
+{
+    std::istream::char_type buffer[1024];
+    std::streamsize length;
+    while ((std::cin.read(buffer, 1024), length = std::cin.gcount()) > 0) {
+        data.insert(data.end(), buffer, buffer + length);
+    }
+    return length == 0;
+}
+#endif
+
+#if defined(PROVIDE_FUZZ_MAIN_FUNCTION) && !defined(__AFL_LOOP)
+static bool read_file(fs::path p, std::vector<uint8_t>& data)
+{
+    uint8_t buffer[1024];
+    FILE* f = fsbridge::fopen(p, "rb");
+    if (f == nullptr) return false;
+    do {
+        const size_t length = fread(buffer, sizeof(uint8_t), sizeof(buffer), f);
+        if (ferror(f)) return false;
+        data.insert(data.end(), buffer, buffer + length);
+    } while (!feof(f));
+    fclose(f);
+    return true;
+}
+#endif
+
+#if defined(PROVIDE_FUZZ_MAIN_FUNCTION) && !defined(__AFL_LOOP)
+static fs::path g_input_path;
+[[noreturn]] void signal_handler(int signal)
+{
+    if (signal == SIGABRT) {
+        std::cerr << "Error processing input " << g_input_path << std::endl;
+    } else {
+        std::cerr << "Unexpected signal " << signal << " received\n";
+    }
+    std::_Exit(EXIT_FAILURE);
+}
+#endif
+
+// This function is used by libFuzzer
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
+{
+    test_one_input({data, size});
+    return 0;
+}
+
 #if defined(PROVIDE_FUZZ_MAIN_FUNCTION)
 int main(int argc, char** argv)
 {

nit: I think this can be done with a lot less code churn by just moving `LLVMFuzzerInitialize` next to `initialize`? <details> <summary>git diff on 75b8304271</summary> ```diff diff --git a/src/test/fuzz/fuzz.cpp b/src/test/fuzz/fuzz.cpp index 97e185a577..b740ec0ac8 100644 --- a/src/test/fuzz/fuzz.cpp +++ b/src/test/fuzz/fuzz.cpp @@ -90,47 +90,6 @@ const std::function<std::string()> G_TEST_GET_FULL_NAME{[]{ return std::string{g_fuzz_target}; }}; -#if defined(PROVIDE_FUZZ_MAIN_FUNCTION) -static bool read_stdin(std::vector<uint8_t>& data) -{ - std::istream::char_type buffer[1024]; - std::streamsize length; - while ((std::cin.read(buffer, 1024), length = std::cin.gcount()) > 0) { - data.insert(data.end(), buffer, buffer + length); - } - return length == 0; -} -#endif - -#if defined(PROVIDE_FUZZ_MAIN_FUNCTION) && !defined(__AFL_LOOP) -static bool read_file(fs::path p, std::vector<uint8_t>& data) -{ - uint8_t buffer[1024]; - FILE* f = fsbridge::fopen(p, "rb"); - if (f == nullptr) return false; - do { - const size_t length = fread(buffer, sizeof(uint8_t), sizeof(buffer), f); - if (ferror(f)) return false; - data.insert(data.end(), buffer, buffer + length); - } while (!feof(f)); - fclose(f); - return true; -} -#endif - -#if defined(PROVIDE_FUZZ_MAIN_FUNCTION) && !defined(__AFL_LOOP) -static fs::path g_input_path; -[[noreturn]] void signal_handler(int signal) -{ - if (signal == SIGABRT) { - std::cerr << "Error processing input " << g_input_path << std::endl; - } else { - std::cerr << "Unexpected signal " << signal << " received\n"; - } - std::_Exit(EXIT_FAILURE); -} -#endif - // Whether or not these return depends on the build config. #if defined(__GNUC__) #pragma GCC diagnostic push @@ -214,13 +173,6 @@ static void initialize() ResetCoverageCounters(); } -// This function is used by libFuzzer -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) -{ - test_one_input({data, size}); - return 0; -} - // This function is used by libFuzzer extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { @@ -232,6 +184,54 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) #pragma GCC diagnostic pop #endif +#if defined(PROVIDE_FUZZ_MAIN_FUNCTION) +static bool read_stdin(std::vector<uint8_t>& data) +{ + std::istream::char_type buffer[1024]; + std::streamsize length; + while ((std::cin.read(buffer, 1024), length = std::cin.gcount()) > 0) { + data.insert(data.end(), buffer, buffer + length); + } + return length == 0; +} +#endif + +#if defined(PROVIDE_FUZZ_MAIN_FUNCTION) && !defined(__AFL_LOOP) +static bool read_file(fs::path p, std::vector<uint8_t>& data) +{ + uint8_t buffer[1024]; + FILE* f = fsbridge::fopen(p, "rb"); + if (f == nullptr) return false; + do { + const size_t length = fread(buffer, sizeof(uint8_t), sizeof(buffer), f); + if (ferror(f)) return false; + data.insert(data.end(), buffer, buffer + length); + } while (!feof(f)); + fclose(f); + return true; +} +#endif + +#if defined(PROVIDE_FUZZ_MAIN_FUNCTION) && !defined(__AFL_LOOP) +static fs::path g_input_path; +[[noreturn]] void signal_handler(int signal) +{ + if (signal == SIGABRT) { + std::cerr << "Error processing input " << g_input_path << std::endl; + } else { + std::cerr << "Unexpected signal " << signal << " received\n"; + } + std::_Exit(EXIT_FAILURE); +} +#endif + +// This function is used by libFuzzer +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + test_one_input({data, size}); + return 0; +} + #if defined(PROVIDE_FUZZ_MAIN_FUNCTION) int main(int argc, char** argv) { ``` </details>
fanquake (Migrated from github.com) reviewed 2026-11-23 14:45:49 +00:00
fanquake (Migrated from github.com) commented 2026-11-23 14:45:49 +00:00

Thanks, simplified this.

Thanks, simplified this.
stickies-v commented 2026-11-23 15:51:42 +00:00 (Migrated from github.com)

re-ACK 1de12da093

re-ACK 1de12da093a553376731aee7efdfad9b3357b8c5
fanquake (Migrated from github.com) reviewed 2026-11-25 11:46:28 +00:00
fanquake (Migrated from github.com) commented 2026-11-25 11:46:28 +00:00

cc @ryanofsky

cc @ryanofsky
hebasto (Migrated from github.com) reviewed 2026-12-03 12:26:28 +00:00
hebasto (Migrated from github.com) left a comment

The implementation of MakeWalletLoader() depends on the ENABLE_WALLET configuration variable.

We could use a pragma here:

--- a/src/dummywallet.cpp
+++ b/src/dummywallet.cpp
@@ -57,9 +57,18 @@ const WalletInitInterface& g_wallet_init_interface = DummyWalletInit();

 namespace interfaces {

+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-noreturn"
+#endif
+
 std::unique_ptr<WalletLoader> MakeWalletLoader(Chain& chain, ArgsManager& args)
 {
     throw std::logic_error("Wallet function called in non-wallet build.");
 }

+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+
 } // namespace interfaces
The implementation of [`MakeWalletLoader()`](https://github.com/bitcoin/bitcoin/blob/8bb33f349e6d9c3bbcd8cd108cecf67048d907a2/src/interfaces/wallet.h#L452-L454) depends on the `ENABLE_WALLET` configuration variable. We could use a pragma here: ```diff --- a/src/dummywallet.cpp +++ b/src/dummywallet.cpp @@ -57,9 +57,18 @@ const WalletInitInterface& g_wallet_init_interface = DummyWalletInit(); namespace interfaces { +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-noreturn" +#endif + std::unique_ptr<WalletLoader> MakeWalletLoader(Chain& chain, ArgsManager& args) { throw std::logic_error("Wallet function called in non-wallet build."); } +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + } // namespace interfaces ```
hebasto (Migrated from github.com) commented 2026-12-03 12:20:39 +00:00

__GNUC__ is not defined by clang-cl.exe on Windows, so the pragma is skipped. As a result, a Release build configured with -DBUILD_FUZZ_BINARY=ON emits a -Wmissing-noreturn warning for initialize().

#if defined(__GNUC__) || defined(__clang__)
`__GNUC__` is not defined by `clang-cl.exe` on Windows, so the pragma is skipped. As a result, a Release build configured with `-DBUILD_FUZZ_BINARY=ON` emits a `-Wmissing-noreturn` warning for `initialize()`. ```suggestion #if defined(__GNUC__) || defined(__clang__) ```
fanquake (Migrated from github.com) reviewed 2026-12-03 13:00:22 +00:00
fanquake (Migrated from github.com) commented 2026-12-03 13:00:22 +00:00

Added.

Added.
fanquake commented 2026-12-03 13:03:06 +00:00 (Migrated from github.com)

Rebased for #37047 and addressed comments.

Rebased for #37047 and addressed comments.
hebasto (Migrated from github.com) reviewed 2026-12-03 14:13:36 +00:00
hebasto (Migrated from github.com) commented 2026-12-03 14:13:36 +00:00

Clang 22.1 and later handles such cases correctly and emits no warning.

Clang 22.1 and later handles such cases [correctly](https://github.com/llvm/llvm-project/pull/167523) and emits no warning.
fanquake (Migrated from github.com) reviewed 2026-12-03 14:18:11 +00:00
fanquake (Migrated from github.com) commented 2026-12-03 14:18:11 +00:00
Yes. See https://github.com/bitcoin/bitcoin/pull/35911#discussion_r4658607989.
hebasto (Migrated from github.com) reviewed 2026-12-03 14:25:37 +00:00
hebasto (Migrated from github.com) commented 2026-12-03 14:25:37 +00:00

I would rather leave a few (possibly redundant) annotations in place, and then just drop them once support for < Clang 22 is dropped?

Should we add a TODO comment? Otherwise, it will be easy to forget to drop them when the time comes.

> I would rather leave a few (possibly redundant) annotations in place, and then just drop them once support for < Clang 22 is dropped? Should we add a TODO comment? Otherwise, it will be easy to forget to drop them when the time comes.
fanquake (Migrated from github.com) reviewed 2026-12-03 14:40:53 +00:00
fanquake (Migrated from github.com) commented 2026-12-03 14:40:53 +00:00

I'm not sure if it's needed (this is also a few years away), and they are not only for Clang. Otherwise feel free to propose a diff.

I'm not sure if it's needed (this is also a few years away), and they are not only for Clang. Otherwise feel free to propose a diff.
stickies-v (Migrated from github.com) reviewed 2026-12-03 18:09:28 +00:00
stickies-v (Migrated from github.com) commented 2026-12-03 18:09:28 +00:00

I think we need a similar exception for builds without asmap:

git diff on 9acce2abd8
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp
index e407b95c6b..982acfbf8c 100644
--- a/src/rpc/net.cpp
+++ b/src/rpc/net.cpp
@@ -1179,6 +1179,12 @@ static RPCMethod getaddrmaninfo()
     };
 }
 
+// Without embedded ASMap data, the RPC lambda only throws.
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-noreturn"
+#endif
+
 static RPCMethod exportasmap()
 {
     return RPCMethod{
@@ -1229,6 +1235,10 @@ static RPCMethod exportasmap()
     };
 }
 
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+
 UniValue AddrmanEntryToJSON(const AddrInfo& info, const CConnman& connman)
 {
     UniValue ret(UniValue::VOBJ);

I think we need a similar exception for builds without asmap: <details> <summary>git diff on 9acce2abd8</summary> ```diff diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index e407b95c6b..982acfbf8c 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -1179,6 +1179,12 @@ static RPCMethod getaddrmaninfo() }; } +// Without embedded ASMap data, the RPC lambda only throws. +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-noreturn" +#endif + static RPCMethod exportasmap() { return RPCMethod{ @@ -1229,6 +1235,10 @@ static RPCMethod exportasmap() }; } +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif + UniValue AddrmanEntryToJSON(const AddrInfo& info, const CConnman& connman) { UniValue ret(UniValue::VOBJ); ``` </details>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!35911
No description provided.