1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-21 19:33:03 +04:00

fix opencv/opencv#20544 nodiscard for msvc/gcc

- includes workaround for preprocessor non-compliance
- enable attribute syntax checking in msvc
This commit is contained in:
Dale Phurrough
2021-08-28 01:12:44 +02:00
parent df83459721
commit 3995deaf76
4 changed files with 77 additions and 41 deletions
+3
View File
@@ -400,6 +400,9 @@ if(MSVC)
endif()
endif()
# Enable [[attribute]] syntax checking to prevent silent failure: "attribute is ignored in this syntactic position"
add_extra_compiler_option("/w15240")
if(NOT ENABLE_NOISY_WARNINGS)
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127) # conditional expression is constant
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4251) # class 'std::XXX' needs to have dll-interface to be used by clients of YYY