But killing an ant with a nuclear bomb is moar funnier! Don't stop the fun!
Which brings us back full circle to the point I was originally trying to convey: if a coding standard forces you to write more convoluted and harder-to-read code just to work around some of its rules, that is a clear…
Yeah, seems like it actually allows my second example which is good! :)
Sure, that would pass the `grep -r goto ` test, but is just a more convoluted way of doing the same thing.
> 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…
True, it would be kind of analogue to try/except/finally if you do that.
Too little karma to edit and fix indentation. Anyway given the above functions, think about adding support for only returning the buffer if the file contains a specific word. While certainly doable in both cases I would…
> You can have 100% MISRA conformant spaghetti. IMHO some of MISRA rules lead directly to hard to read/maintain code. Consider a function that: 1. opens a file 2. allocates enough memory to store the whole file 3. reads…
But killing an ant with a nuclear bomb is moar funnier! Don't stop the fun!
Which brings us back full circle to the point I was originally trying to convey: if a coding standard forces you to write more convoluted and harder-to-read code just to work around some of its rules, that is a clear…
Yeah, seems like it actually allows my second example which is good! :)
Sure, that would pass the `grep -r goto ` test, but is just a more convoluted way of doing the same thing.
> 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…
True, it would be kind of analogue to try/except/finally if you do that.
Too little karma to edit and fix indentation. Anyway given the above functions, think about adding support for only returning the buffer if the file contains a specific word. While certainly doable in both cases I would…
> You can have 100% MISRA conformant spaghetti. IMHO some of MISRA rules lead directly to hard to read/maintain code. Consider a function that: 1. opens a file 2. allocates enough memory to store the whole file 3. reads…