Skip to content

Commit

Permalink
-Wdeprecated-declarations can not be changed by pragma diagnostic
Browse files Browse the repository at this point in the history
Signed-off-by: owent <admin@owent.net>
  • Loading branch information
owent committed May 10, 2022
1 parent 45a087d commit c209115
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ if(WIN32)
option(WITH_ETW "Whether to include the ETW Exporter in the SDK" ON)
endif(WIN32)

# Do not convert deprecated message to error
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
add_compile_options(-Wno-error=deprecated-declarations)
endif()

option(
WITH_API_ONLY
"Only build the API (use as a header-only library). Overrides WITH_EXAMPLES and all options to enable exporters"
Expand Down
18 changes: 0 additions & 18 deletions api/include/opentelemetry/logs/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@
# include "opentelemetry/trace/trace_id.h"
# include "opentelemetry/version.h"

# if defined(__GNUC__) && !defined(__clang__) && !defined(__apple_build_version__)
# if (__GNUC__ * 100 + __GNUC_MINOR__ * 10) >= 460
# pragma GCC diagnostic push
# endif
# pragma GCC diagnostic warning "-Wdeprecated-declarations"
# elif defined(__clang__) || defined(__apple_build_version__)
# pragma clang diagnostic push
# pragma clang diagnostic warning "-Wdeprecated-declarations"
# endif

OPENTELEMETRY_BEGIN_NAMESPACE
namespace logs
{
Expand Down Expand Up @@ -648,12 +638,4 @@ class Logger
} // namespace logs
OPENTELEMETRY_END_NAMESPACE

# if defined(__GNUC__) && !defined(__clang__) && !defined(__apple_build_version__)
# if (__GNUC__ * 100 + __GNUC_MINOR__ * 10) >= 460
# pragma GCC diagnostic pop
# endif
# elif defined(__clang__) || defined(__apple_build_version__)
# pragma clang diagnostic pop
# endif

#endif

0 comments on commit c209115

Please sign in to comment.