This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Using EH from C revisited
- From: Stelios Xanthakis <sxanth at ceid dot upatras dot gr>
- To: Giovanni Bajo <giovannibajo at libero dot it>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 11 May 2004 11:43:28 +0300 (EET DST)
- Subject: Re: Using EH from C revisited
On Mon, 10 May 2004, Giovanni Bajo wrote:
>
> BTW, wouldn't it be better to be able to specify the attribute on the *type*
> rather than on the variable *declaration*?
>
The only better thing I can see is less typing (which a code
generator doesn't mind). But then we would have the attribute
always enabled, even for functions that may not be longjmped.
I think the current way comes straight out of gcc's internals
and that's why it's good.
I would really like to see a __builtin_longjmp_unwind GNUC
extension in the future. With the current schema if we want
to raise and catch exceptions from C we have to use setjmp/
longjmp anyway. Since a setjmp() is installed and we don't
avoid its overhead we might as well have the longjmp_unwind
which will call all the cleanups up to the context point and
then do the longjmp. The way to raise exceptions at the moment
is totally unportable and hard to maintain (an undocumented hack).
Stelios