Skip to end of metadata
Go to start of metadata

MISRA C 2012

NumberDescription
Directive 4.3Assembly language shall be encapsulated and isolated.
Rule 6.2Single-bit named bit fields shall not be of a signed type.
Rule 7.1Octal constants shall not be used.
Rule 7.2A "u" or "U" suffix shall be applied to all integer constants that are represented in an unsigned type.
Rule 7.3The lowercase character "l" shall not be used in a literal suffix.
Rule 7.4A string literal shall not be assigned to an object unless the object's type is "pointer to const-qualified char".
Rule 8.10An inline function shall be declared with the static storage class.
Rule 8.12Within an enumerator list, the value of an implicitly-specified enumeration constant shall be unique.
Rule 8.14The restrict type qualifier shall not be used.
Rule 9.3Arrays shall not be partially initialized.
Rule 9.5Where designated initializers are used to initialize an array object the size of the array shall be specified explicitly.
Rule 11.2Conversions shall not be performed between a pointer to an incomplete type and any other type.
Rule 11.3A cast shall not be performed between a pointer to object type and a pointer to a different object type.
Rule 11.9The macro NULL shall be the only permitted form of integer null pointer constant.
Rule 12.2The right hand operand of a shift operator shall lie in the range zero to one less than the width in bits of the essential type of the left hand operand.
Rule 12.3The comma operator should not be used.
Rule 13.3A full expression containing an increment (++) or decrement (–) operator should have no other potential side effects other than that caused by the increment or decrement operator.
Rule 13.4The result of an assignment operator should not be used.
Rule 15.1The goto statement should not be used.
Rule 15.2The goto statement shall jump to a label declared later in the same function.
Rule 15.7All if ... else if constructs shall be terminated with an else statement.
Rule 16.4Every switch statement shall have a default label.
Rule 16.5A default label shall appear as either the first or the last switch label of a switch statement.
Rule 16.6Every switch statement shall have at least two switch-clauses.
Rule 17.5The function argument corresponding to a parameter declared to have an array type shall have an appropriate number of elements.
Rule 17.6The declaration of an array parameter shall not contain the static keyword between the [].
Rule 17.7The value returned by a function having non-void return type shall be used.
Rule 18.4The +, -, += and -= operators should not be applied to an expression of pointer type.
Rule 18.5Declarations should contain no more than two levels of pointer nesting.
Rule 18.7Flexible array members shall not be declared.
Rule 18.8Variable-length array types shall not be used.
Rule 19.2The union keyword should not be used.

MISRA C++ 2008

NumberDescription
Rule 0-1-7The value returned by a function having non-void return type that is not an overloaded operator shall always be used.
Rule 2-13-2Octal constants (other than zero) and octal escape sequences (other than "\0") shall not be used.
Rule 2-13-3A "U" suffix shall be applied to all octal or hexadecimal integer literals of unsigned type.
Rule 2-13-4Literal suffixes shall be upper case.
Rule 3-1-2Functions shall not be declared at block scope.
Rule 3-1-3When an array is declared, its size shall either be stated explicitly or defined implicitly by initialization.
Rule 4-5-1Expressions with type bool shall not be used as operands to built-in operators other than the assignment operator =, the logical operators &&, ||, !, the equality operators == and !=, the unary & operator, and the conditional operator.
Rule 5-0-5There shall be no implicit floating-integral conversions.
Rule 5-0-19The declaration of objects shall contain no more than two levels of pointer indirection.
Rule 5-2-4C-style casts (other than void casts) and functional notation casts (other than explicit constructor calls) shall not be used.
Rule 5-2-10The increment (++) and decrement (–) operators should not be mixed with other operators in an expression.
Rule 5-2-11The comma operator, && operator and the || operator shall not be overloaded.
Rule 5-8-1The 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.
Rule 5-18-1The comma operator shall not be used.
Rule 6-2-1Assignment operators shall not be used in sub-expressions.
Rule 6-4-2All if ... else if constructs shall be terminated with an else clause.
Rule 6-4-6The final clause of a switch statement shall be the default-clause.
Rule 6-4-8Every switch statement shall have at least one case-clause.
Rule 6-6-2The goto statement shall jump to a label declared later in the same function body.
Rule 7-4-3Assembly language shall be encapsulated and isolated.
Rule 9-5-1Unions shall not be used.
Rule 10-3-2Each overriding virtual function shall be declared with the virtual keyword.
  
  
  
  • No labels