[libvirt] [dbus PATCH] m4: disable gcc8 -Wcast-function-type warnings from -Wextra

Pavel Hrdina phrdina at redhat.com
Thu Mar 22 13:26:47 UTC 2018


GLib uses macros to create cleanup functions that are used by
g_auto or g_autoptr macros.  They expect a function defined as
"void (*)(void *)" which is usually not that case.

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---

Pushed under build-breaker rule.

 m4/virt-compile-warnings.m4 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index f6ab795..6ece136 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -160,6 +160,8 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
     # Need -fipa-pure-const in order to make -Wsuggest-attribute=pure
     # fire even without -O.
     wantwarn="$wantwarn -fipa-pure-const"
+    # We do "bad" function cast to define glib auto cleanup functions
+    wantwarn="$wantwarn -Wno-cast-function-type"
 
     if test "$enable_werror" = "yes"
     then
-- 
2.14.3




More information about the libvir-list mailing list