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.
This commit is contained in:
Ahson Khan 2023-01-25 17:34:39 -08:00 committed by GitHub
parent 876a7baaa5
commit 74a1ad7714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,10 +13,21 @@
#include <azure/core/tracing/opentelemetry/opentelemetry.hpp>
#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 <opentelemetry/sdk/common/global_log_handler.h>
#include <opentelemetry/sdk/trace/processor.h>
#include <opentelemetry/sdk/trace/simple_processor.h>
#include <opentelemetry/sdk/trace/tracer_provider.h>
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
using namespace Azure::Core::Http::Policies;
using namespace Azure::Core::Http::Policies::_internal;