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

Merged
Christopher-Sundeby merged 1 commit from upstream-pr/1146 into main 2026-11-29 15:44:52 +00:00
Christopher-Sundeby commented 2026-11-24 19:11:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Christopher-Sundeby on 2026-11-24T19:11:45Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5478636745 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1146). Originally posted by [Christopher-Sundeby](https://github.com/Christopher-Sundeby) on 2026-11-24T19:11:45Z. --- 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)
abnalstlll-byte commented 2026-11-24 19:12:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T19:12:37Z.

Review: APPROVED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045680724 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1146#pullrequestreview-6045680724). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T19:12:37Z. **Review:** APPROVED --- 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.
Deedlyy commented 2026-11-24 20:13:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:13:17Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7143210020 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1146#issuecomment-7143210020). Originally posted by [Deedlyy](https://github.com/Deedlyy) on 2026-11-24T20:13:17Z. --- **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
Christopher-Sundeby commented 2026-11-27 19:30:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Christopher-Sundeby on 2026-11-27T19:30:22Z.


Hi @aslan2142, could you approve the workflows on this one and take a look when you have a moment? It is a 3-line test-only change (renames a shadowed HANDLE in file_system_test.cpp for MSVC C4456), it still merges cleanly with current main, and it has a MERGE recommendation above. It is my only open pull request, so it also holds the slot for two tested fixes waiting on my fork (RT-CONSOLE-HEAP-GPU-SHARING-AND-RETIRE and RT-PSO-STREAM-SO-SEMANTIC-COPY in #1608). Thanks!

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7226593618 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1146#issuecomment-7226593618). Originally posted by [Christopher-Sundeby](https://github.com/Christopher-Sundeby) on 2026-11-27T19:30:22Z. --- Hi @aslan2142, could you approve the workflows on this one and take a look when you have a moment? It is a 3-line test-only change (renames a shadowed `HANDLE` in `file_system_test.cpp` for MSVC C4456), it still merges cleanly with current `main`, and it has a MERGE recommendation above. It is my only open pull request, so it also holds the slot for two tested fixes waiting on my fork (RT-CONSOLE-HEAP-GPU-SHARING-AND-RETIRE and RT-PSO-STREAM-SO-SEMANTIC-COPY in #1608). Thanks!
OreoFR commented 2026-11-28 21:46:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:46:56Z.


Verified by OreoFR

  • Base: main c1ecf04ed + PR head bbdb7543b; green run in a merge package of 9 PRs, no new ctest failure vs main
  • Test: file_system_test build (/W4) + ctest -R ^file_system$
  • Red on main: main builds with warning C4456 (file_system_test.cpp line 1483, 'h' hides a declaration)
  • Green with the PR: no C4456 left in file_system_test.cpp, file_system OK
  • Verdict: READY (build only) (test-only PR, no test can go red)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246267727 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1146#issuecomment-7246267727). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:46:56Z. --- **Verified by OreoFR** - Base: main `c1ecf04ed` + PR head `bbdb7543b`; green run in a merge package of 9 PRs, no new ctest failure vs main - Test: `file_system_test build (/W4) + ctest -R ^file_system$` - Red on main: main builds with warning C4456 (file_system_test.cpp line 1483, 'h' hides a declaration) - Green with the PR: no C4456 left in file_system_test.cpp, file_system OK - Verdict: READY (build only) (test-only PR, no test can go red) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
zmasi commented 2026-11-29 01:00:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:00:02Z.


Windows 11 + MSVC 19.44 Verification — PASS (bbdb7543b7)

Verified bbdb7543b7 (TEST-FS-C4456) merged onto origin/main (e66c65b950 / 16f5053047, 0 conflicts, plus a 5-way combined merge alongside #988, #955, #2544, and #1738) on native Windows 11 (10.0.26200.9974) with MSVC 19.44.35228.

Checks Run

  • Red (origin/main under /W4 /WX):
    • Compiling runtime/test/file_system_test.cpp with /std:c++20 /O2 /MD /EHsc /W4 /WX /permissive- /utf-8 failed (rc=2) on warning C4456: declaration of 'h' hides previous local declaration at line 1291.
  • Green (#1146 + origin/main under /W4 /WX + runtime execution):
    • file_system_test.exe (test/file_system_test.cpp, shims/file_system.cpp, shims/registry.cpp) compiled cleanly with 0 warnings under /W4 /WX (rc=0) and passed the full Windows NTFS GAME: / write-overlay test suite (rc=0).

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248492121 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1146#issuecomment-7248492121). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T01:00:02Z. --- ## Windows 11 + MSVC `19.44` Verification — PASS (`bbdb7543b7`) Verified `bbdb7543b7` (`TEST-FS-C4456`) merged onto `origin/main` (`e66c65b950` / `16f5053047`, `0` conflicts, plus a 5-way combined merge alongside `#988`, `#955`, `#2544`, and `#1738`) on native Windows 11 (`10.0.26200.9974`) with MSVC `19.44.35228`. ### Checks Run - **Red (`origin/main` under `/W4 /WX`)**: - Compiling `runtime/test/file_system_test.cpp` with `/std:c++20 /O2 /MD /EHsc /W4 /WX /permissive- /utf-8` failed (`rc=2`) on `warning C4456: declaration of 'h' hides previous local declaration` at line `1291`. - **Green (`#1146 + origin/main` under `/W4 /WX` + runtime execution)**: - `file_system_test.exe` (`test/file_system_test.cpp`, `shims/file_system.cpp`, `shims/registry.cpp`) compiled cleanly with **`0` warnings under `/W4 /WX`** (`rc=0`) and passed the full Windows NTFS `GAME:` / write-overlay test suite (`rc=0`). AI-assisted.
MoonEyes commented 2026-11-29 15:44:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T15:44:55Z.


Merged. Tested by @zmasi on head bbdb7543b (CPU only (Windows 11, MSVC)): Red: main file_system_test.cpp fails /W4 /WX with C4456; green: 0 warnings, test passes. Correction: I had not shown that every failed or cancelled CI job on this head was also red on main. Not shown: label (cancelled). My earlier sentence was too broad. Thanks @Christopher-Sundeby!

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7258334678 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1146#issuecomment-7258334678). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T15:44:55Z. --- Merged. Tested by @zmasi on head bbdb7543b (CPU only (Windows 11, MSVC)): Red: main file_system_test.cpp fails /W4 /WX with C4456; green: 0 warnings, test passes. Correction: I had not shown that every failed or cancelled CI job on this head was also red on main. Not shown: label (cancelled). My earlier sentence was too broad. Thanks @Christopher-Sundeby! AI-assisted: yes
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
ProjectLeonida/mandy!1146
No description provided.