From 5d782567969105d25f17266bac91337ade92842e Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Sun, 27 Jan 2019 12:11:09 +0100 Subject: [PATCH] Silencing cast-function-type warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A lot of code cast function pointer to incorrect types. There is no other way but silencing the warning. Follows an example of such cast: glib/glist.c: In function ‘g_list_free_full’: glib/glist.c:223:25: error: cast between incompatible function types from ‘GDestroyNotify’ {aka ‘void (*)(void *)’} to ‘void (*)(void *, void *)’ [-Werror=cast-function-type] g_list_foreach (list, (GFunc) free_func, NULL); ^ --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index de9345867..737f8b31a 100644 --- a/meson.build +++ b/meson.build @@ -355,6 +355,7 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang' # Due to pervasive use of things like GPOINTER_TO_UINT(), we do not support # building with -Wbad-function-cast. '-Wno-bad-function-cast', + '-Wno-cast-function-type', # Due to function casts through (void*) we cannot support -Wpedantic: # https://wiki.gnome.org/Projects/GLib/CompilerRequirements#Function_pointer_conversions. '-Wno-pedantic',