 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
chenchang Guest
|
Posted: Tue Apr 20, 2004 5:42 pm Post subject: about exception of standard |
|
|
In 15.5.1.2:
"In such cases (Described in 15.5.1.1),
void terminate();
is called(18.6.3). In the situation where no matching handler is found, it
is implementation-defined whether or not the stack is unwound before
terminate() is called." ----- why?
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
Ben Hutchings Guest
|
Posted: Thu Apr 22, 2004 5:26 pm Post subject: Re: about exception of standard |
|
|
"chenchang" wrote:
| Quote: | In 15.5.1.2:
"In such cases (Described in 15.5.1.1),
void terminate();
is called(18.6.3). In the situation where no matching handler is found, it
is implementation-defined whether or not the stack is unwound before
terminate() is called." ----- why?
|
An unhandled exception indicates a bug, so it is useful to get a dump
of the program state at the point at which the unhandled exception is
thrown. So some implementations call terminate() immediately, which
will typically generate such a dump.
However, simple exception-handling implementations based on setjmp and
longjmp cannot search for a matching handler without unwinding as they
go, so by the time such an implementation determines that an exception
will not be handled it has already unwound the stack.
The standard committee chose not to disallow either of these
implementation techniques.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|