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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The -Wextra flag bundle gained a new warning -Wcast-function-type.
This complains if you cast between two function prototypes where
the number of parameters or their data types are not compatible.
Unfortunately we need such "bad" function casts for our event
callbacks. It is possible to silence the warning by first casting
to the generic "void (*)(void)" function prototype, but that is
rather ugly to add throughout libvirt code.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---

Pushed as a CI build fix

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

diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index 0cf67fa..cbd9e0c 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -151,6 +151,9 @@ AC_DEFUN([LIBVIRT_GLIB_COMPILE_WARNINGS],[
     # that one off, so we need to manually enable this again
     wantwarn="$wantwarn -Wjump-misses-init"
 
+    # We do "bad" function casts all the time for event callbacks
+    wantwarn="$wantwarn -Wno-cast-function-type"
+
     # GNULIB turns on -Wformat=2 which implies -Wformat-nonliteral,
     # so we need to manually re-exclude it.  Also, older gcc 4.2
     # added an implied ATTRIBUTE_NONNULL on any parameter marked
-- 
2.14.3

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux