Boost logo

Boost :

From: James Talbut (James.Talbut_at_[hidden])
Date: 2008-01-09 04:32:59

I am bothered by two aspects of the handling of SEH:
1. The whole idea of handling SEH from within the proc affected is
doomed to fail in some circumstances (though only in some, so I'm not
saying it's not worth doing anything).
2. Boost libraries should not produce any warnings on any supported
compiler (or, at least, should be configurable so as to not produce any

> -----Original Message-----
> From: boost-bounces_at_[hidden]
> On Behalf Of Gennadiy Rozental
> In fact latest version of Boost.Test (see svn) doesn't use
> _set_se_translator
> for SE handling. In only used to implement "throw;" trick in case user
> requested not to catch SE.
This trick isn't required if the compiler is a recent one and /EHa is
not used (which it shouldn't ever be), so can't you get rid of it

> a) Boost.Test is not thread safe anyway at the moment
What aspects of it aren't?
I don't think the test harness should expect to have test macros used in
other threads, but it should expect that other threads exist and do
things unrelated to it.

> b) Thread-specific translator is what we would need in this case
> right?
Well, it's not possible to put any translators in place (you don't have
control of the threads) so that won't help.
You could try doing something with SetUnhandledExceptionFilter, but that
still won't always work (threads could be created in DllMain before you
get the chance to install the filter).

> a) I recommend testing debug builds
I recommend testing all builds.

> b) You can always add /EHa to your release build options. It may
> performace of your application, but this is notthe point, right?
On the contrary, it's absolutely the point.
I want to test the code that I will actually be releasing - and this is
performance sensitive code.

> Message above is only a warning. If you don't specify /EHa SE are not
> going to
> be caught anyway. The same result can be achieved by using --
> catch_system_errors=no in case if you did specify above option during
> compilation. Both cases shoudl serve your purpose.
But I want to get rid of the warning.
I wish it was possible to detect the use of /EHa from the code being
compiled (so you could only use it if it was going to do some good), but
it isn't.
Actually if I remember correctly from when I last asked the compiler
devs about it there is some horrendously hacky and version specific way
to do it, but I don't think you want to go there.


This e-mail, and any attachment, is confidential. If you have received it in error, do not use or disclose the information in any way, notify me immediately, and please delete it from your system.

Boost list run by bdawes at, gregod at, cpdaniel at, john at