Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clang warning in renderpass D3DX12 header #124

Merged
merged 4 commits into from
May 17, 2024

Conversation

walbourn
Copy link
Member

@walbourn walbourn commented May 9, 2024

Fixes these warnings that happens with this D3DX12 header with clang/LLVM:

Microsoft.Direct3D.D3D12.1.613.3\build\native\include\d3dx12/d3dx12_render_pass.h(51,13): warning : enumeration values 'D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_DISCARD', 'D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE', and 'D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_NO_ACCESS' not handled in switch [-Wswitch] 

Microsoft.Direct3D.D3D12.1.613.3\build\native\include\d3dx12/d3dx12_render_pass.h(70,13): warning : enumeration values 'D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD', 'D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE', and 'D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS' not handled in switch [-Wswitch]

@walbourn walbourn requested a review from jenatali May 9, 2024 22:41
@walbourn walbourn self-assigned this May 9, 2024
@walbourn walbourn added the d3dx12 Impacts d3dx12.h label May 9, 2024
@walbourn walbourn requested a review from billkris-ms May 9, 2024 22:41
@walbourn walbourn requested a review from jenatali May 13, 2024 19:56
Copy link
Member

@jenatali jenatali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please just add the default:. It's 2 lines and suppresses all of these warnings without compiler-specific #ifdef or #pragma shenanigans.

There's also MSVC 4061, which would show up here (if it was enabled) because it just unconditionally complains about enum switches with missing cases, even if there's a default.

Copy link
Member

@jenatali jenatali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clicked the wrong button with my previous comment...

@jenatali jenatali merged commit f5a4aca into main May 17, 2024
1 check passed
@jenatali jenatali deleted the chuckw/renderpasswarnfix branch May 17, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d3dx12 Impacts d3dx12.h
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants