<blockquote>
<p>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).</p>
</blockquote>

<p>Probably not, because <code>geany_load_module()</code> 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.</p>

<blockquote>
<p>As best I can tell its UB. […]</p>
</blockquote>

<p>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 <code>noexcept</code>, 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.</p>

<p>An alternative solution could be something like this:</p>

<div class="highlight highlight-source-c++"><pre>#<span class="pl-k">ifdef</span> __cplusplus <span class="pl-c">/* >= 2011 */</span>
gboolean <span class="pl-en">geany_load_module</span>(GeanyPlugin *plugin) <span class="pl-k">noexcept</span>;
#<span class="pl-k">else</span>
gboolean <span class="pl-en">geany_load_module</span>(GeanyPlugin *plugin);
#<span class="pl-k">endif</span></pre></div>

<p>So authors of C++ plugins are forced to consider the issue.  But that breaks C++ API.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1215#issuecomment-244953219">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ7_2eKuTYk2OaYZ0xlhP4qsvpUXPks5qnW1mgaJpZM4J1bF3">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ9AxCVIJ881o3d3Cj6yCygEgOYV-ks5qnW1mgaJpZM4J1bF3.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/1215#issuecomment-244953219"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@b4n in #1215: \u003e 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).\r\n\r\nProbably 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.\r\n\r\n\u003e As best I can tell its UB. […]\r\n\r\nYeah 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.\r\n\r\nAn alternative solution could be something like this:\r\n```C++\r\n#ifdef __cplusplus /* \u003e= 2011 */\r\ngboolean geany_load_module(GeanyPlugin *plugin) noexcept;\r\n#else\r\ngboolean geany_load_module(GeanyPlugin *plugin);\r\n#endif\r\n```\r\nSo authors of C++ plugins are forced to consider the issue.  But that breaks C++ API."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1215#issuecomment-244953219"}}}</script>