Date: 30/07/2012
Rules to make your C/C++ code robust for high-rel embedded systems
Software programming/coding for a high-rel-iability life support system requires strict set of rules to follow to make the code robust. To check for violation of rules in your C/C++ code, Programming Research (PRQA) offers tools to check quality of coding and reports violations and actions to be taken.
PRQA is member of standards organizations MISRA and ISO. PRQA claims its tools are best in the market for code checking. Its customers includes some of the leading brands in automotive, Aerospace and Defense, Medical and such high-rel system OEMs.
For your knowledge some of the coding rules include:
The character sequence /* shall not be used in a comment.
When an array is declared with external linkage, its size shall be stated explicitly or defined implicitly by initialization.
All automatic variable shall have been assigned a value before being used.
Conversion shall not be performed between a pointer to a function and any type other than an integral type.
The right hand operand of a shift operator shall lie between zero and one less than the width in bits of the underlying type of the left-hand operand.
A function shall have a single point of exit at the end of the function.
An unconditional break statement shall terminate every non empty switch clause
The final clause of a switch statement shall be the default clause.
The number of arguments passed to a function shall match the number of parameters
The address of an object with automatic storage shall not be assigned to another object that may persist after the first object has ceased to exist.
In the definition of a function-like macro each instance of a parameter shall be enclosed in parenthesis unless it is used as the operand of # or ##.
PRQA was demonstrating its product features at the recently held Embedded Systems Conference 2012 in Bangalore, India.
PRQA has announced certification of QA.C 8.0 and QA.C++3.0 with MISRA Compliance Modules to the IEC 61508 and ratified version of ISO 26262 standards.
PRQA also said in a independent comparative study of MISRA-C compliancy checking tools, QA.C has obtained the maximum scores available in nearly all categories.