From 91482930184edaf774bac3b110dfbab0dcf70649 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 13 Feb 2018 16:40:19 +0000 Subject: [PATCH] m4: disable gcc8 -Wcast-function-type warnings from -Wextra MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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é --- 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 b9c9748420..4b35a6f6b5 100644 --- a/m4/virt-compile-warnings.m4 +++ b/m4/virt-compile-warnings.m4 @@ -177,6 +177,8 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ # with gl_MANYWARN_COMPLEMENT # So we have -W enabled, and then have to explicitly turn off... wantwarn="$wantwarn -Wno-sign-compare" + # We do "bad" function casts all the time for event callbacks + wantwarn="$wantwarn -Wno-cast-function-type" # GNULIB expects this to be part of -Wc++-compat, but we turn # that one off, so we need to manually enable this again -- 2.47.2