3 ms·
> since while goto makes it hard to follow the program flow, longjmp makes it /impossible/. Only if you don't use it tastefully. It can be a nice way to bail o
by derleth 14y ago
> since while goto makes it hard to follow the program flow, longjmp makes it /impossible/.
Only if you don't use it tastefully. It can be a nice way to bail out of a recursive function with an error code, which is precisely how I've used it. Really, it looks exactly the same as a try ... catch block in that C++/Java/C# language everyone's on about now.
- 4ad 14y agoSetjmp is great for reseting a state machine, and many things are modeled as state machine.