From 6e2f8bfedbbed428c37ceddb1272c3c12b64b60a Mon Sep 17 00:00:00 2001 From: Peter Keresztes Schmidt Date: Sat, 27 Feb 2021 02:08:14 +0100 Subject: [PATCH] build: Enable Wextra with some exceptions -Wno-cast-function-type: Signal handler code relies on this. -Wno-type-limits: Some of the color space conversion code in zm_image throws this warning. To not break anything let's ignore this warning for the time being. Note that clang enables -Woverloaded-virtual with -Wextra. To not flood the GCC build log with warnings let's not enable this at the moment. This will be done in a second step, when the currently throwing code will be cleaned up. --- cmake/compiler/clang/settings.cmake | 4 +++- cmake/compiler/gcc/settings.cmake | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/compiler/clang/settings.cmake b/cmake/compiler/clang/settings.cmake index c2f2cf74f..791a58124 100644 --- a/cmake/compiler/clang/settings.cmake +++ b/cmake/compiler/clang/settings.cmake @@ -1,6 +1,8 @@ target_compile_options(zm-warning-interface INTERFACE - -Wall) + -Wall + -Wextra + -Wno-unused-parameter) if(ASAN) target_compile_options(zm-compile-option-interface diff --git a/cmake/compiler/gcc/settings.cmake b/cmake/compiler/gcc/settings.cmake index 4011b5df1..b037a4ea6 100644 --- a/cmake/compiler/gcc/settings.cmake +++ b/cmake/compiler/gcc/settings.cmake @@ -1,6 +1,10 @@ target_compile_options(zm-warning-interface INTERFACE - -Wall) + -Wall + -Wextra + -Wno-cast-function-type + -Wno-type-limits + -Wno-unused-parameter) if(ASAN) target_compile_options(zm-compile-option-interface