Several improvements in the standardization of Embedded C language programming; embedded Standardization
The following C language standards for MISRA-C-2004
1. Do not use // for comments. Use/*... */for comments.
2. if (...) else if, at last, add else for default processing.
3. The variable definition position must correspond to the position used (especially when there are many variables, it cannot be messy ).
4. When declaring a private function, add the static keyword (only used in the defined file ).
5. The same name is not recommended for private variables in different functions.
6. There should not be multiple exit points in the function. (For Embedded Systems)
7. Forbidden union type
8. Only pointers pointing to the same Array (not necessarily the same members) can be operated and compared.
9. For all basic data types, you must redefine the names to clearly indicate the width of the data type.