Modify

Ticket #2096 (closed Bugs: fixed)

Opened 6 years ago

Last modified 5 years ago

program_options fails to compile with -fno-exceptions

Reported by: brbarret@… Owned by: vladimir_prus
Milestone: Boost 1.36.0 Component: program_options
Version: Boost 1.35.0 Severity: Problem
Keywords: Cc:

Description

The program_options 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_program_options_no_exceptions.diff Download (4.1 KB) - added by anonymous 6 years ago.

Change History

Changed 6 years ago by anonymous

comment:1 Changed 6 years ago by vladimir_prus

With BOOST_NO_EXCEPTION, you're supposed to provide your own definition of throw_exception. Can you tell what that definition will do? Whereas aborting if an error happens during option parsing seems possible, I'm not sure what you might do on an error during getting an option.

comment:2 Changed 6 years ago by brbarret@…

Yeah, that's a really good question. To be honest, I don't plan on using program_options in my application.

It is used somewhere in the default build of boost 1.35.0 (I have a hard time telling what exactly is being compiled when using bjam and didn't keep good notes on the subject, so I'm not sure whether it was in one of the libraries or the test cases. I'd assume the test cases, given what program_options does). The patch was mainly doing enough so that make all install would succeed when -fno-exceptions is used.

comment:3 Changed 6 years ago by vladimir_prus

Hmm, if you don't have first-hand experience that program_options is remotely useful with -fno-exceptions, then I suggest you just add "--without-program_options" to bjam, and skip the build.

comment:4 Changed 5 years ago by vladimir_prus

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

(In [53723]) Make program_options compile with disabled exceptions.

It appears the all throw statements are during the parsing, so alternative error reporting strategies are possible. Closes #2096.

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.