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 {
*-g++ {
GCC_VERSION = $$system("g++ -dumpversion")
contains(GCC_VERSION, 6.[0-9]) {
message( "g++ version 6.x found" )
CONFIG += g++6
contains(GCC_VERSION, 7.[0-9]) {
message( "g++ version 7.x found" )
CONFIG += g++7
} else {
contains(GCC_VERSION, 5.[0-9]) {
message( "g++ version 5.x found" )
CONFIG += g++5
contains(GCC_VERSION, 6.[0-9]) {
message( "g++ version 6.x found" )
CONFIG += g++6
} else {
contains(GCC_VERSION, 4.[0-9]) {
message( "g++ version 4.x found" )
CONFIG += g++4
contains(GCC_VERSION, 5.[0-9]) {
message( "g++ version 5.x found" )
CONFIG += g++5
} 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 \
-Wmisleading-indentation
# Since GCC 7
g++7:GCC_DEBUG_CXXFLAGS += \
-Wduplicated-branches \
-Wrestrict \
-Walloc-zero \
-Wnonnull
# Usefull Clang warnings keys.
CLANG_DEBUG_CXXFLAGS += \
-O0 \ # Turn off oprimization.