This is the mail archive of the gcc-patches@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: [basic-improvements] try/finally support for c/c++ - more tests


Standards fixate existing practice, they don't establish it.
We've already got a standard that's relevant here.   In particular,
we have the C++ programming language, which provides the functionality
needed.  If you need that functionality, use that language, or another
language (like Java, Ada, etc.) that provides that functionality.

Now, I'm not fully understanding how this is going to be used, which
is perhaps coloring my thinking.  I'm getting the impression that this
functionality is going to get buried in C headers that are going to
get seen in *user* C code.  Is that true?

If it is true, it makes my above remark irrelevant; we need something
that works in C.  The question, of course, is *what* do we need.

Let me try to see if I've got right what it is we're trying to
accomplish.  If I don't have it right, I'll not be intelligent in the
discussion, so please correct me.

We're trying to implement one particular piece of functionality required
by the POSIX threads interface; namely "pthread_cleanup_push" and friends.
(I know that any feature might get used more widely, but this is the
motivation, as I understand it.)  Furthermore, we're trying to make the
POSIX threads cleanups play nice with exception-handling.  Or are we
trying to use EH mechanisms to make things go faster?

Anyhow, if I write:

 try { pthread_cleanup_push (...);
       throw 3; }
 catch (...) { }

and the system arranges to run the cleanup when the exception is thrown,
the system is badly broken.

So, I think I'm not getting the point.

What interface is it that we think we need this functionality to
implement?

--
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com


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