3 ms·
It's a very common C error-handling pattern, essentially emulating RAII with forwards-only function-local goto statements. It's possible to do without, but that
by masklinn 11y ago
It's a very common C error-handling pattern, essentially emulating RAII with forwards-only function-local goto statements. It's possible to do without, but that tends to yield much more deeply nested code (especially if it's complex) and possibly some amount of duplication.
See http://eli.thegreenplace.net/2009/04/27/using-goto-for-error-handling-in-c http://eli.thegreenplace.net/2009/04/27/using-goto-for-error... for a short rundown, or http://blog.regehr.org/archives/894 http://blog.regehr.org/archives/894 where regehr — who works specifically in correctness and verifiability — states:
> many people, including me, prefer the goto version