From 1d638c6a787dda4523033d99450dcabd2d957922 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Wed, 12 Aug 2020 02:21:30 +0200 Subject: [PATCH] Meta: Enable -Wmissing-declarations Concludes #3096. Phew! From here on, build system and CI will ensure that all new code defines compilation-unit-only code as 'static', and that dead code can be found more easily. Also, this style encourages type checking by suggesting that you put a proper declaration in a shared header. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f019ab68f3..ec6c05faed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,7 @@ add_custom_target(check-style USES_TERMINAL ) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -std=c++2a -fdiagnostics-color=always") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wmissing-declarations -std=c++2a -fdiagnostics-color=always") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fconcepts") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")