__attribute__((cleanup(function)) versus try/finally
Ranjit Mathew
rmathew@hotmail.com
Fri May 9 09:23:00 GMT 2003
> > 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.
Yes, I know (http://gcc.gnu.org/java/port-signals.html).
The Windows port of GCJ also has a similar hack using SEH Win32 APIs.
However,
unlike signal handlers on Linux, Windows actually expects the
"UnexpectedExceptionHandler" routine to *return* with a value to it - since
the current implementation doesn't, a simple thing like two Java
NullPointerExceptions results in a hung process on Win2K!
So if we manage to make it work reliably, we can then claim identical
semantics indeed. Touche.
>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++.
This is good news for all MinGW users, thank you! Casper Hornstrup
(chorns at users dot sourceforge dot net) of the ReactOS team, who
has created the SEH enabled GCC mentioned earlier, would be delighted
to hear this I think.
Ranjit.
_________________________________________________________________
Dreaming of a holiday? Make it happen.
http://server1.msn.co.in/sp03/switzerlandtourism/index.asp In Switzerland!
More information about the Gcc
mailing list