diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c881e500c6d4..09ae1b39af971 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -756,6 +756,9 @@ if(NOT MSVC) if (NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register") # Added for htons() endif() + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy") + endif() else() # gcc only set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs -Wno-unused-but-set-variable") diff --git a/opencl/source/program/compile.cpp b/opencl/source/program/compile.cpp index 6e02f5290f9ca..d21626451b5f0 100644 --- a/opencl/source/program/compile.cpp +++ b/opencl/source/program/compile.cpp @@ -81,7 +81,7 @@ cl_int Program::compile( options = (buildOptions != nullptr) ? buildOptions : ""; - for (const auto optionString : {CompilerOptions::gtpinRera, CompilerOptions::greaterThan4gbBuffersRequired}) { + for (const auto &optionString : {CompilerOptions::gtpinRera, CompilerOptions::greaterThan4gbBuffersRequired}) { size_t pos = options.find(optionString); if (pos != std::string::npos) { options.erase(pos, optionString.length());