From 80afda08d5ff6eba3e18520266617c1a108964f4 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 29 May 2019 20:47:18 +0200 Subject: [PATCH] cmake: Enable -Wall -Wextra Not -Werror, just the warnings themselves. Let's just see what happens. It's warning-free on my system. Worst case we disable it again, better case we refine the set. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 238046952..7ac5d16f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,11 @@ if (CMAKE_GENERATOR STREQUAL "Ninja" AND set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always") endif() +# Enable a whole bunch of warnings, but turn off: +# - implicit fallthrough because that does not recognize some cases where it's desired (and I *really* want this one!) +# - comment because we use a bunch of those, and they're not really all that harmful. +# - address, because that occurs for our mkostemp check (weak-linking requires us to compare `&mkostemp == nullptr`). +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wimplicit-fallthrough=0 -Wno-comment -Wno-address") # Disable exception handling. ADD_COMPILE_OPTIONS(-fno-exceptions)