From 74a1ad7714b90ca5dd6bafa0a839978db1e6a6b6 Mon Sep 17 00:00:00 2001 From: Ahson Khan Date: Wed, 25 Jan 2023 17:34:39 -0800 Subject: [PATCH] Ignore warning C4100 on Windows for unused parameter in OpenTelemetry headers. (#4252) * Ignore warning C4100 on Windows for unused parameter in OpenTelemetry headers. * Disable other warnings like 4244 and 6323 as well. * Clang format fix. --- .../test/ut/service_support_test.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sdk/core/azure-core-tracing-opentelemetry/test/ut/service_support_test.cpp b/sdk/core/azure-core-tracing-opentelemetry/test/ut/service_support_test.cpp index 466231db0..65fec1a75 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/test/ut/service_support_test.cpp +++ b/sdk/core/azure-core-tracing-opentelemetry/test/ut/service_support_test.cpp @@ -13,10 +13,21 @@ #include #include "test_exporter.hpp" // Span Exporter used for OpenTelemetry tests. +#if defined(_MSC_VER) +// The OpenTelemetry headers generate a couple of warnings on MSVC in the OTel 1.2 package, suppress +// the warnings across the includes. +#pragma warning(push) +#pragma warning(disable : 4100) +#pragma warning(disable : 4244) +#pragma warning(disable : 6323) // Disable "Use of arithmetic operator on Boolean type" warning. +#endif #include #include #include #include +#if defined(_MSC_VER) +#pragma warning(pop) +#endif using namespace Azure::Core::Http::Policies; using namespace Azure::Core::Http::Policies::_internal;