xcrdapi: build the read test again under MSVC /W4 /WX #400

Merged
KainanP merged 1 commit from upstream-pr/400 into main 2026-11-28 15:07:14 +00:00
KainanP commented 2026-11-28 14:36:13 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by KainanP on 2026-11-28T14:36:13Z.


On Windows with MSVC (VS 2022 Build Tools 14.44, vcvars64), python build.py all on main stops at the xcrdapi read test:

runtime\xcrdapi\guest.cpp(429): error C2220: the following warning is treated as an error
runtime\xcrdapi\guest.cpp(429): warning C4456: declaration of 'count' hides previous local declaration
runtime\xcrdapi\guest.cpp(459): warning C4456: declaration of 'size' hides previous local declaration
runtime\xcrdapi\guest.cpp(465): warning C4267: 'argument': conversion from 'size_t' to '_Ty', possible loss of data

The page-array and cancellation blocks from 6e994ab reuse count and size from the enclosing scope, and the cancellation block pushes size_t lengths into a byte vector. clang-cl doesn't warn on these, so the Linux build didn't catch it.

The fix renames the inner locals (pages, total) and narrows the stored-block length on purpose. The length is at most 65535, so it's held as UINT16, and its bytes and the bytes of its one's complement come from that value. The bytes the test writes don't change. No warning is suppressed.

Checked on Windows 11 with MSVC 14.44:

  • build.py all passes with CARGO_BUILD_JOBS=4.
  • tuxbox.py verify --only xcrdapi --backend native passes (raw=16 zlib=16 guards=2 errors=2 cancellation=2 bc1=4 bc7=2 pages=2 autosubmit=64 PASS).

AI use: Claude Code reproduced the failure, wrote the change and ran the build and check above; KainanP published it.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:issue:5541212143 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/400). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-28T14:36:13Z. --- On Windows with MSVC (VS 2022 Build Tools 14.44, `vcvars64`), `python build.py all` on main stops at the xcrdapi read test: ``` runtime\xcrdapi\guest.cpp(429): error C2220: the following warning is treated as an error runtime\xcrdapi\guest.cpp(429): warning C4456: declaration of 'count' hides previous local declaration runtime\xcrdapi\guest.cpp(459): warning C4456: declaration of 'size' hides previous local declaration runtime\xcrdapi\guest.cpp(465): warning C4267: 'argument': conversion from 'size_t' to '_Ty', possible loss of data ``` The page-array and cancellation blocks from 6e994ab reuse `count` and `size` from the enclosing scope, and the cancellation block pushes `size_t` lengths into a byte vector. clang-cl doesn't warn on these, so the Linux build didn't catch it. The fix renames the inner locals (`pages`, `total`) and narrows the stored-block length on purpose. The length is at most 65535, so it's held as `UINT16`, and its bytes and the bytes of its one's complement come from that value. The bytes the test writes don't change. No warning is suppressed. Checked on Windows 11 with MSVC 14.44: - `build.py all` passes with `CARGO_BUILD_JOBS=4`. - `tuxbox.py verify --only xcrdapi --backend native` passes (`raw=16 zlib=16 guards=2 errors=2 cancellation=2 bc1=4 bc7=2 pages=2 autosubmit=64 PASS`). _AI use: Claude Code reproduced the failure, wrote the change and ran the build and check above; KainanP published it._ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
brcly/TuxBox!400
No description provided.