1 minor finding · 2 suggestions
Findings
[minor] · The -Wmissing-noreturn suppression skips clang-cl
The documented BUILD_FUZZ_BINARY=ON, BUILD_FOR_FUZZING=OFF Release configuration leaves -Wmissing-noreturn unsuppressed under clang-cl and can fail with CMAKE_COMPILE_WARNING_AS_ERROR=ON; this failure was not reproduced.
Location: src/test/fuzz/fuzz.cpp:135 (head).
Details and suggested fix
CMake adds the warning through warn_interface for clang-cl too, but neither guard around the diagnostic push/pop matches it: MSVC-compatibility mode defines __clang__, not __GNUC__. In this configuration, both G_FUZZING_BUILD and G_ABORT_ON_FAILED_ASSUME are false, so the if constexpr branch unconditionally calls std::exit() and initialize() cannot return normally. Windows fuzz CI enables BUILD_FOR_FUZZING=ON, so it does not cover this case. Extend both guards to #if defined(__GNUC__) || defined(__clang__) so clang-cl also uses the existing GCC diagnostic pragmas.
Optional improvements
[suggestion] · [[noreturn]] conflicts with IPC proxy return paths
The generated proxies can return after successful deprecated-method replies despite [[noreturn]] on the interface; current server stubs always throw, and no C++ caller through a proxy was found.
Location: src/interfaces/mining.h:81 (head).
Details and suggested fix
interfaces::BlockTemplate::submitSolutionOld7() and interfaces::Init::makeMiningOld2() remain mapped in the Cap'n Proto schemas. The generator emits overrides that call clientInvoke() and return normally after a successful reply. Although overrides do not inherit [[noreturn]], calls through the annotated base declarations let the compiler assume they never return. A successful remote reply would therefore cause undefined behavior in such a caller. Keep these virtual declarations unannotated and suppress -Wmissing-noreturn locally around their inline throwing bodies. This preserves the existing server errors without imposing an unsupported guarantee on the proxies.
[suggestion] · AssertUnreachable() drops test and fuzz diagnostic reasons
Abort output from converted test and fuzz assertions loses explanatory strings such as "Unexpected exception type", although source locations and function names remain.
Location: src/test/util/net.cpp:240 (head).
Details and suggested fix
AssertUnreachable() hardcodes the message passed to internal_abort_helper(). Converting assert(false && "...") to AssertUnreachable(); // ... moves the reason out of the emitted diagnostic, and the new linter rejects the old form. The location and function name mostly explain the Sock assignment failures, but GetFuture()'s catch-all now omits why it stopped. Allow an optional reason argument, such as AssertUnreachable("Unexpected exception type"), and forward it to the same [[noreturn]] helper while retaining the no-argument form.
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Documented decisions
Compiler recognition of terminating assertions has historically depended on platform headers as well as source code. In 2023, #28092 documented that older mingw-w64 headers lacked the needed noreturn attributes, causing return-type warnings for functions ending in assert(false); the proposed accommodation was a temporary Windows CI warning suppression until fixed headers were available.
This explains why apparently redundant unreachable endpoints and compiler-specific accommodations exist around these patterns. The change addresses a portability concern with prior concrete history, rather than just adopting a stylistic attribute convention.