geany/geany — pull request #359 by b4n (2014-10-20 16:17:18+00:00)
Title: Add prototypes for all plugin symbols

This allows the compilers to check that the plugin's symbols have the
proper prototype. Doing so can avoid subtle and hard-to-find bugs in
case a plugin's symbol has incorrect signature as dlsym() can't check
if the signature is actually the one we expect.

As a bonus, it helps when using -Wmissing-prototypes as it provides the
prototypes.

---

All of GP build just fine with these changes.

The only real downside I could think of is if we wanted `plugin_configure()` and `plugin_configure_single()` not to reference the specialized GTK types as they actually are polymorphic so it would be actually valid to have e.g. a `GtkWidget *plugin_configure(GtkWidget *dialog)` prototype. However, I don't see why anyone would really want to do that, and we never advertized it (although one can infer it being valid from the GTK documentation).
If we do want this, we can't provide prototypes for `plugin_configure()` and `plugin_configure_single()` as the C implicit conversion between `void*` and specialized pointers doesn't work in protoypes.

Another (harmless) effect of these changes is that `-Wredundant-decls` will report duplicate prototypes for plugins that already define the prototypes (probably only to avoid the `-Wmissing-prototypes` warning). In GP three plugins do it at least for `plugin_init()`: *GeanyCtags*, *GProject* and *PrettyPrinter*. Removing these redundant declarations is of course trivial.