file_system_test: build without the C4456 shadow warning (TEST-FS-C4456) #1146

Open
github-bot wants to merge 1 commit from github-bot/gh-1146 into main AGit
Owner

@⁠Christopher-Sundeby on GitHub · 2026-11-24 19:11 UTC · original
Christopher-Sundeby:fix/file-system-test-c4456 → main · +3 −3 · 1 files · 1 commits · open

Claimed in the coordination issue as: TEST-FS-C4456

What and why

The reserved-folder probe in runtime/test/file_system_test.cpp declares const HANDLE h inside a loop that
already sits in the scope of an outer HANDLE h, which MSVC reports at /W4 as C4456. The inner handle is renamed
refused; the checks themselves are unchanged.

Tested

  • Windows 11, MSVC 14.44 (VS 2022 Build Tools), Ninja, RelWithDebInfo.
  • main (6293c1c4f): file_system_test.cpp(1291): warning C4456. With this change: builds with no warnings.
  • file_system_test.exe: 494 checks, 0 failures.

GPUs tested: n/a (CPU-only test)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.

🤖 Generated with Claude Code

**@⁠Christopher-Sundeby** on GitHub · 2026-11-24 19:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1146) `Christopher-Sundeby:fix/file-system-test-c4456` → `main` · +3 −3 · 1 files · 1 commits · open Claimed in the coordination issue as: TEST-FS-C4456 ### What and why The reserved-folder probe in `runtime/test/file_system_test.cpp` declares `const HANDLE h` inside a loop that already sits in the scope of an outer `HANDLE h`, which MSVC reports at /W4 as C4456. The inner handle is renamed `refused`; the checks themselves are unchanged. ### Tested - Windows 11, MSVC 14.44 (VS 2022 Build Tools), Ninja, RelWithDebInfo. - `main` (6293c1c4f): `file_system_test.cpp(1291): warning C4456`. With this change: builds with no warnings. - `file_system_test.exe`: 494 checks, 0 failures. GPUs tested: n/a (CPU-only test) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The reserved-folder probe (RT-294) declared `const HANDLE h` inside a loop
that already sits in the scope of the outer `HANDLE h`, which MSVC reports
at /W4 as C4456. Name the inner handle `refused`; the checks are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:40:09 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 19:12 UTC · original · approved these changes

Reviewed and verified. Cleanly eliminates MSVC /W4 warning C4456 (declaration shadows previous local declaration) in runtime/test/file_system_test.cpp:1291 by renaming inner HANDLE h to refused. Builds warning-free and passes 494/494 checks. 100% clean-room.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 19:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1146#pullrequestreview-6045680724) · **approved these changes** Reviewed and verified. Cleanly eliminates MSVC /W4 warning C4456 (declaration shadows previous local declaration) in `runtime/test/file_system_test.cpp:1291` by renaming inner `HANDLE h` to `refused`. Builds warning-free and passes 494/494 checks. 100% clean-room.
Author
Owner

@⁠Deedlyy on GitHub · 2026-11-24 20:13 UTC · original

Recommendation: [MERGE]

Reasoning: Renames a shadowed HANDLE h in file_system_test.cpp to silence MSVC C4456 at /W4. Trivial test-only change; 494 checks still pass. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 1/10

**@⁠Deedlyy** on GitHub · 2026-11-24 20:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1146#issuecomment-7143210020) **Recommendation:** [MERGE] **Reasoning:** Renames a shadowed `HANDLE h` in `file_system_test.cpp` to silence MSVC C4456 at /W4. Trivial test-only change; 494 checks still pass. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 1/10
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1146/head:github-bot/gh-1146'
git switch 'github-bot/gh-1146'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1146'
git switch 'github-bot/gh-1146'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1146'
git switch 'github-bot/gh-1146'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1146'
git switch 'main'
git merge --squash 'github-bot/gh-1146'
git switch 'main'
git merge --ff-only 'github-bot/gh-1146'
git switch 'main'
git merge 'github-bot/gh-1146'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.