Boost C++ Libraries: Ticket #5731: Failure in boost/numeric/conversion when compiled without exceptions https://svn.boost.org/trac10/ticket/5731 <p> When build with gcc -fno-exceptions, the compilation fails on the following oneliner: </p> <p> #include &lt;boost/numeric/conversion/converter.hpp&gt; </p> <p> That's because naked "throw" is used in that code. I believe it should use boost::throw_exception instead. I'm attaching a patch that implements this change. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5731 Trac 1.4.3 pmachata@… Fri, 22 Jul 2011 14:34:21 GMT attachment set https://svn.boost.org/trac10/ticket/5731 https://svn.boost.org/trac10/ticket/5731 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-1.47.0-exceptions.patch</span> </li> </ul> <p> Proposed fix </p> Ticket pmachata@… Fri, 22 Jul 2011 14:36:17 GMT component changed; owner set https://svn.boost.org/trac10/ticket/5731#comment:1 https://svn.boost.org/trac10/ticket/5731#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Douglas Gregor</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">numeric</span> </li> </ul> Ticket anonymous Sun, 27 Nov 2011 09:48:27 GMT <link>https://svn.boost.org/trac10/ticket/5731#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5731#comment:2</guid> <description> <p> can somebody review this patch? the issue with kdeedu-rocs is still valid with 1.48 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Wed, 04 Jan 2012 20:34:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5731#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5731#comment:3</guid> <description> <p> I looked at this and I don't like it. </p> <p> I drags in a bunch of boost.exception stuff we're not using. This problem came up when BOOST_THROW_EXCEPTION was redefined by the authors of Boost Exception and surprised a lot of us with bloat code and other problems. </p> <p> Think about this some more. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <author>Petr Machata <pmachata@…></author> <pubDate>Mon, 23 Jan 2012 14:20:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5731#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5731#comment:4</guid> <description> <p> An exception is being thrown in header file. There's an existing tool for that in boost, boost::throw_exception. Many other (boost) libraries do it like that (though admittedly not all). It's a correctness issue, too, that code is invalid when compiled with -fno-exceptions. I don't think boost should support every odd compiler flag out there, but it seems that support for this one is well established. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Sat, 11 Feb 2012 08:48:45 GMT</pubDate> <title>version changed; cc set https://svn.boost.org/trac10/ticket/5731#comment:5 https://svn.boost.org/trac10/ticket/5731#comment:5 <ul> <li><strong>cc</strong> <span class="trac-author">antoshkka@…</span> added </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.47.0</span> → <span class="trac-field-new">Boost 1.50.0</span> </li> </ul> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5731#comment:3" title="Comment 3">ramey</a>: </p> <blockquote class="citation"> <p> I looked at this and I don't like it. </p> <p> I drags in a bunch of boost.exception stuff we're not using. This problem came up when BOOST_THROW_EXCEPTION was redefined by the authors of Boost Exception and surprised a lot of us with bloat code and other problems. </p> </blockquote> <p> There is a patch for BOOST_THROW_EXCEPTION that reduces code bloat <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6450" title="#6450: Patches: Patch to allow user to specify current filename macro (closed: fixed)">#6450</a> <br /> Support for noexception build is really required, because such builds are widely used on embedded platforms and are part of C++ corporate style in some organizations.<br /> <br /> I would advise to use <code>BOOST_THROW_EXCEPTION</code> instead of <code>boost::throw_exception</code>, because it gives better control to user, better debugging abilities and is meant to be used in all libraries.<br /> <br /> This is a very popular bug and a lot of users want it fixed! It is duplicated in tickets <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5076" title="#5076: Bugs: numeric/conversion/converter_policies.hpp won't build with gcc ... (closed: fixed)">#5076</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5393" title="#5393: Bugs: cast.hpp does not compile with exceptions off (closed: fixed)">#5393</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5800" title="#5800: Bugs: lexical_cast doesn't compile without exceptions (closed: fixed)">#5800</a>.<br /> </p> <p> Please, fix it till 1.50 release or allow me to fix it (it is a trivial bug). </p> Ticket Antony Polukhin Mon, 05 Mar 2012 17:11:23 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5731#comment:6 https://svn.boost.org/trac10/ticket/5731#comment:6 <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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/77234" title="Fixes #5731, fixes #5076, fixes #5393, fixes #5800 Now numeric_cast ...">[77234]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5731" title="#5731: Bugs: Failure in boost/numeric/conversion when compiled without exceptions (closed: fixed)">#5731</a>, fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5076" title="#5076: Bugs: numeric/conversion/converter_policies.hpp won't build with gcc ... (closed: fixed)">#5076</a>, fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5393" title="#5393: Bugs: cast.hpp does not compile with exceptions off (closed: fixed)">#5393</a>, fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5800" title="#5800: Bugs: lexical_cast doesn't compile without exceptions (closed: fixed)">#5800</a> Now numeric_cast (and lexical_cast) can be compiled with disabled exceptions </p> Ticket