From 01ccb4d0235a6d5b8add7c7595816a5a89cbbb81 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Sun, 19 Feb 2017 01:14:15 +0000 Subject: [PATCH] Inhibit -Wsuggest-override in GCC 5, causes lots of warnings in Qt headers. --- mkspecs/features/warnings.pri | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/warnings.pri b/mkspecs/features/warnings.pri index 69a7649ee..7a868ae25 100644 --- a/mkspecs/features/warnings.pri +++ b/mkspecs/features/warnings.pri @@ -23,11 +23,15 @@ contains(BLACK_CONFIG, AllowNoisyWarnings) { } } -# gcc 5 can warn about missing override keyword +# gcc 5 can warn about missing override keyword, +# gcc 6 can do it without thousands of warnings in qt headers gcc { GCC_VERSION = $$system($$QMAKE_CXX -dumpversion) GCC_MAJOR = $$section(GCC_VERSION, ., 0, 0) - greaterThan(GCC_MAJOR, 4) { + greaterThan(GCC_MAJOR, 5) { + QMAKE_CXXFLAGS_WARN_ON *= -Wsuggest-override + } + greaterThan(GCC_MAJOR, 4):contains(BLACK_CONFIG, AllowNoisyWarnings) { QMAKE_CXXFLAGS_WARN_ON *= -Wsuggest-override } }