News for hackers. Stuff that matters.
Re:JPL Institutional Coding Standard for the C Programming L... by acprog42 on Monday February 18, 2019 @06:19AM (#19189969)
> Most Misra software is embedded without dynamic allocation though

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.

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.

Re:JPL Institutional Coding Standard for the C Programming L... by acprog42 on Monday February 18, 2019 @07:22AM (#19190166)
Yeah, seems like it actually allows my second example which is good! :)