Boost C++ Libraries: Ticket #9236: Catch programmer errors with asserts, not exceptions https://svn.boost.org/trac10/ticket/9236 <p> e.g. "powm requires a positive exponent." </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9236 Trac 1.4.3 John Maddock Fri, 11 Oct 2013 17:33:50 GMT <link>https://svn.boost.org/trac10/ticket/9236#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9236#comment:1</guid> <description> <p> I believe this to be a true runtime error which should be checked and reported via an exception. Note that if you pass an unsigned integer as the exponent then the check is omitted, and in any case the cost of the check likely to be insignificant compared to the rest of the code. </p> <p> There are however some inconsistencies in the way these checks are applied, which I'll fix shortly. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sat, 12 Oct 2013 08:19:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9236#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9236#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/86258" title="Optimize copying of allocator-free cpp_int's via memcpy. Fix ...">[86258]</a>) Optimize copying of allocator-free cpp_int's via memcpy. Fix consistency of checks for exponents &lt; 0 in powm. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9231" title="#9231: Bugs: Suboptimal assignment (closed: fixed)">#9231</a>. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9236" title="#9236: Bugs: Catch programmer errors with asserts, not exceptions (closed: wontfix)">#9236</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sat, 12 Oct 2013 08:20:10 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9236#comment:3 https://svn.boost.org/trac10/ticket/9236#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> Ticket Domagoj Šarić Sat, 12 Oct 2013 11:26:48 GMT <link>https://svn.boost.org/trac10/ticket/9236#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9236#comment:4</guid> <description> <ul><li>I wrote all those tickets in a bit of a hurry so I didn't check whether that one source code line I pasted is actually the one I ran into when stepping through your code </li><li>regardless, aren't exceptions for exceptional cases outside of a programmer's direct influence (network, filesystem, memory allocation,...)? IOW isn't an invalid input to a function a programmer error? </li><li>apply other comments on EH from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9234" title="#9234: Bugs: noexcept creation of a number from string (closed: wontfix)">#9234</a>... </li></ul> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sat, 12 Oct 2013 12:11:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9236#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9236#comment:5</guid> <description> <p> It's not a programmer error if the arguments come from user input (for example). </p> </description> <category>Ticket</category> </item> </channel> </rss>