Silencing cast-function-type warnings

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);
                         ^
This commit is contained in:
Emmanuel Fleury 2019-01-27 12:11:09 +01:00
parent 4cd8fccc11
commit 5d78256796

View File

@ -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 # Due to pervasive use of things like GPOINTER_TO_UINT(), we do not support
# building with -Wbad-function-cast. # building with -Wbad-function-cast.
'-Wno-bad-function-cast', '-Wno-bad-function-cast',
'-Wno-cast-function-type',
# Due to function casts through (void*) we cannot support -Wpedantic: # Due to function casts through (void*) we cannot support -Wpedantic:
# https://wiki.gnome.org/Projects/GLib/CompilerRequirements#Function_pointer_conversions. # https://wiki.gnome.org/Projects/GLib/CompilerRequirements#Function_pointer_conversions.
'-Wno-pedantic', '-Wno-pedantic',