[Github-comments] [geany/geany] Plugins: Needless forward declaration of geany_load_module() (#1215)

Colomban Wendling notifications at xxxxx
Tue Sep 6 13:40:54 UTC 2016


> I was thinking a proxy written in C++ could cause Geany to call it on a subplugin? (but I don't know the details of proxy and geany interaction).

Probably not, because `geany_load_module()` is the builtin Geany API, a proxy plugin is likely to have it own, and even then, only one place should call that function inside plugins.

> As best I can tell its UB. […]

Yeah I'd imagine.  Though, I'm wondering what's worse: not checking signature at all, or requiring authors of C++ plugins to carefully not throw any exception (from inside a function that is highly unlikely to contain much C++ code)?  If really the author meant to add `noexcept`, she must then be aware of the problem and properly handle exceptions anyway, as IIUC all this is merely a runtime check that leads to program abortion.

An alternative solution could be something like this:
```C++
#ifdef __cplusplus /* >= 2011 */
gboolean geany_load_module(GeanyPlugin *plugin) noexcept;
#else
gboolean geany_load_module(GeanyPlugin *plugin);
#endif
```
So authors of C++ plugins are forced to consider the issue.  But that breaks C++ API.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/1215#issuecomment-244953219
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160906/d2dc0bf4/attachment.html>


More information about the Github-comments mailing list