Cast this to (void*) in zero-clearing memset calls to fix -Wnontrivial-memcall (#9247, #8295, #8129, #8135)

Clang 20+ warns on memset(this, ...) for non-trivially copyable types via -Wnontrivial-memcall.
Should separately investigate -Wnonontrivial-memaccess vs -Wnonontrivial-memcall.
This commit is contained in:
Laurenz Altenmüller
2026-02-16 14:36:36 +01:00
committed by ocornut
parent eaa32bb787
commit fbe973a8d0
6 changed files with 55 additions and 55 deletions

View File

@@ -44,7 +44,7 @@ struct ImGui_ImplDX12_InitInfo
D3D12_GPU_DESCRIPTOR_HANDLE LegacySingleSrvGpuDescriptor;
#endif
ImGui_ImplDX12_InitInfo() { memset(this, 0, sizeof(*this)); }
ImGui_ImplDX12_InitInfo() { memset((void*)this, 0, sizeof(*this)); }
};
// Follow "Getting Started" link and check examples/ folder to learn about using backends!