|
Boost Users : |
Subject: Re: [Boost-users] Disabling Exception Handling
From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2009-04-14 12:40:37
Dykstra, Martin wrote:
> Hi.
>
>
>
> Is there a way to disable the exception handling in the Boost
> libraries? Our project requires that we disable exceptions by using the
> -no-exceptions parameter when building (via gcc). Is this also a valid
> parameter to use when building the Boost libraries?
I don't exactly know but I'd put good money on "no". Once you disable
exceptions you've not only disabled a very important language facility
but are also no longer working with standard C++. Not even the standard
library can follow the standard at that point since many of the
functions are spec'ed to throw exceptions. As far as I know there's no
portable way of dealing with the situation. MSVC simply won't compile
anything you've linked to the standard lib if you attempt disabling
exceptions.
I used to have to live under the same silly coding standard. Eventually
I was able to convince the rest of the team, except the one guy who had
the power to make such decisions, that we were being really silly. We
*were* linking to the standard library so any supposed benefit of not
using exceptions was lost (and I don't buy the supposed benefits
either). Eventually that guy quit; best thing to ever happen to us
actually.
But then, he had a big issue with third party libs too so using boost
was even out of the question at the time.
My advice would be to try your best to convince your team leader that
compiling with that switch is possibly not the best idea in the world.
If you can't convince them, maybe you can outlast them and eventually
make positive changes for your employer.
You could also simply try to compile boost without exceptions. I
seriously don't think it will work but I could be wrong.
Good luck.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net