3 ms·
> longjmp() and setjmp() are tricky. They’re obscure, can give rise to subtle bugs, are highly platform-specific, and, if abused, will probably lead to awfully
by zvrba 11y ago
> longjmp() and setjmp() are tricky. They’re obscure, can give rise to subtle bugs, are highly platform-specific, and, if abused, will probably lead to awfully confusing code
Actually, being part of the ISO C standard, they are not platform-specific. Otherwise, just use C++ where destructors take care of cleanup when an exception is thrown.
- amelius 11y agoPerhaps use them in production code only (where performance is critical), and use something else in debug/development mode?
- pjmlp 11y ago> Actually, being part of the ISO C standard, they are not platform-specific. The standard doesn't define the full semantics, specially what happens when a signal, trap, OS exception and similar occurs.