New warning keys since GCC 7.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-03-23 10:36:11 +02:00
parent d696af9a33
commit 50a5119960
2 changed files with 22 additions and 10 deletions

View File

@ -16,19 +16,24 @@ count(LIST, 1, >): error("The build will fail. Path '$${OUT_PWD}' contains space
unix { unix {
*-g++ { *-g++ {
GCC_VERSION = $$system("g++ -dumpversion") GCC_VERSION = $$system("g++ -dumpversion")
contains(GCC_VERSION, 6.[0-9]) { contains(GCC_VERSION, 7.[0-9]) {
message( "g++ version 6.x found" ) message( "g++ version 7.x found" )
CONFIG += g++6 CONFIG += g++7
} else { } else {
contains(GCC_VERSION, 5.[0-9]) { contains(GCC_VERSION, 6.[0-9]) {
message( "g++ version 5.x found" ) message( "g++ version 6.x found" )
CONFIG += g++5 CONFIG += g++6
} else { } else {
contains(GCC_VERSION, 4.[0-9]) { contains(GCC_VERSION, 5.[0-9]) {
message( "g++ version 4.x found" ) message( "g++ version 5.x found" )
CONFIG += g++4 CONFIG += g++5
} else { } else {
message( "Unknown GCC configuration" ) contains(GCC_VERSION, 4.[0-9]) {
message( "g++ version 4.x found" )
CONFIG += g++4
} else {
message( "Unknown GCC configuration" )
}
} }
} }
} }

View File

@ -283,6 +283,13 @@ g++6:GCC_DEBUG_CXXFLAGS += \
-Wduplicated-cond \ -Wduplicated-cond \
-Wmisleading-indentation -Wmisleading-indentation
# Since GCC 7
g++7:GCC_DEBUG_CXXFLAGS += \
-Wduplicated-branches \
-Wrestrict \
-Walloc-zero \
-Wnonnull
# Usefull Clang warnings keys. # Usefull Clang warnings keys.
CLANG_DEBUG_CXXFLAGS += \ CLANG_DEBUG_CXXFLAGS += \
-O0 \ # Turn off oprimization. -O0 \ # Turn off oprimization.