GNOME Bugzilla – Bug 598508
Make prototype warning in gtkitemfactory.h:47 go away
Last modified: 2010-02-23 17:31:25 UTC
If one compiles a Gtk+ program with -Wstrict-prototypes enabled, one will encounter this message: /usr/include/gtk-2.0/gtk/gtkitemfactory.h:47: warning: function declaration isn’t a prototype [-Wstrict-prototypes] This is quite annoying. An easy fix would be to use #pragma GCC diagnostic ignored "-Wno-strict-prototypes" at the top of the header files, which disables strict prototype checking. That #pragma is new in some GCC 4.x version, so it might make sense to protect this: #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) #pragma GCC diagnostic ignored "-Wno-strict-prototypes" #endif Of course, using this will disable the warning for the entire .c file. However, I'd argue that this shouldn't be much of a problem, since the -Wstrict-prototypes output is useless anyway here. Also, the user could still manually reenable that flag. http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html Haven't prepped a patch for this yet. Can do if requested.
It's easier to fix the prototype, just needs to add void: typedef void (*GtkItemFactoryCallback) (void);
Hmm forget my comment, I should have read the comment before :(
Can't fix this compatibly. Its all deprecated anyway
Matthias, what's wrong with my suggestion above? What's not comaptible about that? And the fact that this part is deprecated doesn't really matter much given that gtk.h includes it and hence it shows up everywhere.
Its going away in gtk3. no need to muck around with cosmetics before then.