Re:Ask HN: Why does Linux Kernel use goto statements?
by AnimalMuppet on Wednesday December 08, 2021 @03:48PM
(#29490283)
Note, however, that if you have multiple different cleanup-and-exit points, it can be a maintenance issue. (On the other hand, the non-goto version can also be a maintenance issue...)
1. escape nested loops easily
2. error handling; since c does it in somehow messy way, you can end up with multiple variations of: where by using goto you can put those handlers as in a footnote of a function like as it looks a bit neatersome languages like Zig for example have keyword defer, this to my understanding implements an alternative to this approach