3 ms·
>Error handling in C without those primitives will almost always result in horrible code They don't care for nice code. They care for easily statically checked
by coldtea 8y ago
>Error handling in C without those primitives will almost always result in horrible code
They don't care for nice code. They care for easily statically checked and verified code.
- philpem 8y agoAs I said else-thread, there's actually a variation in MISRA-C-2012 (or possibly one of the addenda) for this. 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!)