Use of setjmp()/longjmp() in code is typically a sign of laziness - and translates to "We didn't bother writing proper error handling". It's like using abort() but even worse. longjmp() out of the blue breaks the control flow of the application and easily leads to all kinds of resource leaks and state inconsistencies. The legitimate use cases for setjmp()/longjmp() are few and far between.#C #programming

you are viewing a single comment's thread
view the rest of the comments

@harrysintonen back in the late 1990s I built a set of macros to get "exceptions" in C using setjmp/longjmp. In my defense I was young and inexperienced and this was never in a general use library.

  • source