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

Pavel Hrdina posted 1 patch 6 years ago
Failed in applying to current master (apply log)
m4/virt-compile-warnings.m4 | 2 ++
1 file changed, 2 insertions(+)
[libvirt] [dbus PATCH] m4: disable gcc8 -Wcast-function-type warnings from -Wextra
Posted by Pavel Hrdina 6 years ago
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@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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list