WIP: scripted-diff: [test] Add util/check.h includes for assertions

bitcoin/bitcoin: PR #36074

2 major findings

Findings

Link

[major] · Terminal Assert(false) breaks GCC warning-as-error fuzz builds

The terminal assertion conversions in StateRank and ConsumeNodeSmart produced -Werror=return-type errors in the recorded GCC 16.2.0 experiment, preventing those fuzz translation units from compiling.

Location: src/test/fuzz/http_request.cpp:86 (head).

Details and suggested fix

Both non-void functions now finish their enum switches with Assert(false), including ConsumeNodeSmart in src/test/fuzz/miniscript.cpp:839. That macro calls inline_assertion_check, which returns T&& and is not [[noreturn]], so GCC diagnoses control reaching the end of each function even though the failed assertion still aborts. Retain assert(false) at these two terminal sites while keeping <util/check.h>, which exports <cassert> and rejects NDEBUG. The recorded experiment reports that this two-line correction makes both translation units compile. The previous_releases CI configuration also enables the fuzz target with -Werror, but its GCC 12 compiler and the complete job were not executed.


Link

[major] · The include-sorting verify script selects the wrong commit

The scripted-diff checker runs fa8dfb9 from its parent, so git show -U0 HEAD~1 selects the upstream base instead of the assertion changes; the resulting lint failure is expected, not observed.

Location: src/test/fuzz/versionbits.cpp:5 (head).

Details and suggested fix

commit-script-check.sh checks out "$commit"^ before executing the verify script and then compares the resulting tree with "$commit". For fa8dfb9, that puts HEAD at facf9cc, making HEAD~1 name the upstream base rather than the assertion/include commit. clang-format-diff.py derives its filenames and hunk ranges from this input, so the script targets unrelated changes instead of regenerating the sorting commit. Use git show -U0 HEAD | ./contrib/devtools/clang-format-diff.py -p1 -i -v, then rerun the scripted-diff checker.


Coverage details