]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: re-enable -Wunused-result with clang
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 6 Jul 2021 13:13:00 +0000 (15:13 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 9 Jul 2021 09:11:25 +0000 (11:11 +0200)
We disabled it in f73fb7b742f294b6d2126afa16001bd2ff6ab461 in response to an
apparent gcc bug. It seems that depending on the combination of optimization
options, gcc still ignores (void). But this seems to work fine with clang, so
let's re-enable the warning conditionally.

meson.build

index 366f2c5607a215292b80dc5bbc1d6c482d287d90..5735cfc7ada0eaba0bfd52d7670836ed046e2886 100644 (file)
@@ -322,7 +322,6 @@ basic_disabled_warnings = [
         '-Wno-format-signedness',
         '-Wno-missing-field-initializers',
         '-Wno-unused-parameter',
-        '-Wno-unused-result',
 ]
 
 possible_common_cc_flags = [
@@ -366,6 +365,12 @@ if cc.get_id() == 'gcc' and (not '02'.contains(get_option('optimization')) or
         possible_common_cc_flags += '-Wno-maybe-uninitialized'
 endif
 
+# Disable -Wno-unused-result with gcc, see
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425.
+if cc.get_id() == 'gcc'
+        possible_common_cc_flags += '-Wno-unused-result'
+endif
+
 # --as-needed and --no-undefined are provided by meson by default,
 # run mesonconf to see what is enabled
 possible_link_flags = [