Skip to content

Commit 66c86b1

Browse files
committed
[build] Add -Wshadow=local to CMake build flags.
Supported since GCC 7.0.
1 parent be254e7 commit 66c86b1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,9 @@ endif()
642642
# add extra warning flags for gccish compilers
643643
if (HAVE_COMPILER_GNU_COMPAT)
644644
set (SRT_GCC_WARN "-Wall -Wextra")
645+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
646+
set (SRT_GCC_WARN "${SRT_GCC_WARN} -Wshadow=local")
647+
endif()
645648
else()
646649
# cpp debugging on Windows :D
647650
#set (SRT_GCC_WARN "/showIncludes")

0 commit comments

Comments
 (0)