[glib: 9/10] Silencing cast-function-type warnings



commit 5d782567969105d25f17266bac91337ade92842e
Author: Emmanuel Fleury <emmanuel fleury u-bordeaux fr>
Date:   Sun Jan 27 12:11:09 2019 +0100

    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);
                             ^

 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',


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