Re: error handlling in recursive function



On May 30, 12:27 pm, rober...@xxxxxxxxxxxxxxxxxx (Walter Roberson)
wrote:
In article <19b77d08-9400-4bcc-b5ef-112545eda...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,

user923005 <dcor...@xxxxxxxxx> wrote:
On May 30, 10:17=A0am, David Resnick <lndresn...@xxxxxxxxx> wrote:
Sure, and a fourth is to pass down a pointer to a variable to use for
error reporting.
Yet another one is to use signal()/raise().

If the routine so invoked does not terminate with longjump
(and longjump was already proffered earlier in the list) then
when the routine returns, execution will resume with the return
of raise() (which will have a value of 0 if successful, non-zero
otherwise.)

signal()/raise() does have the advantage that the invoked routine
is able to access library functions,

I don't get what you mean when you say "signal()/raise() does have the
advantage that the invoked routine is able to access library
functions, "

Can you give an example of this?

Chad
.



Relevant Pages

  • Re: error handlling in recursive function
    ... If the routine so invoked does not terminate with longjump ... is able to access library functions, and is able to access static storage ... global pointer to a subroutine that gets called when raise() is used... ...
    (comp.lang.c)
  • Re: Should pthread_exit() be used in main()?
    ... makes sense to cause the current thread to terminate other than by returning from the start routine, ... Specifically; in the example you cite, the pthread_exitcall from PrintHello(), which is the thread start routine, is redundant; it could just as easily have simply returned with the value NULL. ... That is, even if your function doesn't return a value (and you have a compiler that doesn't mind, or you've deliberately used the wrong function prototype and either cast the function pointer on pthread_create or, again, the compiler doesn't mind the mismatch), the pthread library will interpret the appropriate location as a return value, and store that to be queried by pthread_join. ...
    (comp.programming.threads)
  • Re: Should pthread_exit() be used in main()?
    ... sense to cause the current thread to terminate other than by returning from the start routine, ... Specifically; in the example you cite, the pthread_exitcall from PrintHello(), which is the thread start routine, is redundant; it could just as easily have simply returned with the value NULL. ... This performs the same job with less overhead. ...
    (comp.programming.threads)
  • RE: Use of FORCE
    ... routine would normally just wait for the attached program to terminate. ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Re: Continue after error & Application.ThreadException
    ... >I have a DLL I created to handle all unknown errors using the ... >terminate the program or continue. ... >keeps running but the routine that generated the error exited. ...
    (microsoft.public.dotnet.languages.vb)