G_DEFINE_AUTOPTR_CLEANUP_FUNC warns when function has return value
@heftig
Submitted by Jan Alexander Steffens Link to original bug (#796237)
Description
+++ This bug was initially created as a clone of Bug #796230 +++
/home/fraxinas/gst/master/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.h: In function 'glib_listautoptr_cleanup_GstSDPMessage':
/usr/include/glib-2.0/glib/gmacros.h:462:99: warning: cast between incompatible function types from 'GstSDPResult ()(GstSDPMessage )' {aka 'enum <anonymous>
()(struct <anonymous>
)'} to 'void ()(void )' [-Wcast-function-type]
static inline void _GLIB_AUTOPTR_LIST_FUNC_NAME(TypeName) (GList **_l) { g_list_free_full (_l, (GDestroyNotify) func); }
^
/home/fraxinas/gst/master/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.h:756:1: note: in expansion of macro 'G_DEFINE_AUTOPTR_CLEANUP_FUNC'
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstSDPMessage, gst_sdp_message_free)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fraxinas/gst/master/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.h: In function 'glib_slistautoptr_cleanup_GstSDPMessage':
/usr/include/glib-2.0/glib/gmacros.h:463:102: warning: cast between incompatible function types from 'GstSDPResult ()(GstSDPMessage )' {aka 'enum <anonymous>
()(struct <anonymous>
)'} to 'void ()(void )' [-Wcast-function-type]
static inline void _GLIB_AUTOPTR_SLIST_FUNC_NAME(TypeName) (GSList **_l) { g_slist_free_full (_l, (GDestroyNotify) func); }
^
/home/fraxinas/gst/master/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.h:756:1: note: in expansion of macro 'G_DEFINE_AUTOPTR_CLEANUP_FUNC'
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstSDPMessage, gst_sdp_message_free)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This happens after upgrading from gcc 7.3.1+20180406-1 to 8.1.0-1
From https://gcc.gnu.org/gcc-8/changes.html -Wcast-function-type warns when a function pointer is cast to an incompatible function pointer. This warning is enabled by -Wextra.