`G_DEFINE_DYNAMIC_TYPE_EXTENDED` causes warnings with -Wcast-function-type
G_DEFINE_DYNAMIC_TYPE_EXTENDED
declares:
static void type_name##_class_finalize (TypeName##Class *klass);
and casts it with (GClassFinalizeFunc)
to be placed in the GTypeInfo
, but this type is:
void
(*GClassFinalizeFunc) (gpointer g_class,
gpointer class_data);
which causes warnings like:
file.c:60:1: note: in expansion of macro ‘G_DEFINE_DYNAMIC_TYPE_EXTENDED’
G_DEFINE_DYNAMIC_TYPE_EXTENDED(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gtypemodule.h:208:5: warning: cast between incompatible function types from ‘void (*)(...Class *)’ {aka ‘void (*)(struct _...Class *)’} to ‘void (*)(void *, void *)’ [-Wcast-function-type]
(GClassFinalizeFunc) type_name##_class_finalize, \
^
which are triggered by meson -Dwarning_level=2
.
Similar warnings arise for the other type methods. Perhaps applying some double-casts like !82 (merged) might help?