Repository navigation
Conversation
…lang 23 builds it clang 23 (llvm-mingw 20261104, the Builder's toolchain) adds -Wunused-but-set-global, and the fixture compiles with -Werror: the cut-out nn_hid.c code only resets oc_consumed_pads, so the check failed to build on Windows with that clang. The fixture now checks the value it expects (hos_oc_wait stays 0, so the ocarina note layer takes no pad button). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Joey-Magnus
left a comment
There was a problem hiding this comment.
I merged this into current main and ran tests/test_input_background.py. It passes here with clang 21, which doesn't have -Wunused-but-set-global, so I couldn't reproduce the clang 23 error itself. The fix is the right kind, though. tests/input_background_test.c:247 now asserts a value the fixture already expects: hos_oc_wait stays 0, so the ocarina layer takes no pad button. That gives the variable a read without turning the warning off, and production code is unchanged. Several open PRs also edit this fixture (#2604, #2465, #2151, #2478, #2430), but none of them touches the end checks, so they shouldn't conflict. This also clears the failure that #2781 and #2769 list as a known local failure on Windows with the shipped llvm-mingw.
tests/test_input_background.pyfails to build its fixture on Windows with the llvm-mingw the Builder ships (clang 23.1.5, 20261104): clang 23 adds-Wunused-but-set-global, and the fixture compiles with-Werror.What changed: the code the check cuts out of
host/nn_hid.conly resetsoc_consumed_pads, so clang sees it set and never read:The fixture now checks the value it already expects,
oc_consumed_pads == 0(its own note:hos_oc_waitstays 0, so nothing is consumed), next to its other end checks. That is a check, not a warning switched off; production code is unchanged.Tests:
python -I -B tests/run_all.py test_input_backgroundon Windows 11 with that llvm-mingw asgcc: failed before, passes after. Tests only, nothing on screen.🤖 Generated with Claude Code