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

<p>Its sadly easy to allow exceptions, they are slippery little things:</p>

<div class="highlight highlight-source-c++"><pre><span class="pl-k">int</span> <span class="pl-en">f</span>() try {
    the code;
} <span class="pl-k">catch</span>(...){
    now I must <span class="pl-k">not</span> allow anything to <span class="pl-k">throw</span> here;
    careful of IO, constructing objects, operators;
    sheesh, <span class="pl-k">not</span> much you CAN <span class="pl-k">do</span>;
    better just terminate, <span class="pl-k">or</span> <span class="pl-k">return</span> -<span class="pl-c1">1</span>;
}</pre></div>

<p>The nice thing about the <code>noexcept</code> is it can catch exceptions from the <code>catch</code> clause too, so it would be good if it could be used.  </p>

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

<p>Though I wouldn't expect too many C++ plugins for the new API, yet, now is the best chance.</p>

<blockquote>
<p>Though, I still wonder how this can change the ABI, especially in C linkage where there can't be no name mangling anyway.</p>
</blockquote>

<p>I wouldn't think it would change the ABI, I would have expected the stack frame to have a flag saying this function is <code>noexcept</code> so the unwinder can see it and terminate.  So its internal to the function.  But it is implementation dependent, so who knows.</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-244962916">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ4ZinV9AHp1SoMFiiYa7f83PAOftks5qnXUQgaJpZM4J1bF3">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ6IcP4wxoJCkf_-SPJT7t0DwqxJOks5qnXUQgaJpZM4J1bF3.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-244962916"></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":"@elextr in #1215: \u003e  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\nIts sadly easy to allow exceptions, they are slippery little things:\r\n\r\n```c++\r\nint f() try {\r\n    the code;\r\n} catch(...){\r\n    now I must not allow anything to throw here;\r\n    careful of IO, constructing objects, operators;\r\n    sheesh, not much you CAN do;\r\n    better just terminate, or return -1;\r\n}\r\n```\r\n\r\nThe nice thing about the `noexcept` is it can catch exceptions from the `catch` clause too, so it would be good if it could be used.  \r\n\r\n\u003e So authors of C++ plugins are forced to consider the issue. But that breaks C++ API.\r\n\r\nThough I wouldn't expect too many C++ plugins for the new API, yet, now is the best chance.\r\n\r\n\u003e Though, I still wonder how this can change the ABI, especially in C linkage where there can't be no name mangling anyway.\r\n\r\nI wouldn't think it would change the ABI, I would have expected the stack frame to have a flag saying this function is `noexcept` so the unwinder can see it and terminate.  So its internal to the function.  But it is implementation dependent, so who knows.\r\n"}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1215#issuecomment-244962916"}}}</script>