> "Do not use goto, setjmp or longjmp."
Error handling in C without those primitives will almost always result in horrible code. They should've made an exception here: "goto error;" should've been allowed and encouraged.
Error handling in C without those primitives will almost always result in horrible code. They should've made an exception here: "goto error;" should've been allowed and encouraged.
They don't care for nice code. They care for easily statically checked and verified code.
Error handling using 'goto' is allowed, as long as you're jumping forward (i.e. to or near the end of the function). You can't go backwards through the code.
It may require a variation in the project's coding spec but it's certainly possible (because I've been there and done it!)