From: Yu Watanabe Date: Fri, 14 Mar 2025 22:21:33 +0000 (+0900) Subject: meson: handle bool-compare warning as error X-Git-Tag: v258-rc1~1075^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88f4650f22cbe37ac0d340e431fbe380ed5b0a26;p=thirdparty%2Fsystemd.git meson: handle bool-compare warning as error 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); | ^~~~~~~~~ --- 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',