Embedded C coding standard

Posted 26 Aug 2017

After some months of experimentation and field trials, I officialy adopted the Embedded C Coding Standard for all my new projects.

Barr Group’s Embedded C Coding Standard was developed from the ground up to minimize bugs in firmware, by focusing on practical rules that keep bugs out–while also improving the maintainability and portability of embedded software. The coding standard details a set of guiding principles as well as specific naming conventions and other rules for the use of data types, functions, preprocessor macros, variables and much more. Individual rules that have been demonstrated to reduce or eliminate certain types of bugs are highlighted.

I decided to adopt this coding standard, instead of the more complex and structured CERT-C or MISRA-C, because it is easy as a set of field-proven techniques and best practice rules, making it easier and faster to implement and to enforce during code development, revision and maintenance.

This coding standard is presentend in the book by Michael Barr of Barr Group.