ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] Re: Re: boost::execution_monitor impl under windows
by Holger Grund other posts by this author
Sep 22 2003 1:13AM messages near this date
[boost] Re: boost::execution_monitor impl under windows | [boost] Re: Re: boost::execution_monitor impl under windows
[REREPOST:There should be more than just one paragraph ]

Carlos,

>  > No, I'm disabling the warning with pragmas.  The technique works fine.
> 
>  I don't think so. Well, it can fail. See Carl Daniel post on 9/21. I saw
>  the thread(s) on comp.lang.c++.moderated about the subject but nobody
>  mentioned the interaction of the *technique* with /EHs at that time.
> 
It's probably a good idea to post in the Microsoft newsgroups
for specific compiler issues.

FWIW, when David pointed me to his article (thanks again David)
I came to same the same conclusion myself (that is, that /EHa
is _not_ required for this technique).

The optimizer requires /EHa to know that it must  not elide
unwinding information. That is only important if unwinding
actually takes place.

Consider the following example
extern "C" void crash_me();
void foo(){ std::cout << "foo" << std::endl; }
struct X{~X(){ foo(); } };
void some_func()
{
 X x;
 crash_me();
}

With /EHsc the compiler assumes that crash_me does _not_ cause
a C++ exception to be thrown. Hence it can elide the unwinding
information. The generated code would conceptually be
equivalent to:

void some_func()
{
    crash_me(); foo();
}

Now if crash_me raises a structured exception and
the SE translator throws a C++ exception, unwinding
procedes from some_func. Since the unwinding information
for x has been removed, foo() will never be called in that
case.

So in general when you want unwinding do use /EHa.
But David's suggested method is just about preventing
unwinding. I do not see any problem with /EHsc
and _set_se_translator in this case (not that it matters).

-hg




_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
carlos pizano
David Abrahams
David Abrahams
Holger Grund
Holger Grund
Holger Grund
Holger Grund
David Abrahams
Carl Daniel
carlos pizano
carlos pizano
David Abrahams
carlos pizano
carlos pizano
carlos pizano
Carl Daniel
Carl Daniel
carlos pizano

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved