Opened 14 years ago

Closed 13 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:

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

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

Download all attachments as: .zip

Change History (5)

comment:1 by Vladimir Prus, 14 years ago

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 by brbarret@…, 14 years ago

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 by Vladimir Prus, 14 years ago

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 by Vladimir Prus, 13 years ago

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.