diff --git a/meson.build b/meson.build index 366f2c5607..5735cfc7ad 100644 --- a/meson.build +++ b/meson.build @@ -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 = [