This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] C++ vs forced unwinding
- From: Michael Matz <matz at suse dot de>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>,Richard Henderson <rth at twiddle dot net>,Mark Mitchell <mark at codesourcery dot com>,Benjamin Kosnik <bkoz at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 2 Apr 2003 13:12:44 +0200 (CEST)
- Subject: Re: [RFC] C++ vs forced unwinding
Hi,
On Tue, 1 Apr 2003, Richard Henderson wrote:
> On Tue, Apr 01, 2003 at 06:43:13PM -0500, Jason Merrill wrote:
> > Hmm. It might be reasonable to make the same judgement about a throw(int)
> > function, but I'm inclined to keep throw() as a special case.
>
> Anyone else have an opinion here?
/me not being a C++ expert, but here is mine anyway: ;)
throw() states that a function doesn't throw an exception. And it should
only say that. I can't find a reason why it also should say, that such a
function can't call cancellation points, especially because it's a rather
difficult to get right requirement. The reason is, that such cancellation
points are not part of C++, which means, that it suddenly is impossible to
write standard conforming programs, like:
int f() throw()
{
try { g(); } catch (...) {}
}
If g() calls cancellation points this perfectly fine program suddenly
doesn't work per your definition of throw().
Ciao,
Michael.