This is the mail archive of the
mailing list for the GCC project.
Re: [3.3] Followup to C++ forced unwinding
- From: Ulrich Drepper <drepper at redhat dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Jason Merrill <jason at redhat dot com>, Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org, ncm at cantrip dot org
- Date: Wed, 30 Apr 2003 17:39:42 -0700
- Subject: Re: [3.3] Followup to C++ forced unwinding
- Organization: Red Hat, Inc.
- References: <20030430175335.GA18958@twiddle.net> <email@example.com> <20030430210342.GB697@redhat.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org>
-----BEGIN PGP SIGNED MESSAGE-----
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
> And all "undefined behavior" means is that we can choose what it does,
> 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)
-----END PGP SIGNATURE-----