Added warnings that appeared after GCC 5/6 release.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-08-07 14:14:17 +03:00
parent 549a6e5780
commit 6a2c87dacf
2 changed files with 41 additions and 0 deletions

View File

@ -6,5 +6,27 @@ include(common.pri)
error("Use at least Qt 5.0.0.") error("Use at least Qt 5.0.0.")
} }
unix {
*-g++ {
GCC_VERSION = $$system("g++ -dumpversion")
contains(GCC_VERSION, 6.[0-9]) {
message( "g++ version 6.x found" )
CONFIG += g++6
} else {
contains(GCC_VERSION, 5.[0-9]) {
message( "g++ version 5.x found" )
CONFIG += g++5
} else {
contains(GCC_VERSION, 4.[0-9]) {
message( "g++ version 4.x found" )
CONFIG += g++4
} else {
message( "Unknown GCC configuration" )
}
}
}
}
}
TEMPLATE = subdirs TEMPLATE = subdirs
SUBDIRS = src SUBDIRS = src

View File

@ -256,6 +256,25 @@ GCC_DEBUG_CXXFLAGS += \
-Wno-unused \ -Wno-unused \
-ftrapv -ftrapv
# Since GCC 5
g++5:GCC_DEBUG_CXXFLAGS += \
-Wswitch-bool \
-Wlogical-not-parentheses \
-Wsizeof-array-argument \
-Wbool-compare \
-Wsuggest-final-types \
-Wsuggest-final-methods
# Since GCC 6
g++6:GCC_DEBUG_CXXFLAGS += \
-Wshift-negative-value \
-Wshift-overflow \
-Wshift-overflow=2 \
-Wtautological-compare \
-Wnull-dereference \
-Wduplicated-cond \
-Wmisleading-indentation
# Usefull Clang warnings keys. # Usefull Clang warnings keys.
CLANG_DEBUG_CXXFLAGS += \ CLANG_DEBUG_CXXFLAGS += \
-O0 \ # Turn off oprimization. -O0 \ # Turn off oprimization.