From fbc1747168df83b5f0decf7b2118713f141c73f6 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 23 Apr 2018 12:51:58 +0200 Subject: [PATCH] Fix a bunch of warning with clang The option -Wno-discarded-qualifiers only exists with GCC, clang warns that it has no effects. Also it warns when some virtual fuction are marked with override but not all of them. --- cmake/modules/Warnings.cmake | 5 +++-- src/gui/networksettings.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/modules/Warnings.cmake b/cmake/modules/Warnings.cmake index f2c271e88..d4f7c910a 100644 --- a/cmake/modules/Warnings.cmake +++ b/cmake/modules/Warnings.cmake @@ -7,10 +7,11 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") # Fix sqlite compilation on macOS set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-incompatible-pointer-types-discards-qualifiers") - # Fix sqlite compilation on MinGW - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-discarded-qualifiers") if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + # Fix sqlite compilation on MinGW + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-discarded-qualifiers") + execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) if(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8) diff --git a/src/gui/networksettings.h b/src/gui/networksettings.h index c9d77e3bb..8d35b14dc 100644 --- a/src/gui/networksettings.h +++ b/src/gui/networksettings.h @@ -35,7 +35,7 @@ class NetworkSettings : public QWidget public: explicit NetworkSettings(QWidget *parent = 0); ~NetworkSettings(); - QSize sizeHint() const; + QSize sizeHint() const override; private slots: void saveProxySettings();