Skip to content

file_system_test: build without the C4456 shadow warning (RT-827) - #8562

Open
Christopher-Sundeby wants to merge 1 commit into
ItsNotRexed:mainfrom
Christopher-Sundeby:fix/runtime-test-msvc-warnings
Open

Christopher-Sundeby wants to merge 1 commit into
ItsNotRexed:mainfrom
Christopher-Sundeby:fix/runtime-test-msvc-warnings

Conversation

@Christopher-Sundeby

@Christopher-Sundeby Christopher-Sundeby commented Nov 23, 2026 •

Copy link
Copy Markdown

Claim (RT-827): #8344 (comment)

runtime/test/file_system_test.cpp:1177 (RT-294's reserved-folder probe) declares const HANDLE h inside the scope of the outer HANDLE h (line 1086), which MSVC reports at /W4 as C4456. The inner handle is now refused; the checks are unchanged.

Together with #4743 (xgameruntime_test) and #4931 (xgameruntime_gamesave_test), a clean RelWithDebInfo build of runtime/ at 85ec876b has no MSVC warnings.

Tested

Windows 11, MSVC 14.44 (VS 2022 Build Tools), Ninja, RelWithDebInfo, NVIDIA GeForce RTX 3060 Ti (driver 621.24):

  • clean build of runtime/: the C4456 at line 1177 is gone
  • ctest -R "^file_system$": pass

No game files. AI-assisted (Claude Code).

🤖 Generated with 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 <noreply@anthropic.com>
@Christopher-Sundeby Christopher-Sundeby changed the title file_system_test: build without the C4456 shadow warning file_system_test: build without the C4456 shadow warning (RT-827) Nov 23, 2026
@MartinIndra02

Copy link
Copy Markdown

Independent build + test: PASS

AI-assisted (Claude Code). Windows 11 x64, MSVC 19.44.35220, Ninja RelWithDebInfo (/W4). GPU (not used): NVIDIA GeForce RTX 3080 driver 621.24 / 32.0.16.2124.

Head 7dc471ff7, merged locally with current main 867d922f0 (clean merge).

Build file_system_test.cpp warnings file_system_test.exe
runtime/test/file_system_test.cpp from main file_system_test.cpp(1177): warning C4456: declaration of 'h' hides previous local declaration not run
this PR none exit 0, 446 check(s), 0 failure(s)

A rename only; behaviour is unchanged. No issues found.

Note: #7890 and #7947 add checks to the same region of this file (around line 1170-1200), so a rebase may conflict.

@comtek21516

Copy link
Copy Markdown

Tested 7dc471ff7 on main at 867d922f0 (merged together with #8729 and #8754, which touch other files) on Windows Server 2025, MSVC 14.52 (Visual Studio 18), Ninja RelWithDebInfo: pass, on a newer compiler than the PR's 14.44.

  • Warning: a build of main on this machine printed file_system_test.cpp(1173): warning C4456 for the inner h; the build with this PR prints no warning for file_system_test.cpp.
  • file_system_test / ctest file_system: passed.

No game files used. AI-assisted (Claude Code).

@Pierrot1398

Copy link
Copy Markdown

Tested 7dc471f on NVIDIA GeForce RTX 5060 Ti, driver 621.24, Windows 11 Pro build 26300, VS 18 Build Tools (MSVC), Ninja, RelWithDebInfo: pass.

  • file_system_test builds with no C4456 warning, and file_system passed 3/3 with ctest --repeat until-fail:3.

Built the PR head, not merged onto main. Synthetic only, no game files. AI-assisted (Claude Code).

@RAINighty

Copy link
Copy Markdown

Tested 7dc471ff7 merged with main 867d922f0 (clean merge) on Windows 11 (10.0.26300), Intel Core i7-14650HX, MSVC 19.44.35228, RelWithDebInfo (Ninja), CPU-only tests: pass.

  • file_system passes with this PR.
  • Test-only change. Rebuilding file_system_test.cpp on main prints one C4456 warning; with this PR the rebuild prints none (the C4456 count over the whole rebuild went from 1 to 0).
  • Code not reviewed beyond running it. No GPU or game files.

AI-assisted (Claude Code).

@egexon

egexon commented Nov 23, 2026

Copy link
Copy Markdown

Tested 7dc471f (merged onto main 867d922) on RTX 5070, NVIDIA 621.24, Windows 11 (build 26200), Vulkan validation layer on (LEONIDA_VK_VALIDATION=1, VK_VALIDATION_VALIDATE_SYNC=1): pass.

  • file_system: passes with this PR, and passes on main.

Ran the tests that belong to the test files this PR changes (ctest entries, or the test program directly when it is not registered), with no game files (LEONIDA_GAME_DIR unset). AI-assisted (Claude Code).

@kristofbarany

Copy link
Copy Markdown

Tested 7dc471f merged onto main 867d922 (clean merge) on NVIDIA GeForce RTX 4070, driver 621.24, native Windows 11 Pro 26300, MSVC 14.44.35207, Ninja RelWithDebInfo: pass.

  • file_system_test builds with no warning from file_system_test.cpp (main's build of it shows C4456: declaration of 'h' hides previous local declaration at line 1177), and the test passes.

No game data used. AI-assisted (Claude Code).

@Kerwinss

Copy link
Copy Markdown

Tested 7dc471f on Windows 11 Pro 10.0.26300, MSVC 14.51 (VS Build Tools 2026), Windows SDK 10.0.26100, NVIDIA GeForce RTX 4060 / 621.24, Khronos Vulkan headers via -DLEONIDA_VULKAN_HEADERS_FETCH=ON: pass, no regression (Merged onto main 867d922 (clean), full runtime build, ctest -C RelWithDebInfo -j4: 237/239, the two failures are main's own on this GPU (d3d12_depth_resolve, #7985; d3d12_vulkan_device:6574)).

On main, a full MSVC build prints file_system_test.cpp(1177,26): warning C4456: declaration of 'h' hides previous local declaration. With this PR, file_system_test.cpp is recompiled with no C4456, and file_system passes.

AI-assisted (Claude Code). No game files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants