Re:JPL Institutional Coding Standard for the C Programming L...
by carlmr on Monday February 18, 2019 @06:30AM
(#19189997)
I just checked, and MISRA 2012 seems to allow goto again under certain preconditions (you have to have a label declared in the same function and it has to be in the same block). So actually you can do proper error handling again.
Still single return statement, which usually makes for more spaghetti.
True, but I've seen enough MISRA code bases plagued with the "Christmas tree" layout even if dynamic memory allocation isn't allowed. This was just a generic example most people can relate to.