Skip to content

Fix clang warnings#3817

Merged
baldurk merged 6 commits intobaldurk:v1.xfrom
widberg:fix-clang-warnings
Mar 24, 2026
Merged

Fix clang warnings#3817
baldurk merged 6 commits intobaldurk:v1.xfrom
widberg:fix-clang-warnings

Conversation

@widberg
Copy link
Copy Markdown
Contributor

@widberg widberg commented Mar 24, 2026

Description

While setting up clangd on Windows, I found a few errors/warnings to fix that might benefit the MSVC build. I tried to describe why they might be valuable outside of Clang in the commit messages, understanding that you have no intention of supporting Clang as a compiler on Windows. I'd be happy to drop any commits that aren't valuable fixes for an MSVC build or aren't actually errors.

I'm not 100% sure if the lack of underlying types "fixed" by Add enum underlying type was intentional or not. It's a little odd with the typedefs right under it seeing the pre-uint8_t enums and then the definitions with the underlying types in the other files. If it was intentional then a better fix might be namespacing like enum MinimumPrecision has or letting MSVC do its thing and drop the commit. This change could also break old serialized files if either of these types are stored somewhere.

Clang had thousands more warnings, but I'm definitely not the right person to evaluate which of those are worth addressing, so I won't waste your time with any more PRs. I only mention it on the off chance there's somebody else out there who might find joy sifting through that. Thank you for developing RenderDoc and sorry if this type of PR is unwelcome.

widberg added 6 commits March 23, 2026 22:34
Placing `alignas` before the type is more in-line with the C++ standard,
Microsoft Learn examples, and other places in this codebase. While the
old way worked with MSVC, this is more consistent and improves
compatibility with other tools without affecting the MSVC build.
The forward declaration of InterpolationMode already included its
underlying type. This commit does the same for ResourceRetType and
ResourceDimension.
T::IsForwardReferenceable is a static boolean member, not a type.
Without the comma, this
"igvk32.dll",
"igvk64.dll"
"igxelpgicd32.dll",
"igxelpgicd64.dll",
becomes
"igvk32.dll",
"igvk64.dlligxelpgicd32.dll",
"igxelpgicd64.dll",
`CreateThread` expects `lpStartAddress` to be a function with the
signature
DWORD WINAPI ThreadProc(
  _In_ LPVOID lpParameter
);
on Win32 `WINAPI` is `__stdcall`, but `CheckHookThread` previously
had the effective signature
DWORD __cdecl CheckHookThread(LPVOID param);
because the calling convention was unspecified. The cast that was hiding
this error is also removed.
@baldurk
Copy link
Copy Markdown
Owner

baldurk commented Mar 24, 2026

This looks good to me. You are correct that I don't plan to support building with clang on windows but I'm fine accepting compiler warning fixes in general as long as they are correct & safe, which all of these are.

The enum declaration thing was not intentional I don't believe and probably more just an inherited legacy from code before enums could have base types.

@baldurk baldurk merged commit 6aca8fa into baldurk:v1.x Mar 24, 2026
16 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants