From 76eb09c9a1a75e89ef8f922f92d0794fffa48ccb Mon Sep 17 00:00:00 2001 From: Ryan Shepherd Date: Thu, 20 Feb 2025 10:49:19 -0800 Subject: [PATCH] Clean up more warnings and Component Governance (#1475) * Fix a couple more build warnings * Upgrade System.Text.Json to 6.0.10 * Better fix for unused size_result * Disable warning 4324 for all of wrl.h --- cppwinrt/component_writers.h | 1 + natvis/object_visualizer.cpp | 2 +- test/old_tests/Component/pch.h | 3 +++ vsix/Dev16/vsix.Dev16.csproj | 1 + vsix/Dev17/vsix.Dev17.csproj | 3 +++ 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cppwinrt/component_writers.h b/cppwinrt/component_writers.h index c52f49a13..6865d49ef 100644 --- a/cppwinrt/component_writers.h +++ b/cppwinrt/component_writers.h @@ -198,6 +198,7 @@ int32_t __stdcall WINRT_GetActivationFactory(void* classId, void** factory) noex } #ifdef _WRL_MODULE_H_ +#pragma warning(suppress: 4324) // structure was padded due to alignment specifier return ::Microsoft::WRL::Module<::Microsoft::WRL::InProc>::GetModule().GetActivationFactory(static_cast(classId), reinterpret_cast<::IActivationFactory**>(factory)); #else return winrt::hresult_class_not_available(name).to_abi(); diff --git a/natvis/object_visualizer.cpp b/natvis/object_visualizer.cpp index 2e0eb3971..d953a1c03 100644 --- a/natvis/object_visualizer.cpp +++ b/natvis/object_visualizer.cpp @@ -612,7 +612,7 @@ std::wstring string_to_wstring(std::string_view const& str) } std::wstring result(size, L'?'); - auto size_result = MultiByteToWideChar(CP_UTF8, 0, str.data(), static_cast(str.size()), result.data(), size); + [[maybe_unused]] auto size_result = MultiByteToWideChar(CP_UTF8, 0, str.data(), static_cast(str.size()), result.data(), size); XLANG_ASSERT(size == size_result); return result; } diff --git a/test/old_tests/Component/pch.h b/test/old_tests/Component/pch.h index 5d84eecb6..b73230946 100644 --- a/test/old_tests/Component/pch.h +++ b/test/old_tests/Component/pch.h @@ -8,4 +8,7 @@ #include "winrt/Composable.h" // This is used to validate WRL interop support. +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to alignment specifier #include +#pragma warning(pop) \ No newline at end of file diff --git a/vsix/Dev16/vsix.Dev16.csproj b/vsix/Dev16/vsix.Dev16.csproj index 1e89b390b..dfb870ee1 100644 --- a/vsix/Dev16/vsix.Dev16.csproj +++ b/vsix/Dev16/vsix.Dev16.csproj @@ -93,6 +93,7 @@ all + diff --git a/vsix/Dev17/vsix.Dev17.csproj b/vsix/Dev17/vsix.Dev17.csproj index 3ef30ce63..be0cf3d17 100644 --- a/vsix/Dev17/vsix.Dev17.csproj +++ b/vsix/Dev17/vsix.Dev17.csproj @@ -168,6 +168,9 @@ + + +