Skip to content

Commit 83b8cd0

Browse files
committed
Merge pull request opencv#10375 from tomoaki0705:buildWarningMSVC
2 parents 4e542a6 + fe7b3f1 commit 83b8cd0

File tree

11 files changed

+4
-47
lines changed

11 files changed

+4
-47
lines changed

cmake/OpenCVCompilerOptions.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,6 @@ if(MSVC)
309309
if(MSVC_VERSION EQUAL 1400)
310310
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4510 /wd4610 /wd4312 /wd4201 /wd4244 /wd4328 /wd4267)
311311
endif()
312-
if(MSVC_VERSION LESS 1900) # MSVS2015
313-
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127) # warning C4127: conditional expression is constant
314-
endif()
315312
endif()
316313

317314
# allow extern "C" functions throw exceptions
@@ -323,6 +320,7 @@ if(MSVC)
323320
endforeach()
324321

325322
if(NOT ENABLE_NOISY_WARNINGS)
323+
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127) # conditional expression is constant
326324
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4251) # class 'std::XXX' needs to have dll-interface to be used by clients of YYY
327325
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4324) # 'struct_name' : structure was padded due to __declspec(align())
328326
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4275) # non dll-interface class 'std::exception' used as base for dll-interface class 'cv::Exception'

modules/cudalegacy/test/NCVTest.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#define _ncvtest_hpp_
4545

4646
#if defined _MSC_VER
47-
# pragma warning( disable : 4201 4408 4127 4100)
47+
# pragma warning( disable : 4201 4408 4100)
4848
#endif
4949

5050
#include <string>

modules/features2d/src/agast.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ The references are:
4545
#include "precomp.hpp"
4646
#include "agast_score.hpp"
4747

48-
#ifdef _MSC_VER
49-
#pragma warning( disable : 4127 )
50-
#endif
51-
5248
namespace cv
5349
{
5450

modules/features2d/src/agast_score.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ The references are:
4444

4545
#include "agast_score.hpp"
4646

47-
#ifdef _MSC_VER
48-
#pragma warning( disable : 4127 )
49-
#endif
50-
5147
namespace cv
5248
{
5349

modules/features2d/src/fast.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ The references are:
4848
#include "opencv2/core/hal/intrin.hpp"
4949

5050
#include "opencv2/core/openvx/ovx_defs.hpp"
51-
#if defined _MSC_VER
52-
# pragma warning( disable : 4127)
53-
#endif
5451

5552
namespace cv
5653
{

modules/imgcodecs/src/grfmt_jpeg.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,11 @@ extern "C" {
7878
namespace cv
7979
{
8080

81-
#ifdef _MSC_VER
82-
# pragma warning(push)
83-
# pragma warning(disable:4324) //structure was padded due to __declspec(align())
84-
#endif
8581
struct JpegErrorMgr
8682
{
8783
struct jpeg_error_mgr pub;
8884
jmp_buf setjmp_buffer;
8985
};
90-
#ifdef _MSC_VER
91-
# pragma warning(pop)
92-
#endif
9386

9487
struct JpegSource
9588
{

modules/imgproc/src/canny.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@
4747

4848
#include "opencv2/core/openvx/ovx_defs.hpp"
4949

50-
#ifdef _MSC_VER
51-
#pragma warning( disable: 4127 ) // conditional expression is constant
52-
#endif
53-
5450
#if CV_SIMD128
5551
#define CV_MALLOC_SIMD128 16
5652
#endif

modules/ts/include/opencv2/ts.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#endif
3535

3636
#ifdef _MSC_VER
37-
#pragma warning( disable: 4127 ) // conditional expression is constant
3837
#pragma warning( disable: 4503 ) // decorated name length exceeded, name was truncated
3938
#endif
4039

modules/ts/include/opencv2/ts/ts_gtest.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7976,20 +7976,11 @@ GTEST_API_ std::string AppendUserMessage(
79767976
// std::runtime_error inherits from std::exception, many testing
79777977
// frameworks know how to extract and print the message inside it.
79787978

7979-
#ifdef _MSC_VER
7980-
# pragma warning(push) // Saves the current warning state.
7981-
# pragma warning(disable:4275) // Temporarily disables warning 4275.
7982-
#endif // _MSC_VER
7983-
79847979
class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
79857980
public:
79867981
explicit GoogleTestFailureException(const TestPartResult& failure);
79877982
};
79887983

7989-
#ifdef _MSC_VER
7990-
# pragma warning(pop) // Restores the warning state.
7991-
#endif // _MSC_VER
7992-
79937984
#endif // GTEST_HAS_EXCEPTIONS
79947985

79957986
// A helper class for creating scoped traces in user programs.

modules/videoio/src/cap_ffmpeg_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#define CALC_FFMPEG_VERSION(a,b,c) ( a<<16 | b<<8 | c )
5252

5353
#if defined _MSC_VER && _MSC_VER >= 1200
54-
#pragma warning( disable: 4244 4510 4512 4610 )
54+
#pragma warning( disable: 4244 4510 4610 )
5555
#endif
5656

5757
#ifdef __GNUC__
@@ -83,7 +83,7 @@ extern "C" {
8383
#endif
8484

8585
#if defined _MSC_VER && _MSC_VER >= 1200
86-
#pragma warning( default: 4244 4510 4512 4610 )
86+
#pragma warning( default: 4244 4510 4610 )
8787
#endif
8888

8989
#ifdef NDEBUG

0 commit comments

Comments
 (0)