fix: add static_cast for Windows cross-compilation in file_io.hpp#22056
Merged
nventuro merged 2 commits intoMar 26, 2026
Conversation
…s-compilation On Windows (MinGW), ::write() takes unsigned int for the count parameter, not size_t. The implicit conversion from size_t to unsigned int triggers -Wshorten-64-to-32 which is promoted to an error by -Werror. This fixes the v4 nightly build failure in build_cross_windows.
nventuro
approved these changes
Mar 26, 2026
Collaborator
Author
Flakey Tests🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
ludamad
added a commit
that referenced
this pull request
Mar 26, 2026
…l_arithmetic.hpp (#22072) ## Summary Fixes the second Windows cross-compilation failure on v4-next (after PR #22056 fixed the first one in file_io.hpp). The header `polynomial_arithmetic.hpp` declares `unsigned long num_coeffs` but the implementation (.cpp) uses `const size_t num_coeffs`. On Linux these are the same type, but on Windows LLP64 `unsigned long` is 32-bit while `size_t` is 64-bit, causing `-Wshorten-64-to-32` when passing `domain.size` (size_t). This function was removed on `next` before Windows cross-compilation was added, so it was never caught there. It's v4-specific legacy code. CI failure: https://github.com/AztecProtocol/aztec-packages/actions/runs/23608075427/job/68756199559 ClaudeBox log: https://claudebox.work/s/fe9af88896e7e6d6?run=8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Windows cross-compilation failures on v4-next.
Fix 1:
file_io.hpp—static_cast<unsigned int>()on::write()callOn Windows (MinGW),
::write()takesunsigned intfor the count parameter, notsize_t. The implicit conversion triggers-Wshorten-64-to-32which is an error under-Werror.Fix 2:
polynomial_arithmetic.hpp—unsigned long→size_ttype mismatchThe header declared
unsigned long num_coeffsbut the implementation (.cpp) usesconst size_t num_coeffs. On Linux these are the same type, but on Windows LLP64unsigned longis 32-bit whilesize_tis 64-bit, causing-Wshorten-64-to-32when passingdomain.size(size_t).Both fixes match what already exists on
next(where the polynomial code was removed entirely).CI log of the original failure: http://ci.aztec-labs.com/672ba34595788ff5
CI log of the polynomial.cpp failure: https://github.com/AztecProtocol/aztec-packages/actions/runs/23608075427/job/68756199559