Opened 14 years ago

Closed 13 years ago

Last modified 12 years ago

#2094 closed Bugs (fixed)

iostreams fails to compile with -fno-exceptions

Reported by: brbarret@… Owned by: Jonathan Turkanis
Milestone: Boost 1.36.0 Component: iostreams
Version: Boost 1.35.0 Severity: Problem
Keywords: Cc:

Description

The iostreams component fails to compile with GCC when -fno-exceptions is specified. The attached patch allows the libraries / tests shipped with boost 1.35.0 to compile.

Attachments (3)

boost_iostreams_no_exceptions.diff (6.9 KB ) - added by anonymous 14 years ago.
boost_iostreams_no_throw.diff (33.8 KB ) - added by Richard Smith <richard@…> 13 years ago.
Updated patch
boost_iostreams_no_throw.patch (33.7 KB ) - added by Richard Smith <richard@…> 13 years ago.

Download all attachments as: .zip

Change History (6)

by anonymous, 14 years ago

by Richard Smith <richard@…>, 13 years ago

Updated patch

comment:1 by Richard Smith <richard@…>, 13 years ago

I'm not actually sure how important -fno-exception support is these days. However, assuming this is still desirable (and in any case, it imposes very little overhead compared to the overhead of throwing an exception) the boost_iostreams_no_throw.diff patch replaces all instances of throw foo(); with boost::throw_exception(foo());.

This is *not* sufficient for a clean -fno-exception compile with modern gcc -- we would also need to remove all throw; statements (for rethrowing) and try/catch blocks, although there are very few of them. This patch does not do anything with them.

This patch needs applying after the patch on <https://svn.boost.org/trac/boost/ticket/3612>.

by Richard Smith <richard@…>, 13 years ago

comment:2 by Daniel James, 13 years ago

(In [57604]) Use boost::throw_exception. Refs #2094.

Still some throws left when rethrowing caught exceptions.

Thanks to Richard Smith.

comment:3 by Daniel James, 13 years ago

Resolution: fixed
Status: newclosed

(In [58633]) Merge iostream fixes, mostly by Richard Smith.

Fixes #3612, #3311, #2094, #3010, #2894, #3011, #3352, #3505.

Note: See TracTickets for help on using tickets.