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 92200 - GtkItemFactoryCallback prototype needs to be filled out
GtkItemFactoryCallback prototype needs to be filled out
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: Other
2.0.x
Other All
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
: 96591 445444 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-08-31 20:29 UTC by Donald R. Laster Jr.
Modified: 2007-06-08 11:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Donald R. Laster Jr. 2002-08-31 20:29:05 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.
Comment 1 Owen Taylor 2002-09-01 14:03:04 UTC
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)
Comment 2 Matthias Clasen 2002-10-23 12:15:56 UTC
*** Bug 76219 has been marked as a duplicate of this bug. ***
Comment 3 Matthias Clasen 2002-10-23 12:18:15 UTC
*** Bug 96591 has been marked as a duplicate of this bug. ***
Comment 4 Jamie Zawinski 2005-01-02 04:00:59 UTC
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,
Comment 5 Owen Taylor 2007-06-08 11:39:31 UTC
*** Bug 445444 has been marked as a duplicate of this bug. ***