Opened 9 years ago

Closed 8 years ago

#2096 closed Bugs (fixed)

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:


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 (1)

boost_program_options_no_exceptions.diff (4.1 KB) - added by anonymous 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by anonymous

comment:1 Changed 9 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 9 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 9 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 8 years ago by vladimir_prus

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

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

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain vladimir_prus.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.