Skip to content

Commit 667cb2e

Browse files
authored
Merge pull request opencv#7867 from alalek:cuda_warnings_2.4
(2.4) Fix CUDA warnings
2 parents 7db13c7 + 03beff0 commit 667cb2e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

modules/gpu/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if(HAVE_CUDA)
2929

3030
source_group("Src\\NVidia" FILES ${ncv_files})
3131
ocv_include_directories("src/nvidia" "src/nvidia/core" "src/nvidia/NPP_staging" ${CUDA_INCLUDE_DIRS})
32-
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations -Wshadow -Wunused-parameter /wd4211 /wd4201 /wd4100 /wd4505 /wd4408)
32+
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations -Wshadow -Wunused-parameter -Wstrict-aliasing /wd4211 /wd4201 /wd4100 /wd4505 /wd4408)
3333

3434
if(MSVC)
3535
if(NOT ENABLE_NOISY_WARNINGS)

modules/gpu/src/nvidia/NCVHaarObjectDetection.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@
5959
#ifndef _ncvhaarobjectdetection_hpp_
6060
#define _ncvhaarobjectdetection_hpp_
6161

62+
#ifdef __GNUC__
63+
# pragma GCC diagnostic push
64+
# pragma GCC diagnostic ignored "-Wstrict-aliasing"
65+
#endif
66+
6267
#include <string>
6368
#include "NCV.hpp"
6469

@@ -458,5 +463,8 @@ NCV_EXPORTS NCVStatus ncvHaarStoreNVBIN_host(const std::string &filename,
458463
NCVVector<HaarFeature64> &h_HaarFeatures);
459464

460465

466+
#ifdef __GNUC__
467+
# pragma GCC diagnostic pop
468+
#endif
461469

462470
#endif // _ncvhaarobjectdetection_hpp_

0 commit comments

Comments
 (0)