News for hackers. Stuff that matters.
Re:LLVM Programmer’s Manual by cyphar on Friday July 22, 2016 @03:40AM (#12142254)
Except gotos are legitimately useful for cleanup inside a function before you return an error (see: the Linux kernel). Exceptions have overhead, and you have no idea where it will end up because the exception will bubble up the current call-stack, while gotos are local to the current function (and while longjmp is a mess, it is useful if you use clone(2)).
Re:LLVM Programmer’s Manual by vvanders on Friday July 22, 2016 @10:23AM (#12143667)
You should be using RAII for any resources that you need to automatically clean up, then any return statement will catch it. No need for exceptions.
Re:LLVM Programmer’s Manual by cyphar on Friday July 22, 2016 @01:47PM (#12145268)
RAII is not a feature of C. I was commenting on how gotos are not like exceptions, because gotos are actually useful and don't cause your program to make less sense as a result.