This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Exceptions, C, and Gcc
- From: Kevin Atkinson <kevin at atkinson dot dhs dot org>
- To: gcc at gnu dot org
- Date: Fri, 07 Mar 2003 21:00:05 -0500 (EST)
- Subject: Exceptions, C, and Gcc
I am sure this has come up before but I am having a hard time finding any
information on this matter.
I have 2 questions:
1) Is it or will it ever be safe to throw exceptions when a C function
calls a C++ via a callback. Especially when use of a longjmp would be
safe. (Ie the program will remain in a consistent state even if the
handler functions does not return). Since C does not have destructors I
can't think of anything that needs to be done other than popping the stack.
2) Are exceptions fast and stable enough to use in Gcc 3.1+. I once used
exceptions with Gcc (egcs 1.1 and Gcc 2.95) and stopped due to buggy
implementations. I had reports that in some cases exceptions were not
being caught at all. In particular are exceptions _faster_ than
traditional error handling of checking return type for every function
called that can have an error.
--
http://kevin.atkinson.dhs.org