Commit 8bb24c57 authored by Christophe Fergeau's avatar Christophe Fergeau
Browse files

build-sys: Disable -Wcast-function-type

With gcc 8.0.1 from Fedora 28, I'm getting warnings related to
-Wcast-function-type in a few places. Most of these could be solved
by adding an intermediate wrapper with the right number of args, but the
g_source_set_callback() warning cannot be solved this way as the
callback signature will vary depending on the source it's called on.

../../src/spice-session.c: In function 'spice_session_init':
../../src/spice-session.c:293:33: warning: cast between incompatible function types from 'pixman_bool_t (*)(pixman_image_t *)' {aka 'int (*)(union pixman_image *)'} to 'void (*)(void *)' [-Wcast-function-type]
     s->images = cache_image_new((GDestroyNotify)pixman_image_unref);
../../src/gio-coroutine.c: In function 'g_coroutine_socket_wait':
../../src/gio-coroutine.c:59:32: warning: cast between incompatible function types from 'gboolean (*)(GSocket *, GIOCondition,  void *)' {aka 'int (*)(struct _GSocket *, enum <anonymous>,  void *)'} to 'gboolean (*)(void *)' {aka 'int (*)(void *)'} [-Wcast-function-type]
     g_source_set_callback(src, (GSourceFunc)g_io_wait_helper, self, NULL);
(and a few more like these)
Acked-by: Frediano Ziglio's avatarFrediano Ziglio <>
parent 7d119752
......@@ -86,6 +86,11 @@ AC_DEFUN([SPICE_COMPILE_WARNINGS],[
# We use some deprecated functions to avoid #ifdef hell while maintaining
# compat with older gtk / glib versions
# g_source_set_callback() can't be compatible with this warning. Its API
# doc states:
# "The exact type of func depends on the type of source; ie. you should
# not count on func being called with data as its first parameter."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment