Afficher un message
Vieux 09/06/2008, 21h47   #6
Ian Collins
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Throwing exceptions in a unix signal handler. Good idea?

thagor2008@googlemail.com wrote:
> On Jun 9, 4:26 pm, Pete Becker <p...@versatilecoding.com> wrote:
>> From the C99 standard: "If the signal occurs other than as the result

>
> That C, not C++.
>
>> So, unless the signal came from a call to abort or raise, the behavior
>> is undefined.

>
> It may be undefined from the point of view of the C standard , but not
> from the unix standard otherwise there'd be no point using signals -
> every time a handler was called you'd have to hold your breath and
> hope the program didn't crash!
>

It is also undefined in the C++ standard, which refers to the C standard.

> I'm only interested in the specific combination of C++ exceptions and
> signal handlers since once stores the stack and one forces an unwind.
> Are compilers smart enough to know to pop the signal handler stack
> first and return to where the signal occured before unwinding the
> stack for the exception is the question.
>

Only a platform specific group could answer that. There isn't a
portable standard C++ answer (other than "it's undefined").


--
Ian Collins.
  Réponse avec citation
 
Page generated in 0,05027 seconds with 9 queries