Review report

bitcoin/bitcoin: PR #36808

1 major finding · 1 minor finding

Findings

Link

[major] · Unconditional POSIX socket headers break the native Windows fuzz build

The new unconditional includes of sys/socket.h and netinet/in.h prevent the fuzz executable from compiling in the checked-in native Windows clang-cl configuration.

Location: src/test/fuzz/util/net.h:32 (head).

Details and suggested fix

src/test/fuzz/util/net.h now includes <sys/socket.h> directly, while addrman.cpp and asmap.cpp include <netinet/in.h>. The MSVC/Windows SDK headers used by clang-cl do not provide these files. Both translation units are unconditional members of the fuzz executable, and the Windows fuzz CI job enables BUILD_FOR_FUZZING, which forces that executable to build. Consequently, preprocessing fails with missing-header errors even though the socket declarations are available through the compatibility layer. Replace these direct POSIX socket includes with <compat/compat.h>, which selects Winsock under WIN32 and exports the POSIX headers elsewhere. sys/types.h exists in the UCRT and is not the cause of this failure. This conclusion follows from source and build configuration inspection, not an observed Windows build.


Link

[minor] · The include-guard lint misses code after a block-comment terminator

The new placement check accepts code outside an include guard when it follows */ on a line classified as comment-only.

Location: test/lint/lint-include-guards.py:76 (head).

Details and suggested fix

After an otherwise correct include guard, append /* note */ int outside;, or append /* note followed by */ int outside; on the next line. Both forms leave the three expected guard directives intact. _is_comment_or_blank returns True for a line starting with /* or beginning inside an open block comment, regardless of code after */. The caller then skips the line before checking whether it lies outside the guard, so neither declaration is reported. No current header with this triggering pattern was identified; this is a gap in the new enforcement. After finding */, scan the remaining text and classify the line as comment-only only if nothing except whitespace or further comments remains. Add regression cases for both forms.


Coverage details