After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 309253 - GST_DEBUG_FUNCPTR macro does illegal casting from function pointer to void pointer
GST_DEBUG_FUNCPTR macro does illegal casting from function pointer to void po...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.8.10
Other Linux
: Normal minor
: 0.9.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-07-01 07:45 UTC by Akos Maroy
Modified: 2005-07-20 16:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Akos Maroy 2005-07-01 07:45:55 UTC
the GST_DEBUG_FUNCPTR macro is defined as:

gstinfo.h:#define GST_DEBUG_FUNCPTR(ptr) (_gst_debug_register_funcptr((void
*)(ptr), #ptr) , ptr)

which include a cast from a function pointer to a void pointer. this is illegal,
and gcc 3.4 give the following warning about it:

 warning: ISO C forbids conversion of function pointer to object pointer type


(see the downstream bug at the LiveSupport project bug database at
http://bugs.campware.org/view.php?id=1216)
Comment 1 Ronald Bultje 2005-07-02 08:47:44 UTC
Hm, that doesn't look good indeed.

The campware bugzilla is not accessible for non-subscribers, btw (it'll show the
log-in page).

Afaik, glib uses function-type casts, e.g. something like this is acceptable:

typedef void (*GstDebugFunctionPtr) (void);
#define GST_DEBUG_FUNCPTR(func) \
    (_gst_debug_register_funcptr((GstDebugFuncPtr)func, #func), func)
void _gst_debug_register_funcptr(GstDebugFuncPtr func, const gchar *name);

Note that this is in fact an API change, since _register_funcptr() used to
return a void* containing the function itself (which is silly). I'm not so sure
if we should change API (my brain tells me it's OK, my guts tells me we
shouldn't). For 0.9, we should definitely change this, though.
Comment 2 Ronald Bultje 2005-07-20 16:20:31 UTC
Applied a fix for this (or so I believe :) ). 0.9-only, since it's an API change...