[opencv] 79/89: build: disable warnings (Ubuntu 16.04 + CUDA 8.0)

Nobuhiro Iwamatsu iwamatsu at moszumanska.debian.org
Sat May 13 09:57:27 UTC 2017


This is an automated email from the git hooks/post-receive script.

iwamatsu pushed a commit to annotated tag 2.4.13.2
in repository opencv.

commit 03beff06ff5824b35707b7f878766cd9317a596c
Author: Alexander Alekhin <alexander.alekhin at intel.com>
Date:   Wed Dec 7 12:44:31 2016 +0300

    build: disable warnings (Ubuntu 16.04 + CUDA 8.0)
    
    Examples:
    - NPP_staging.cu:1606:105: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    - NCVHaarObjectDetection.hpp:95:37: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
---
 modules/gpu/CMakeLists.txt                        | 2 +-
 modules/gpu/src/nvidia/NCVHaarObjectDetection.hpp | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/gpu/CMakeLists.txt b/modules/gpu/CMakeLists.txt
index caec0ef..ce3c8fb 100644
--- a/modules/gpu/CMakeLists.txt
+++ b/modules/gpu/CMakeLists.txt
@@ -29,7 +29,7 @@ if(HAVE_CUDA)
 
   source_group("Src\\NVidia" FILES ${ncv_files})
   ocv_include_directories("src/nvidia" "src/nvidia/core" "src/nvidia/NPP_staging" ${CUDA_INCLUDE_DIRS})
-  ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations -Wshadow -Wunused-parameter /wd4211 /wd4201 /wd4100 /wd4505 /wd4408)
+  ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations -Wshadow -Wunused-parameter -Wstrict-aliasing /wd4211 /wd4201 /wd4100 /wd4505 /wd4408)
 
   if(MSVC)
     if(NOT ENABLE_NOISY_WARNINGS)
diff --git a/modules/gpu/src/nvidia/NCVHaarObjectDetection.hpp b/modules/gpu/src/nvidia/NCVHaarObjectDetection.hpp
index 8436630..b63ba64 100644
--- a/modules/gpu/src/nvidia/NCVHaarObjectDetection.hpp
+++ b/modules/gpu/src/nvidia/NCVHaarObjectDetection.hpp
@@ -59,6 +59,11 @@
 #ifndef _ncvhaarobjectdetection_hpp_
 #define _ncvhaarobjectdetection_hpp_
 
+#ifdef __GNUC__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wstrict-aliasing"
+#endif
+
 #include <string>
 #include "NCV.hpp"
 
@@ -458,5 +463,8 @@ NCV_EXPORTS NCVStatus ncvHaarStoreNVBIN_host(const std::string &filename,
                                              NCVVector<HaarFeature64> &h_HaarFeatures);
 
 
+#ifdef __GNUC__
+# pragma GCC diagnostic pop
+#endif
 
 #endif // _ncvhaarobjectdetection_hpp_

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git



More information about the debian-science-commits mailing list