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);
      |         ^~~~~~~~~
This commit is contained in:
Yu Watanabe
2025-03-15 07:21:33 +09:00
parent 09e0ce8010
commit 88f4650f22

View File

@@ -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',