This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]