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.
This commit is contained in:
Fabian Homborg 2019-05-29 20:47:18 +02:00
parent 6617c4d79e
commit 80afda08d5

View file

@ -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)