Skip to content

Add a clang-tidy CI job for Windows-only code and fix issues - #3225

Open
bradgrantham-lunarg wants to merge 1 commit into
LunarG:devfrom
bradgrantham-lunarg:add-clang-tidy-windows
Open

bradgrantham-lunarg wants to merge 1 commit into
LunarG:devfrom
bradgrantham-lunarg:add-clang-tidy-windows

Conversation

@bradgrantham-lunarg

Copy link
Copy Markdown
Contributor

The existing clang-tidy job runs on Linux, so code guarded by Windows macros (WIN32, VK_USE_PLATFORM_WIN32_KHR, D3D12_SUPPORT, GFXRECON_AGS_SUPPORT, ...) is never analyzed. Add a clang-tidy-windows job that configures with Ninja + clang-cl (D3D12 enabled) and runs run-clang-tidy over just the guarded sources, using a new .github/scripts/guarded_sources.py helper to enumerate the .cpp files and build the -header-filter regex from the guarded headers.

These issues compile with MSVC but are rejected by clang-cl, and were found by the new clang-tidy-windows CI job:

  • generated_dx12_add_entries.h declared AddEntry parameters as 'typename void**'; 'typename' is not valid there ('expected a qualified name after typename'). Remove it from the generator and mirror the change in the checked-in generated header.

  • Dx12ReplayConsumerBase::ApplyBatchedResourceInitInfo passed a std::string through GFXRECON_LOG_WARNING's varargs, which is undefined behavior; format it with .c_str() like other call sites.

  • Dx12StateTracker::AddEntry declared its handle parameters as 'typename void**'; remove the invalid 'typename', matching the fix in generated_dx12_add_entries.h.

  • TrackPresentedImages used 'sizeof RECT' without parentheses, which is an MSVC extension; standard C++ requires 'sizeof(RECT)' for a type operand.

@bradgrantham-lunarg bradgrantham-lunarg added the approved-to-run-ci Can run CI check on internal LunarG machines label Aug 26, 2026
@bradgrantham-lunarg
bradgrantham-lunarg marked this pull request as draft August 26, 2026 19:18
The existing clang-tidy job runs on Linux, so code guarded by Windows
macros (WIN32, VK_USE_PLATFORM_WIN32_KHR, D3D12_SUPPORT,
GFXRECON_AGS_SUPPORT, ...) is never analyzed. Add a clang-tidy-windows
job that configures with Ninja + clang-cl (D3D12 enabled) and runs
run-clang-tidy over just the guarded sources, using a new
.github/scripts/guarded_sources.py helper to enumerate the .cpp files
and build the -header-filter regex from the guarded headers.

These issues compile with MSVC but are rejected by clang-cl, and were
found by the new clang-tidy-windows CI job:

- generated_dx12_add_entries.h declared AddEntry parameters as
  'typename void**'; 'typename' is not valid there ('expected a
  qualified name after typename'). Remove it from the generator and
  mirror the change in the checked-in generated header.

- Dx12ReplayConsumerBase::ApplyBatchedResourceInitInfo passed a
  std::string through GFXRECON_LOG_WARNING's varargs, which is
  undefined behavior; format it with .c_str() like other call sites.

- Dx12StateTracker::AddEntry declared its handle parameters as
  'typename void**'; remove the invalid 'typename', matching the fix in
  generated_dx12_add_entries.h.

- TrackPresentedImages used 'sizeof RECT' without parentheses, which is
  an MSVC extension; standard C++ requires 'sizeof(RECT)' for a type
  operand.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014kFLeTDqXuNRbDjMw42C4q
@bradgrantham-lunarg
bradgrantham-lunarg marked this pull request as ready for review September 15, 2026 20:44
@bradgrantham-lunarg
bradgrantham-lunarg requested review from davidd-lunarg and mikes-lunarg and removed request for davidd-lunarg September 18, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-to-run-ci Can run CI check on internal LunarG machines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant