setjump and longjump

Discussion in 'C Programming' started by pal, Dec 27, 2007.

  1. pal

    pal Guest

    hi all,


    Can anybody explain about setjump and longjump functions if u have
    time to spend on this.

    Thanks,
    pal
     
    pal, Dec 27, 2007
    #1
    1. Advertising

  2. "pal" <> wrote in message
    news:...
    > hi all,
    >
    >
    > Can anybody explain about setjump and longjump functions if u have
    > time to spend on this.


    it is "setjmp" and "longjmp". they provide (among others) a method to do a
    non-local goto (goto across functions). any good
    C textbook can provide with an example.
     
    Ravishankar S, Dec 27, 2007
    #2
    1. Advertising

  3. pal

    Guest

    On Dec 26, 10:51 pm, pal <> wrote:
    > hi all,
    >
    > Can anybody explain about setjump and longjump functions if u have
    > time to spend on this.
    >
    > Thanks,
    > pal


    setjmp and longjmp are very old and are a primitive a form of
    exception handling (conceptually). They definitely should not be used
    in new code.
     
    , Dec 28, 2007
    #3
  4. wrote:
    > On Dec 26, 10:51 pm, pal <> wrote:
    >>
    >> Can anybody explain about setjump and longjump functions if u have
    >> time to spend on this.

    >
    > setjmp and longjmp are very old and are a primitive a form of
    > exception handling (conceptually). They definitely should not be used
    > in new code.


    Why not?
     
    J. J. Farrell, Dec 28, 2007
    #4
  5. pal

    Eric Sosman Guest

    wrote:
    > On Dec 26, 10:51 pm, pal <> wrote:
    >> hi all,
    >>
    >> Can anybody explain about setjump and longjump functions if u have
    >> time to spend on this.

    >
    > setjmp and longjmp are very old and are a primitive a form of
    > exception handling (conceptually). They definitely should not be used
    > in new code.


    They should definitely not be used in most code, but when
    they're needed in code new or old, they're the only mechanism
    available for the task.

    Are you, perhaps, thinking of That Other Language?

    --
    Eric Sosman
    lid
     
    Eric Sosman, Dec 28, 2007
    #5
  6. J. J. Farrell said:

    > wrote:
    >> On Dec 26, 10:51 pm, pal <> wrote:
    >>>
    >>> Can anybody explain about setjump and longjump functions if u have
    >>> time to spend on this.

    >>
    >> setjmp and longjmp are very old and are a primitive a form of
    >> exception handling (conceptually). They definitely should not be used
    >> in new code.

    >
    > Why not?


    For the same reason that they shouldn't be used in old code. They suck. :)


    --
    Richard Heathfield <http://www.cpax.org.uk>
    Email: -http://www. +rjh@
    Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    "Usenet is a strange place" - dmr 29 July 1999
     
    Richard Heathfield, Dec 28, 2007
    #6
  7. pal

    Guest

    On Dec 28, 2:22 pm, "J. J. Farrell" <> wrote:
    > wrote:
    > > On Dec 26, 10:51 pm, pal <> wrote:

    >
    > >> Can anybody explain about setjump and longjump functions if u have
    > >> time to spend on this.

    >
    > > setjmp and longjmp are very old and are a primitive a form of
    > > exception handling (conceptually). They definitely should not be used
    > > in new code.

    >
    > Why not?


    I should qualify that answer with "unless you have no other choice."
    They are simply one of the the biggest hacks ever made. Understanding
    the problem might allow suggestions for better solutions.
     
    , Dec 29, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nut Cracker
    Replies:
    1
    Views:
    360
  2. Eric

    longjump

    Eric, Nov 27, 2003, in forum: C Programming
    Replies:
    14
    Views:
    747
    Irrwahn Grausewitz
    Nov 28, 2003
  3. lallous

    what is setjump() ?

    lallous, Jan 19, 2004, in forum: C Programming
    Replies:
    4
    Views:
    496
    Dik T. Winter
    Jan 20, 2004
  4. titi

    if and and vs if and,and

    titi, Mar 9, 2007, in forum: VHDL
    Replies:
    4
    Views:
    624
    Mike Treseler
    Mar 11, 2007
  5. Anders Koeln

    setjump problem

    Anders Koeln, Nov 17, 2010, in forum: C Programming
    Replies:
    3
    Views:
    347
    Ben Pfaff
    Nov 18, 2010
Loading...

Share This Page