file_system_test: build without the C4456 shadow warning (TEST-FS-C4456) #1146
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1146"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.cppdeclaresconst HANDLE hinside a loop thatalready sits in the scope of an outer
HANDLE h, which MSVC reports at /W4 as C4456. The inner handle is renamedrefused; the checks themselves are unchanged.Tested
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
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🤖 Generated with Claude Code
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:1291by renaming innerHANDLE htorefused. Builds warning-free and passes 494/494 checks. 100% clean-room.Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:13:17Z.
Recommendation: [MERGE]
Reasoning: Renames a shadowed
HANDLE hinfile_system_test.cppto 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 withmain. Merge once the queued checks are green.Impact level: 1/10
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
HANDLEinfile_system_test.cppfor MSVC C4456), it still merges cleanly with currentmain, 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!Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:46:56Z.
Verified by OreoFR
c1ecf04ed+ PR headbbdb7543b; green run in a merge package of 9 PRs, no new ctest failure vs mainfile_system_test build (/W4) + ctest -R ^file_system$AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:00:02Z.
Windows 11 + MSVC
19.44Verification — PASS (bbdb7543b7)Verified
bbdb7543b7(TEST-FS-C4456) merged ontoorigin/main(e66c65b950/16f5053047,0conflicts, plus a 5-way combined merge alongside#988,#955,#2544, and#1738) on native Windows 11 (10.0.26200.9974) with MSVC19.44.35228.Checks Run
origin/mainunder/W4 /WX):runtime/test/file_system_test.cppwith/std:c++20 /O2 /MD /EHsc /W4 /WX /permissive- /utf-8failed (rc=2) onwarning C4456: declaration of 'h' hides previous local declarationat line1291.#1146 + origin/mainunder/W4 /WX+ runtime execution):file_system_test.exe(test/file_system_test.cpp,shims/file_system.cpp,shims/registry.cpp) compiled cleanly with0warnings under/W4 /WX(rc=0) and passed the full Windows NTFSGAME:/ write-overlay test suite (rc=0).AI-assisted.
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