[libvirt PATCH 1/6] meson: get rid of list of unused warning flags

Daniel P. Berrangé berrange at redhat.com
Thu Apr 8 10:58:18 UTC 2021


We're not using these warning flags with libvirt, and it is not worth
keeping them just to issue a warning if someone tries to enable them.
If someone does try to enable them, either libvirt will build cleanly
or it won't.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 meson.build | 76 -----------------------------------------------------
 1 file changed, 76 deletions(-)

diff --git a/meson.build b/meson.build
index b827bd9275..7565eace17 100644
--- a/meson.build
+++ b/meson.build
@@ -491,82 +491,6 @@ if not cc.compiles(w_unused_function_code, args: w_unused_function_args)
   cc_flags += ['-Wno-unused-function']
 endif
 
-cc_flags_disabled = [
-  # In meson this is specified using 'c_std=gnu99' in project() function.
-  '-std=gnu99',
-
-  # don't care about C++ compiler compat
-  '-Wc++-compat',
-  '-Wabi',
-  '-Wdeprecated',
-
-  # Don't care about ancient C standard compat
-  '-Wtraditional',
-  '-Wtraditional-conversion',
-
-  # Ignore warnings in /usr/include
-  '-Wsystem-headers',
-
-  # Happy for compiler to add struct padding
-  '-Wpadded',
-
-  # GCC very confused with -O2
-  '-Wunreachable-code',
-
-  # Too many to deal with
-  '-Wconversion',
-  '-Wsign-conversion',
-
-  # Need to allow bad cast for execve()
-  '-Wcast-qual',
-
-  # We need to use long long in many places
-  '-Wlong-long',
-
-  # We allow manual list of all enum cases without default
-  '-Wswitch-default',
-
-  # Not a problem since we don't use -fstrict-overflow
-  '-Wstrict-overflow',
-
-  # Not a problem since we don't use -funsafe-loop-optimizations
-  '-Wunsafe-loop-optimizations',
-
-  # gcc 4.4.6 complains this is C++ only; gcc 4.7.0 implies this from -Wall
-  '-Wenum-compare',
-
-  # gcc 5.1 -Wformat-signedness mishandles enums, not ready for prime time
-  '-Wformat-signedness',
-
-  # Several conditionals expand the same on both branches depending on the
-  # particular platform/architecture
-  '-Wduplicated-branches',
-
-  # > This warning does not generally indicate that there is anything wrong
-  # > with your code; it merely indicates that GCC's optimizers are unable
-  # > to handle the code effectively.
-  # Source: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
-  '-Wdisabled-optimization',
-
-  # Various valid glib APIs/macros trigger this warning
-  '-Wbad-function-cast',
-
-  # We might fundamentally need some of these disabled forever, but
-  # ideally we'd turn many of them on
-  '-Wfloat-equal',
-  '-Wpacked',
-  '-Wunused-macros',
-  '-Woverlength-strings',
-  '-Wstack-protector',
-  '-Wsuggest-attribute=malloc',
-]
-
-foreach flag : cc_flags_disabled
-  if cc_flags.contains(flag)
-    error('@0@ is disabled but listed in cc_flags'.format(flag))
-  endif
-endforeach
-
 supported_cc_flags = cc.get_supported_arguments(cc_flags)
 add_project_arguments(supported_cc_flags, language: 'c')
 
-- 
2.30.2




More information about the libvir-list mailing list