From 50a5119960065318e025d07a6744847995de8a48 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 23 Mar 2017 10:36:11 +0200 Subject: [PATCH] New warning keys since GCC 7. --HG-- branch : develop --- Valentina.pro | 25 +++++++++++++++---------- common.pri | 7 +++++++ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Valentina.pro b/Valentina.pro index 2064c3d5f..f48fb8973 100644 --- a/Valentina.pro +++ b/Valentina.pro @@ -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" ) + } } } } diff --git a/common.pri b/common.pri index f9933837c..fc2b7599c 100644 --- a/common.pri +++ b/common.pri @@ -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.