This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __attribute__((cleanup(function)) versus try/finally
- From: Richard Henderson <rth at redhat dot com>
- To: Ranjit Mathew <rmathew at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 8 May 2003 14:18:57 -0700
- Subject: Re: __attribute__((cleanup(function)) versus try/finally
- References: <BAY1-F33lGJZNuIkdg000004bca@hotmail.com>
On Thu, May 08, 2003 at 01:19:23PM +0530, Ranjit Mathew wrote:
> The __finally block is executed in case of both "normal" C++ exceptions
> as well as "faults" such as accessing a NULL pointer, dividing by zero,
> etc.
And your point is... ? Libjava does this for dwarf2 EH on Linux.
> Of course this would tie in with integrating SEH support into GCC,
> a brave attempt at which can be found at:
>
> http://reactos.wox.org/index.php?page=gccseh
>
> in which case my point becomes moot.
Exactly.
Incidentally, I would be willing to review and incorporate pieces
of this into gcc.
I can't promise anything about "__except" or "__leave" (indeed, I
suspect that they _won't_ be incorporated), but we can at least talk
about including SEH for general exception handling. At minimum you'd
be able to use catch(...) instead of "__except" in C++.
> Does anyone know why "fsjlj-exceptions" support was
> dropped and made a configure time option?
The runtime libraries can't handle both at once.
> SEH is an SJLJ type scheme:
>
> http://www.microsoft.com/msj/0197/Exception/Exception.aspx
That's too bad. Not *horrible* given that x86 only has
3 call-saved registers, but...
r~