Modify

Ticket #2094 (closed Bugs: fixed)

Opened 6 years ago

Last modified 4 years ago

iostreams fails to compile with -fno-exceptions

Reported by: brbarret@… Owned by: 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

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

Change History

Changed 6 years ago by anonymous

Changed 4 years ago by Richard Smith <richard@…>

Updated patch

comment:1 Changed 4 years ago by Richard Smith <richard@…>

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>.

Changed 4 years ago by Richard Smith <richard@…>

comment:2 Changed 4 years ago by danieljames

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

Still some throws left when rethrowing caught exceptions.

Thanks to Richard Smith.

comment:3 Changed 4 years ago by danieljames

  • Status changed from new to closed
  • Resolution set to fixed

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

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

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.