From 7b502d113b8bbd9027c6c3c5776a4beed5c25dfb Mon Sep 17 00:00:00 2001 From: Nicholas-Baron Date: Thu, 15 Apr 2021 00:07:44 -0700 Subject: [PATCH] Everywhere: Add "free" warnings The following warnings do not occur anywhere in the codebase and so enabling them is effectivly free: * `-Wcast-align` * `-Wduplicated-cond` * `-Wformat=2` * `-Wlogical-op` * `-Wmisleading-indentation` * `-Wunused` These are taken as a strict subset of the list in #5487. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cebc9eb83a1..ba26dda423b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,15 +161,22 @@ endif() add_compile_options(-Wall) add_compile_options(-Wextra) +# The following warnings are sorted by the "base" name (the part excluding the initial Wno or W). add_compile_options(-Wno-address-of-packed-member) +add_compile_options(-Wcast-align) add_compile_options(-Wcast-qual) add_compile_options(-Wno-deprecated-copy) +add_compile_options(-Wduplicated-cond) add_compile_options(-Wno-expansion-to-defined) +add_compile_options(-Wformat=2) add_compile_options(-Wimplicit-fallthrough) +add_compile_options(-Wlogical-op) +add_compile_options(-Wmisleading-indentation) add_compile_options(-Wmissing-declarations) add_compile_options(-Wno-nonnull-compare) add_compile_options(-Wno-unknown-warning-option) add_compile_options(-Wundef) +add_compile_options(-Wunused) add_compile_options(-Wwrite-strings) add_compile_options(-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.)