07-04-2014, 12:16 PM
Modelling and coding guidelines should be selected for a project as appropriate for the development context of that project, including the requirements of the applied industry standards (such as IEC 61508 or ISO 26262). Many such standards advocate the application of a suitable language subset, and in ISO 26262 for example these requirements apply regardless of whether the “language†is an imperative programming language such as C, or a graphical modelling language. MISRA C guidelines provide one such subset, and for hand-coded projects this could be the sole source of reference.
When an auto-code generator is used to generate C code from a model-based design, then further guidelines may be selected but still with MISRA C as the basis. Modelling guidelines such as MISRA AC GMG and MISRA AC SLSF may be applied at the model level and MISRA C applied on the generated code. However, some MISRA C guidelines are written with the intent of protecting against many of the common mistakes made by a human code generator. When an auto-code generator is applied then it can be reasonably argued that some of the MISRA C guidelines can be relaxed where a tool can be expected to systematically and consistently “do the right thing.†MISRA AC AGC provides guidance on how generated code should comply with MISRA C:2004. Where MISRA C:2012 is applied then the AGC guidance is integrated into the document itself in Appendix E.
When an auto-code generator is used to generate C code from a model-based design, then further guidelines may be selected but still with MISRA C as the basis. Modelling guidelines such as MISRA AC GMG and MISRA AC SLSF may be applied at the model level and MISRA C applied on the generated code. However, some MISRA C guidelines are written with the intent of protecting against many of the common mistakes made by a human code generator. When an auto-code generator is applied then it can be reasonably argued that some of the MISRA C guidelines can be relaxed where a tool can be expected to systematically and consistently “do the right thing.†MISRA AC AGC provides guidance on how generated code should comply with MISRA C:2004. Where MISRA C:2012 is applied then the AGC guidance is integrated into the document itself in Appendix E.
<t></t>