News for hackers. Stuff that matters.
Re:Dangerous Embedded C Coding Standard Rules (2011) by kstenerud on Monday December 30, 2013 @10:28PM (#6988762)
That's fine until you have multiple lines that goto closefile or freestring, and you mix them up at some point, or you try to refactor the code and forget to update one of your gotos. The resulting bug will wait beneath the waters until one day you get a mysterious "out of file descriptors" or "out of memory" error at some random place in your program after it's been running for awhile.

And really, the extra condition check likely isn't going to affect the critical path, but it will make it a lot easier to reason about the code, especially when someone else has to modify it.

Re:Dangerous Embedded C Coding Standard Rules (2011) by ZoFreX on Thursday January 02, 2014 @06:49AM (#6999183)
It's really a matter of both taste and situation. I've seen some very compelling examples from the Linux kernel where this is definitively easier to follow than the alternatives (Linus has made some good defences of goto for this purpose), but I've never felt it was the clearest option in any code I've written myself.