GNOME Bugzilla – Bug 128782
GCClosure incorrectly uses gpointer for callback
Last modified: 2011-02-18 16:14:11 UTC
GCClosure::callback should be a GCallback, not a gpointer. This is also an issue in several related functions. Casting the callback function pointer to a gpointer may cause problems on architectures (e.g. IA-64) where function pointers are not simple addresses, and in any case it is not permitted by the C standard. Note the fifth bullet point in section 3.2.2.3 of the ANSI C rationale. http://www.lysator.liu.se/c/rat/c2.html#3-2-2-3 I believe lint(1) will also complain about this. g++ 3.2 produces an error (e.g. when building a C++ program that uses g_signal_handlers_block_matched()).
g_signal_handlers_block_matched() can't be changed without API compatibilty breakage (we've noted this problem in the past) and actually, there is no problem on ia64 or other common architectures that I'm aware of... on ia64, function pointers are pointers to function descriptors, not the function descriptors themselves. I suspect changing GClosure::callback is also a API change, though it's pretty obscure what the details of the API are in this area.
as repeatedly discussed