Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
2b4b9466
Commit
2b4b9466
authored
Apr 20, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11352 from alalek:build_implicit_fallthrough
parents
4e063be4
12e8e331
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
30 additions
and
8 deletions
+30
-8
CMakeLists.txt
3rdparty/ittnotify/CMakeLists.txt
+2
-0
CMakeLists.txt
3rdparty/libjasper/CMakeLists.txt
+1
-0
CMakeLists.txt
3rdparty/libjpeg/CMakeLists.txt
+1
-1
CMakeLists.txt
3rdparty/libpng/CMakeLists.txt
+1
-1
CMakeLists.txt
3rdparty/libtiff/CMakeLists.txt
+1
-0
CMakeLists.txt
3rdparty/libwebp/CMakeLists.txt
+1
-0
CMakeLists.txt
3rdparty/openexr/CMakeLists.txt
+1
-0
CMakeLists.txt
3rdparty/protobuf/CMakeLists.txt
+1
-0
CMakeLists.txt
3rdparty/zlib/CMakeLists.txt
+1
-0
OpenCVCompilerOptions.cmake
cmake/OpenCVCompilerOptions.cmake
+4
-1
OpenCVUtils.cmake
cmake/OpenCVUtils.cmake
+1
-1
persistence.cpp
modules/core/src/persistence.cpp
+2
-3
persistence.hpp
modules/core/src/persistence.hpp
+1
-1
persistence_base64.cpp
modules/core/src/persistence_base64.cpp
+2
-0
softfloat.cpp
modules/core/src/softfloat.cpp
+2
-0
test_color.cpp
modules/imgproc/test/ocl/test_color.cpp
+1
-0
cap.cpp
modules/videoio/src/cap.cpp
+7
-0
No files found.
3rdparty/ittnotify/CMakeLists.txt
View file @
2b4b9466
...
...
@@ -15,6 +15,8 @@ if(NOT WIN32)
endif
()
endif
()
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wimplicit-fallthrough
)
ocv_include_directories
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/include"
)
set
(
ITT_INCLUDE_DIRECTORY
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/include"
)
...
...
3rdparty/libjasper/CMakeLists.txt
View file @
2b4b9466
...
...
@@ -27,6 +27,7 @@ ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-unini
-Wno-unused-but-set-parameter -Wmissing-declarations -Wunused -Wshadow
-Wsign-compare -Wstrict-overflow -Wpointer-compare
-Wabsolute-value
# clang on Linux
-Wimplicit-fallthrough
)
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wunused-parameter -Wstrict-prototypes
)
# clang
ocv_warnings_disable
(
CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715
)
# vs2005
...
...
3rdparty/libjpeg/CMakeLists.txt
View file @
2b4b9466
...
...
@@ -32,7 +32,7 @@ if(CV_GCC OR CV_CLANG)
set_source_files_properties
(
jcdctmgr.c PROPERTIES COMPILE_FLAGS
"-O1"
)
endif
()
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wcast-align -Wshadow -Wunused -Wshift-negative-value
)
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wcast-align -Wshadow -Wunused -Wshift-negative-value
-Wimplicit-fallthrough
)
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wunused-parameter
)
# clang
ocv_warnings_disable
(
CMAKE_C_FLAGS /wd4013 /wd4244 /wd4267
)
# vs2005
...
...
3rdparty/libpng/CMakeLists.txt
View file @
2b4b9466
...
...
@@ -63,7 +63,7 @@ endif(MSVC)
add_library
(
${
PNG_LIBRARY
}
STATIC
${
lib_srcs
}
${
lib_hdrs
}
)
target_link_libraries
(
${
PNG_LIBRARY
}
${
ZLIB_LIBRARIES
}
)
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wcast-align
)
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wcast-align
-Wimplicit-fallthrough
)
set_target_properties
(
${
PNG_LIBRARY
}
PROPERTIES OUTPUT_NAME
${
PNG_LIBRARY
}
...
...
3rdparty/libtiff/CMakeLists.txt
View file @
2b4b9466
...
...
@@ -438,6 +438,7 @@ endif()
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wno-unused-but-set-variable -Wmissing-prototypes -Wmissing-declarations -Wundef -Wunused -Wsign-compare
-Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
-Wmisleading-indentation
-Wimplicit-fallthrough
)
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wunused-parameter
)
# clang
ocv_warnings_disable
(
CMAKE_CXX_FLAGS -Wmissing-declarations -Wunused-parameter
...
...
3rdparty/libwebp/CMakeLists.txt
View file @
2b4b9466
...
...
@@ -37,6 +37,7 @@ endif()
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wunused-variable -Wunused-function -Wshadow -Wmaybe-uninitialized
-Wmissing-prototypes
# clang
-Wmissing-declarations
# gcc
-Wimplicit-fallthrough
)
ocv_warnings_disable
(
CMAKE_C_FLAGS /wd4244 /wd4267
)
# vs2005
...
...
3rdparty/openexr/CMakeLists.txt
View file @
2b4b9466
...
...
@@ -45,6 +45,7 @@ source_group("Src" FILES ${lib_srcs})
ocv_warnings_disable
(
CMAKE_CXX_FLAGS -Wshadow -Wunused -Wsign-compare -Wundef -Wmissing-declarations -Wuninitialized -Wswitch -Wparentheses -Warray-bounds -Wextra
-Wdeprecated-declarations -Wmisleading-indentation -Wdeprecated
-Wsuggest-override -Winconsistent-missing-override
-Wimplicit-fallthrough
)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS /wd4018 /wd4099 /wd4100 /wd4101 /wd4127 /wd4189 /wd4245 /wd4305 /wd4389 /wd4512 /wd4701 /wd4702 /wd4706 /wd4800
)
# vs2005
ocv_warnings_disable
(
CMAKE_CXX_FLAGS /wd4334
)
# vs2005 Win64
...
...
3rdparty/protobuf/CMakeLists.txt
View file @
2b4b9466
...
...
@@ -21,6 +21,7 @@ else()
-Wunused-function -Wunused-const-variable -Wshorten-64-to-32 -Wno-invalid-offsetof
-Wenum-compare-switch
-Wsuggest-override -Winconsistent-missing-override
-Wimplicit-fallthrough
)
endif
()
if
(
CV_ICC
)
...
...
3rdparty/zlib/CMakeLists.txt
View file @
2b4b9466
...
...
@@ -82,6 +82,7 @@ set_target_properties(${ZLIB_LIBRARY} PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
ocv_warnings_disable
(
CMAKE_C_FLAGS -Wshorten-64-to-32 -Wattributes -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshift-negative-value
-Wundef
# _LFS64_LARGEFILE is not defined
/wd4267
# MSVS 2015 (x64) + zlib 1.2.11
-Wimplicit-fallthrough
)
set_target_properties
(
${
ZLIB_LIBRARY
}
PROPERTIES
...
...
cmake/OpenCVCompilerOptions.cmake
View file @
2b4b9466
...
...
@@ -119,7 +119,10 @@ if(CV_GCC OR CV_CLANG)
add_extra_compiler_option
(
-Wno-delete-non-virtual-dtor
)
add_extra_compiler_option
(
-Wno-unnamed-type-template-args
)
add_extra_compiler_option
(
-Wno-comment
)
add_extra_compiler_option
(
-Wno-implicit-fallthrough
)
if
(
NOT OPENCV_SKIP_IMPLICIT_FALLTHROUGH
AND NOT
"
${
CMAKE_CXX_FLAGS
}
${
OPENCV_EXTRA_FLAGS
}
${
OPENCV_EXTRA_CXX_FLAGS
}
"
MATCHES
"implicit-fallthrough"
)
add_extra_compiler_option
(
-Wimplicit-fallthrough=3
)
endif
()
if
(
CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.2.0
)
add_extra_compiler_option
(
-Wno-strict-overflow
)
# Issue is fixed in GCC 7.2.1
endif
()
...
...
cmake/OpenCVUtils.cmake
View file @
2b4b9466
...
...
@@ -504,7 +504,7 @@ macro(ocv_warnings_disable)
foreach
(
var
${
_flag_vars
}
)
foreach
(
warning
${
_gxx_warnings
}
)
if
(
NOT warning MATCHES
"^-Wno-"
)
string
(
RE
PLACE
"
${
warning
}
"
""
${
var
}
"
${${
var
}}
"
)
string
(
RE
GEX REPLACE
"
${
warning
}
(=[^ ]*)?
"
""
${
var
}
"
${${
var
}}
"
)
string
(
REPLACE
"-W"
"-Wno-"
warning
"
${
warning
}
"
)
endif
()
ocv_check_flag_support
(
${
var
}
"
${
warning
}
"
_varname
""
)
...
...
modules/core/src/persistence.cpp
View file @
2b4b9466
...
...
@@ -148,9 +148,8 @@ CvGenericHash* cvCreateMap( int flags, int header_size, int elem_size, CvMemStor
void
icvParseError
(
CvFileStorage
*
fs
,
const
char
*
func_name
,
const
char
*
err_msg
,
const
char
*
source_file
,
int
source_line
)
{
char
buf
[
1
<<
10
];
sprintf
(
buf
,
"%s(%d): %s"
,
fs
->
filename
,
fs
->
lineno
,
err_msg
);
cvError
(
CV_StsParseError
,
func_name
,
buf
,
source_file
,
source_line
);
cv
::
String
msg
=
cv
::
format
(
"%s(%d): %s"
,
fs
->
filename
,
fs
->
lineno
,
err_msg
);
cv
::
errorNoReturn
(
cv
::
Error
::
StsParseError
,
func_name
,
msg
.
c_str
(),
source_file
,
source_line
);
}
void
icvFSCreateCollection
(
CvFileStorage
*
fs
,
int
tag
,
CvFileNode
*
collection
)
...
...
modules/core/src/persistence.hpp
View file @
2b4b9466
...
...
@@ -262,7 +262,7 @@ void icvFSCreateCollection( CvFileStorage* fs, int tag, CvFileNode* collection )
char
*
icvFSResizeWriteBuffer
(
CvFileStorage
*
fs
,
char
*
ptr
,
int
len
);
int
icvCalcStructSize
(
const
char
*
dt
,
int
initial_size
);
int
icvCalcElemSize
(
const
char
*
dt
,
int
initial_size
);
void
icvParseError
(
CvFileStorage
*
fs
,
const
char
*
func_name
,
const
char
*
err_msg
,
const
char
*
source_file
,
int
source_line
);
void
CV_NORETURN
icvParseError
(
CvFileStorage
*
fs
,
const
char
*
func_name
,
const
char
*
err_msg
,
const
char
*
source_file
,
int
source_line
);
char
*
icvEncodeFormat
(
int
elem_type
,
char
*
dt
);
int
icvDecodeFormat
(
const
char
*
dt
,
int
*
fmt_pairs
,
int
max_len
);
int
icvDecodeSimpleFormat
(
const
char
*
dt
);
...
...
modules/core/src/persistence_base64.cpp
View file @
2b4b9466
...
...
@@ -84,7 +84,9 @@ size_t base64_encode(uint8_t const * src, uint8_t * dst, size_t off, size_t cnt)
switch
(
rst
)
{
case
1U
:
*
dst_cur
++
=
base64_padding
;
/* fallthrough */
case
2U
:
*
dst_cur
++
=
base64_padding
;
/* fallthrough */
default:
*
dst_cur
=
0
;
break
;
}
...
...
modules/core/src/softfloat.cpp
View file @
2b4b9466
...
...
@@ -1098,6 +1098,7 @@ static float32_t f32_roundToInt( float32_t a, uint_fast8_t roundingMode, bool ex
switch
(
roundingMode
)
{
case
round_near_even
:
if
(
!
fracF32UI
(
uiA
)
)
break
;
/* fallthrough */
case
round_near_maxMag
:
if
(
exp
==
0x7E
)
uiZ
|=
packToF32UI
(
0
,
0x7F
,
0
);
break
;
...
...
@@ -1805,6 +1806,7 @@ static float64_t f64_roundToInt( float64_t a, uint_fast8_t roundingMode, bool ex
switch
(
roundingMode
)
{
case
round_near_even
:
if
(
!
fracF64UI
(
uiA
)
)
break
;
/* fallthrough */
case
round_near_maxMag
:
if
(
exp
==
0x3FE
)
uiZ
|=
packToF64UI
(
0
,
0x3FF
,
0
);
break
;
...
...
modules/imgproc/test/ocl/test_color.cpp
View file @
2b4b9466
...
...
@@ -103,6 +103,7 @@ PARAM_TEST_CASE(CvtColor, MatDepth, bool)
{
case
COLOR_RGB2HLS
:
case
COLOR_BGR2HLS
:
h_limit
=
180
;
/* fallthrough */
case
COLOR_RGB2HLS_FULL
:
case
COLOR_BGR2HLS_FULL
:
{
ASSERT_EQ
(
dst_roi
.
type
(),
udst_roi
.
type
());
...
...
modules/videoio/src/cap.cpp
View file @
2b4b9466
...
...
@@ -60,6 +60,13 @@
#pragma warning(disable: 4748)
#endif
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#endif
using
namespace
cv
;
namespace
cv
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment