Merge pull request #10375 from tomoaki0705:buildWarningMSVC

pull/10399/merge
Alexander Alekhin 7 years ago
commit 83b8cd0152
  1. 4
      cmake/OpenCVCompilerOptions.cmake
  2. 2
      modules/cudalegacy/test/NCVTest.hpp
  3. 4
      modules/features2d/src/agast.cpp
  4. 4
      modules/features2d/src/agast_score.cpp
  5. 3
      modules/features2d/src/fast.cpp
  6. 7
      modules/imgcodecs/src/grfmt_jpeg.cpp
  7. 4
      modules/imgproc/src/canny.cpp
  8. 1
      modules/ts/include/opencv2/ts.hpp
  9. 9
      modules/ts/include/opencv2/ts/ts_gtest.h
  10. 4
      modules/videoio/src/cap_ffmpeg_impl.hpp
  11. 9
      modules/videoio/src/cap_msmf.hpp

@ -309,9 +309,6 @@ if(MSVC)
if(MSVC_VERSION EQUAL 1400) if(MSVC_VERSION EQUAL 1400)
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4510 /wd4610 /wd4312 /wd4201 /wd4244 /wd4328 /wd4267) ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4510 /wd4610 /wd4312 /wd4201 /wd4244 /wd4328 /wd4267)
endif() endif()
if(MSVC_VERSION LESS 1900) # MSVS2015
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127) # warning C4127: conditional expression is constant
endif()
endif() endif()
# allow extern "C" functions throw exceptions # allow extern "C" functions throw exceptions
@ -323,6 +320,7 @@ if(MSVC)
endforeach() endforeach()
if(NOT ENABLE_NOISY_WARNINGS) 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 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4251) # class 'std::XXX' needs to have dll-interface to be used by clients of YYY
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4324) # 'struct_name' : structure was padded due to __declspec(align()) ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4324) # 'struct_name' : structure was padded due to __declspec(align())
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4275) # non dll-interface class 'std::exception' used as base for dll-interface class 'cv::Exception' ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4275) # non dll-interface class 'std::exception' used as base for dll-interface class 'cv::Exception'

@ -44,7 +44,7 @@
#define _ncvtest_hpp_ #define _ncvtest_hpp_
#if defined _MSC_VER #if defined _MSC_VER
# pragma warning( disable : 4201 4408 4127 4100) # pragma warning( disable : 4201 4408 4100)
#endif #endif
#include <string> #include <string>

@ -45,10 +45,6 @@ The references are:
#include "precomp.hpp" #include "precomp.hpp"
#include "agast_score.hpp" #include "agast_score.hpp"
#ifdef _MSC_VER
#pragma warning( disable : 4127 )
#endif
namespace cv namespace cv
{ {

@ -44,10 +44,6 @@ The references are:
#include "agast_score.hpp" #include "agast_score.hpp"
#ifdef _MSC_VER
#pragma warning( disable : 4127 )
#endif
namespace cv namespace cv
{ {

@ -48,9 +48,6 @@ The references are:
#include "opencv2/core/hal/intrin.hpp" #include "opencv2/core/hal/intrin.hpp"
#include "opencv2/core/openvx/ovx_defs.hpp" #include "opencv2/core/openvx/ovx_defs.hpp"
#if defined _MSC_VER
# pragma warning( disable : 4127)
#endif
namespace cv namespace cv
{ {

@ -78,18 +78,11 @@ extern "C" {
namespace cv namespace cv
{ {
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable:4324) //structure was padded due to __declspec(align())
#endif
struct JpegErrorMgr struct JpegErrorMgr
{ {
struct jpeg_error_mgr pub; struct jpeg_error_mgr pub;
jmp_buf setjmp_buffer; jmp_buf setjmp_buffer;
}; };
#ifdef _MSC_VER
# pragma warning(pop)
#endif
struct JpegSource struct JpegSource
{ {

@ -47,10 +47,6 @@
#include "opencv2/core/openvx/ovx_defs.hpp" #include "opencv2/core/openvx/ovx_defs.hpp"
#ifdef _MSC_VER
#pragma warning( disable: 4127 ) // conditional expression is constant
#endif
#if CV_SIMD128 #if CV_SIMD128
#define CV_MALLOC_SIMD128 16 #define CV_MALLOC_SIMD128 16
#endif #endif

@ -34,7 +34,6 @@
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning( disable: 4127 ) // conditional expression is constant
#pragma warning( disable: 4503 ) // decorated name length exceeded, name was truncated #pragma warning( disable: 4503 ) // decorated name length exceeded, name was truncated
#endif #endif

@ -7976,20 +7976,11 @@ GTEST_API_ std::string AppendUserMessage(
// std::runtime_error inherits from std::exception, many testing // std::runtime_error inherits from std::exception, many testing
// frameworks know how to extract and print the message inside it. // frameworks know how to extract and print the message inside it.
#ifdef _MSC_VER
# pragma warning(push) // Saves the current warning state.
# pragma warning(disable:4275) // Temporarily disables warning 4275.
#endif // _MSC_VER
class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error { class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
public: public:
explicit GoogleTestFailureException(const TestPartResult& failure); explicit GoogleTestFailureException(const TestPartResult& failure);
}; };
#ifdef _MSC_VER
# pragma warning(pop) // Restores the warning state.
#endif // _MSC_VER
#endif // GTEST_HAS_EXCEPTIONS #endif // GTEST_HAS_EXCEPTIONS
// A helper class for creating scoped traces in user programs. // A helper class for creating scoped traces in user programs.

@ -51,7 +51,7 @@
#define CALC_FFMPEG_VERSION(a,b,c) ( a<<16 | b<<8 | c ) #define CALC_FFMPEG_VERSION(a,b,c) ( a<<16 | b<<8 | c )
#if defined _MSC_VER && _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( disable: 4244 4510 4512 4610 ) #pragma warning( disable: 4244 4510 4610 )
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__
@ -83,7 +83,7 @@ extern "C" {
#endif #endif
#if defined _MSC_VER && _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( default: 4244 4510 4512 4610 ) #pragma warning( default: 4244 4510 4610 )
#endif #endif
#ifdef NDEBUG #ifdef NDEBUG

@ -2084,11 +2084,6 @@ public:
// succeed but return a nullptr pointer. By default, the list does not allow nullptr // succeed but return a nullptr pointer. By default, the list does not allow nullptr
// pointers. // pointers.
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4127) // constant expression
#endif
template <class T, bool NULLABLE = FALSE> template <class T, bool NULLABLE = FALSE>
class ComPtrList : public List<T*> class ComPtrList : public List<T*>
{ {
@ -2179,10 +2174,6 @@ protected:
} }
}; };
#ifdef _MSC_VER
#pragma warning(pop)
#endif
/* Be sure to declare webcam device capability in manifest /* Be sure to declare webcam device capability in manifest
For better media capture support, add the following snippet with correct module name to the project manifest For better media capture support, add the following snippet with correct module name to the project manifest
(videoio needs DLL activation class factoryentry points): (videoio needs DLL activation class factoryentry points):

Loading…
Cancel
Save