Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

Enable deprecation warnings (#34203)

Oleg Pipikin3b7c385cc882
diff --git a/cmake/developer_package/compile_flags/functions.cmake b/cmake/developer_package/compile_flags/functions.cmake
index 122bc71dc66..67a372a69c6 100644
--- a/cmake/developer_package/compile_flags/functions.cmake
+++ b/cmake/developer_package/compile_flags/functions.cmake
@@ -6,33 +6,6 @@ include(ProcessorCount)
include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
-#
-# ov_disable_deprecated_warnings()
-#
-# Disables deprecated warnings generation in current scope (directory, function)
-# Defines ov_c_cxx_deprecated variable which contains C / C++ compiler flags
-#
-macro(ov_disable_deprecated_warnings)
- if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
- set(ov_c_cxx_deprecated "/wd4996")
- elseif(OV_COMPILER_IS_INTEL_LLVM)
- if(WIN32)
- set(ov_c_cxx_deprecated "/Wno-deprecated-declarations")
- else()
- set(ov_c_cxx_deprecated "-Wno-deprecated-declarations")
- endif()
- elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)
- set(ov_c_cxx_deprecated "-Wno-deprecated-declarations")
- else()
- message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
- endif()
-
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${ov_c_cxx_deprecated}")
- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${ov_c_cxx_deprecated}")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ov_c_cxx_deprecated}")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ov_c_cxx_deprecated}")
-endmacro()
-
#
# ov_deprecated_no_errors()
#
diff --git a/cmake/developer_package/compile_flags/os_flags.cmake b/cmake/developer_package/compile_flags/os_flags.cmake
index 6d189136172..3ce87023ad8 100644
--- a/cmake/developer_package/compile_flags/os_flags.cmake
+++ b/cmake/developer_package/compile_flags/os_flags.cmake
@@ -143,13 +143,7 @@ elseif(OV_COMPILER_IS_INTEL_LLVM AND WIN32)
#
# Warnings as errors
#
-
ov_add_compiler_flags(/WX)
-
- #
- # Disable noisy warnings
- #
- ov_disable_deprecated_warnings()
else()
#
# Common enabled warnings
@@ -189,7 +183,6 @@ else()
if(OV_COMPILER_IS_INTEL_LLVM)
ov_add_compiler_flags(-Wno-tautological-constant-compare)
- ov_disable_deprecated_warnings()
endif()
#
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7ea31c06133..9f0afa0c022 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -8,10 +8,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
ov_add_compiler_flags(-Wmissing-declarations)
endif()
-if(OV_COMPILER_IS_INTEL_LLVM)
- ov_disable_deprecated_warnings()
-endif()
-
# Disable adhoc codesign on Apple AARCH64 by default for internal builds.
# For community distribution channels (e.g. conda, brew), enable it via -DOV_FORCE_ADHOC_SIGN=ON.
if(APPLE AND AARCH64 AND NOT OV_FORCE_ADHOC_SIGN)
diff --git a/src/bindings/c/src/CMakeLists.txt b/src/bindings/c/src/CMakeLists.txt
index abebf13fc5d..212b9045297 100644
--- a/src/bindings/c/src/CMakeLists.txt
+++ b/src/bindings/c/src/CMakeLists.txt
@@ -4,9 +4,6 @@
set(TARGET_NAME openvino_c)
-# Suppress warnings due to catch macro with legacy exception types
-ov_disable_deprecated_warnings()
-
add_definitions(-DIN_OV_COMPONENT)
file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index cba1e6773c2..206efa9058d 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -2,8 +2,6 @@
# SPDX-License-Identifier: Apache-2.0
#
-ov_deprecated_no_errors()
-
set(skip_module "${CMAKE_CURRENT_SOURCE_DIR}/template")
file(GLOB local_modules "${CMAKE_CURRENT_SOURCE_DIR}/*")
foreach(module_path IN LISTS local_modules)
diff --git a/src/plugins/intel_gpu/CMakeLists.txt b/src/plugins/intel_gpu/CMakeLists.txt
index d7285bfa2d8..427460fb594 100644
--- a/src/plugins/intel_gpu/CMakeLists.txt
+++ b/src/plugins/intel_gpu/CMakeLists.txt
@@ -32,6 +32,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# '<': signed/unsigned mismatch
ov_add_compiler_flags(/wd4018)
+ add_compile_definitions(_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING)
# see https://github.com/oneapi-src/oneDNN/issues/2028
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
endif()
diff --git a/src/plugins/intel_gpu/src/runtime/ocl/ocl_device.cpp b/src/plugins/intel_gpu/src/runtime/ocl/ocl_device.cpp
index 13201d64edb..5c652bd7ce4 100644
--- a/src/plugins/intel_gpu/src/runtime/ocl/ocl_device.cpp
+++ b/src/plugins/intel_gpu/src/runtime/ocl/ocl_device.cpp
@@ -2,6 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
//
+#include "ocl_device.hpp"
+
#ifdef ENABLE_ONEDNN_FOR_GPU
#ifndef NOMINMAX
# define NOMINMAX
@@ -9,7 +11,6 @@
#include "gpu/intel/jit/generator.hpp"
#endif // ENABLE_ONEDNN_FOR_GPU
-#include "ocl_device.hpp"
#include "ocl_common.hpp"
#include "intel_gpu/runtime/debug_configuration.hpp"