From 46c0151ff13e76dfa57152003f40a53e9954f519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jianxiang=20Wang=20=28=E7=8E=8B=E5=81=A5=E7=BF=94=29?= Date: Mon, 23 Dec 2019 03:13:22 +0800 Subject: [PATCH] Enable -Wsuggest-override (#36343) --- CMakeLists.txt | 3 +++ Makefile | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64882701ef918..09fc85a064f61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -223,6 +223,9 @@ ELSE() -Wold-style-cast \ -Woverloaded-virtual \ -Wpedantic") + IF(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") + SET(CATA_WARNINGS "$(CATA_WARNINGS) -Wsuggest-override") + ENDIF(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Compact the whitespace in the warning string string(REGEX REPLACE "[\t ]+" " " CATA_WARNINGS "${CATA_WARNINGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CATA_WARNINGS}") diff --git a/Makefile b/Makefile index 663bcd98853ee..5de0d18afdd6a 100644 --- a/Makefile +++ b/Makefile @@ -91,6 +91,9 @@ WARNINGS = \ -Wold-style-cast \ -Woverloaded-virtual \ -Wpedantic +ifndef CLANG + WARNINGS += -Wsuggest-override +endif # Uncomment below to disable warnings #WARNINGS = -w DEBUGSYMS = -g