News for hackers. Stuff that matters.
Re:Banned C standard library functions in Git source code by begriffs on Sunday August 25, 2019 @04:51PM (#20795490)
> you can jump anywhere, not limited to the same function

Outside of the current function, yes. Anywhere, no.

Longjmp allows you to return to places you’ve already been and have saved with setjmp. Also attempting to longjmp to a function that has since returned is undefined behavior. Thus longjmp’s usual use case is like exceptions in other languages, going back up the call chain, skipping intermediate functions.

There are no comments on this comment yet.