Enable the latest versions of GCC, Clang and ICC with -Werror
Tested with GCC 4.9, Clang from XCode 5.1 and ICC 15 beta. Clang 3.5 (pre-release) cannot compile qtdeclarative yet with -Werror due to invalid C++ code there that calls member functions on null pointers. Change-Id: Ic2845371a1899716985bc0813dfb820fa418e207 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
8cce08fbf9
commit
6336ae831d
@ -44,20 +44,20 @@ warnings_are_errors:warning_clean {
|
||||
# This setting is compiler-dependent anyway because it depends on the version of the
|
||||
# compiler.
|
||||
clang {
|
||||
# Apple clang 4.0-4.2,5.0
|
||||
# Apple clang 4.0-4.2,5.0-5.1
|
||||
# Regular clang 3.3 & 3.4
|
||||
apple_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
|
||||
reg_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
|
||||
contains(apple_ver, "4\\.[012]|5\\.0")|contains(reg_ver, "3\\.[34]") {
|
||||
contains(apple_ver, "4\\.[012]|5\\.[01]")|contains(reg_ver, "3\\.[34]") {
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated-declarations $$WERROR
|
||||
|
||||
# glibc's bswap_XX macros use the "register" keyword
|
||||
linux:equals(reg_ver, "3.4"): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=deprecated-register
|
||||
}
|
||||
} else:intel_icc:linux {
|
||||
# Intel CC 13.0 - 14.0, on Linux only
|
||||
# Intel CC 13.0 - 15.0, on Linux only
|
||||
ver = $${QT_ICC_MAJOR_VERSION}.$${QT_ICC_MINOR_VERSION}
|
||||
linux:contains(ver, "(13\\.|14\\.0)") {
|
||||
linux:contains(ver, "(1[34]\\.|15\\.0)") {
|
||||
# 177: function "entity" was declared but never referenced
|
||||
# (too aggressive; ICC reports even for functions created due to template instantiation)
|
||||
# 1224: #warning directive
|
||||
@ -67,9 +67,9 @@ warnings_are_errors:warning_clean {
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Werror -ww177,1224,1478,1881 $$WERROR
|
||||
}
|
||||
} else:gcc:!clang:!intel_icc {
|
||||
# GCC 4.6-4.8
|
||||
# GCC 4.6-4.9
|
||||
ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION}
|
||||
contains(ver, "4\\.[678]") {
|
||||
contains(ver, "4\\.[6789]") {
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=cpp -Wno-error=deprecated-declarations $$WERROR
|
||||
|
||||
# GCC prints this bogus warning, after it has inlined a lot of code
|
||||
|
Loading…
Reference in New Issue
Block a user