This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [basic-improvements] try/finally support for c/c++ - more tests
On 08-Nov-2002, Jakub Jelinek <jakub@redhat.com> wrote:
> On Fri, Nov 08, 2002 at 12:48:49PM +0000, Nicola Pero wrote:
> > The suggestion that this change is good because "it makes C look more like
> > C++ so that it's easier to integrate C and C++" might be good for C++
> > hackers and lovers, but it's definitely unconvincing for C/ObjC users with
> > no interest in C++.
>
> If you look at a typical system nowadays, C and C++ has to easily integrate
> together, as C++ code often calls C routines (starting from libstdc++ using
> C library functions where C library is most often written in C) and a lot of
> C programs/libraries are using C++ libraries too.
C++ calling C is very common, but C calling C++ is a lot less so.
Furthermore, for C calling C++ you need some `extern "C"' glue code
anyway, and this glue code can catch C++ exceptions and convert them to
something suitable for C.
> > Actually, the proposed feature would actually not work with the existing
> > setjmp/longjmp based exception handling ... either you use the new feature
> > (which is not enough powerful to provide exception handling), or you use
> > setjmp/longjmp.
>
> But it plays nicely with setjmp/longjmp_unwind.
That's all very well, but we don't have setjmp_unwind/longjmp_wind yet!
Also, these routines might be slower than setjmp/longjmp.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.