This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [3.3] Followup to C++ forced unwinding


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark Mitchell wrote:

> This whole idea -- that we unwind the stack running code when a thread
> is cancelled -- is outside POSIX.

You miss the point.  Doing something outside POSIX is one thing.
Requesting something which isn't possible is the other.  It's not just
not defined behavior that cancellations cannot be interrupted, it's
impossible in the implementations.  That's the point.  Bogus
requirements from the C++ integration cannot overwrite restrictions the
implementations have.


> And all "undefined behavior" means is that we can choose what it does,

No.


> If it is really true that we cannot enter "catch(...)" blocks for some
> reason (which I do not yet believe, despite Ulrich's usual inimitable
> expression of confidence), then running into a "catch(...)" block while
> unwinding should result in a call to std::terminate.

I never said that catch blocks cannot be entered.  I only said that the
result must be a rethrow.


> I'm not sure why this would be a bug -- it's not even undefined
> behavior.  But, if it is a bug, then a "catch(...)" that doesn't rethrow
> would be the same bug.  There's no harm in providing the user a
> C++-specific way to make the same mistake.

You have the same problem as Nathan.

In C a programmers has to explicitly add code to violate the rules and
it is a burden.

If rethrows are not done automatically the ommission of one piece of
code which is not required leads to desaster.


> There's nothing that says that a destructor must return, or cannot
> contain arbitrary code.

Of course they cannot contain arbitrary code.  You're not allowed to
call longjmp(9 etc in destructors.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+sGzO2ijCOnn/RHQRAg6cAJ9BajYha9I9GXHv8wwmGi7z7JJsrQCeIP3I
NXLzgViD5Fmrl1B6JeIRRS8=
=D2PJ
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]