GNOME Bugzilla – Bug 92200
GtkItemFactoryCallback prototype needs to be filled out
Last modified: 2007-06-08 11:39:31 UTC
The prototype in the header file gtkitemfactory.h (line 46) should be changed from typdef void (*GtkItemFactoryCallback)(); to typedef void (*GtkItemFactoryCallback)(gpointer callback_data, guint callback_action, GtkWidget * widget); When certain GCC options are specified (missing-prototypes, strict-prototypes and missing-prototypes) the following warning message is generated at compile time warning: function declaration isn't a prototype By filling out the prototype the warning is eliminated.
GTK+ head includes: /* We use () here to mean unspecified arguments. This is deprecated * as of C99, but we can't change it without breaking compatibility. * (Note that if we are included from a C++ program () will mean * (void) so an explicit cast will be needed.) */ The breakage is both API (functions in C need casts where they don't before) and ABI (C++ mangling will change)
*** Bug 76219 has been marked as a duplicate of this bug. ***
*** Bug 96591 has been marked as a duplicate of this bug. ***
Can someone explain to me what would be broken by the following patch? I think that this patch: - eliminates an existing warning in ANSI C with -Wall -Wstrict-prototypes; - does not cause new warnings in existing code, or cause existing code to need new casts (e.g., comment #6 in bug 96591); - does not change C++ mangling. Why not do this? @@ -52,3 +52,9 @@ */ +#ifdef __cplusplus typedef void (*GtkItemFactoryCallback) (); +#else +typedef void (*GtkItemFactoryCallback) (gpointer callback_data, + guint callback_action, + GtkWidget *widget); +#endif typedef void (*GtkItemFactoryCallback1) (gpointer callback_data,
*** Bug 445444 has been marked as a duplicate of this bug. ***