From 88f4650f22cbe37ac0d340e431fbe380ed5b0a26 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 15 Mar 2025 07:21:33 +0900 Subject: [PATCH] meson: handle bool-compare warning as error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Then we can detect the error fixed by the previous commit like the following: ../src/libsystemd/sd-device/test-sd-device.c: In function ‘test_sd_device_enumerator_add_all_parents’: ../src/shared/tests.h:225:51: error: comparison of constant ‘0’ with boolean expression is always true [-Werror=bool-compare] 225 | #define ASSERT_OK(expr) __coverity_check__((expr) >= 0) | ^~ ../src/libsystemd/sd-device/test-sd-device.c:547:9: note: in expansion of macro ‘ASSERT_OK’ 547 | ASSERT_OK(sd_device_enumerator_add_all_parents(e) >= 0); | ^~~~~~~~~ --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index d87c651fc66..9cbfffb8c30 100644 --- a/meson.build +++ b/meson.build @@ -379,6 +379,7 @@ possible_common_cc_flags = [ '-Warray-bounds=2', '-Wdate-time', '-Wendif-labels', + '-Werror=bool-compare', '-Werror=discarded-qualifiers', '-Werror=format=2', '-Werror=format-signedness', -- 2.47.3