MISRA C:2004 checker reference - certified
These checkers detect violations of the MISRA C:2004 standard.
Notes
- To view this information organized by rule number, see MISRA C:2004 rules mapped to Klocwork certified checkers.
- We provide full help for each MISRA C and MISRA C++ checker. Because this information is licensed, it is available as a part of your Klocwork installation, rather than online.
Issue code | Description | Rule | Issued | Improved |
---|---|---|---|---|
FUNCRET.GEN |
Non-void function does not return value | 16.8 | Pre-9.2 | |
FUNCRET.IMPLICIT |
Non-void function implicitly returning int does not return value | 16.8 | Pre-9.2 | |
INVARIANT_CONDITION.GEN |
Invariant expression in a condition | 13.7 | 10.1 | 10.2, 2020.1 |
INVARIANT_CONDITION.UNREACH |
Invariant expression in a condition | 13.7 | 10.1 | 10.2 |
LOCRET.ARG |
Function returns address of local variable | 17.6 | Pre-9.2 | 9.5 |
LOCRET.GLOB |
Function returns address of local variable | 17.6 | Pre-9.2 | 9.5 |
LOCRET.RET |
Function returns address of local variable | 17.6 | Pre-9.2 | 9.5 |
MISRA.ASM.ENCAPS |
Assembly language is not isolated. | 2.1 | 9.1 | |
MISRA.ASSIGN.COND |
Assignment operator is used in a condition | 13.1 | 9.2 | |
MISRA.ASSIGN.OVERLAP |
Object is assigned to an overlapping object | 18.2 | 9.5 | 2019.1 |
MISRA.BITFIELD.SIGNED |
Length of a named signed bit-field is less than 2 | 6.5 | 9.1 | 9.2, 10.4 |
MISRA.BITFIELD.SIGNED.UNNAMED |
Length of an unnamed signed bit-field is less than 2 | 6.5 | 9.2 | |
MISRA.BITFIELD.TYPE |
Type of bit-field is not signed/unsigned integer | 6.4 | 9.1 | 9.2, 11.0, 2021.2 |
MISRA.BITS.NOT_UNSIGNED |
Operand of bitwise operation is not unsigned integer | 12.7 | 9.1 | 9.2, 9.2 SR1, 9.5, 11.0 |
MISRA.BITS.NOT_UNSIGNED.PREP |
Operand of bitwise operation is not unsigned integer | 12.7 | 11.1 | |
MISRA.BUILTIN_NUMERIC |
Builtin numeric type is used | 6.3 | 9.1 | 9.2, 9.2 SR1, 9.5 |
MISRA.CAST.CONST |
Cast operation removes const or volatile modifier from a pointer or reference | 11.5 | 9.1 | 9.2, 10.4, 2022.1 |
MISRA.CAST.FLOAT |
Non-trivial float expression is cast to a wider type | 10.4 | 9.1 | 9.2 |
MISRA.CAST.FUNC_PTR |
Cast between a function pointer and a non-integral type | 11.1 | 9.1 | 9.2 |
MISRA.CAST.INT |
Non-trivial integer expression is cast to a wider type, or type with a different signedness | 10.3 | 9.1 | 9.2, 9.5 |
MISRA.CAST.PTR |
Cast between a pointer to object type and a different pointer to object type | 11.4 | 9.1 | |
MISRA.CAST.PTR.UNRELATED |
Object of pointer type cast to unrelated type | 11.2 | 9.2 | 9.5 |
MISRA.CAST.PTR_TO_INT |
Cast between a pointer and an integral type | 11.3 | 9.1 | 9.2 |
MISRA.CAST.UNSIGNED_BITS |
The result of bitwise operation on unsigned char or short is not cast back to original type | 10.5 | 9.1 | |
MISRA.CHAR.NOT_CHARACTER |
'char' is used for non-character value | 6.1 | 9.1 | 11.2 |
MISRA.CHAR.TRIGRAPH |
Trigraph usage | 4.2 | 9.1 | 9.2 |
MISRA.COMMA |
Comma operator is used | 12.10 | 9.1 | |
MISRA.COMP.WRAPAROUND |
Wrap-around in a condition | 12.11 | 9.2 | 9.5, 2020.3 |
MISRA.CONTINUE |
Continue statement is used | 14.5 | 9.1 | |
MISRA.CT.UNIQUE.ID |
Identifier clashes with tag name | 5.4 | 9.1 | 9.2, 9.2 SR1, 2021.2 |
MISRA.CVALUE.IMPL.CAST |
The value of an expression implicitly converted to a different type | 10.1 10.2 | 9.2 | 9.5, 11.0, 2020.3 |
MISRA.DECL.ARRAY_SIZE |
Declaration of array with unknown size | 8.12 | 9.1 | |
MISRA.DECL.FUNC_LOCAL |
Function is declared locally | 8.6 | 9.1 | 9.2 SR1 |
MISRA.DECL.NO_TYPE |
Declaration without a type | 8.2 | 9.1 | 9.2 SR1 |
MISRA.DEFINE.BADEXP |
Inappropriate macro expansion | 19.4 | 9.1 | 9.5 |
MISRA.DEFINE.FUNC |
Function-like macro definition | 19.7 | 9.1 | |
MISRA.DEFINE.LONGNAME |
Macro name is too long | 5.1 | 9.1 | |
MISRA.DEFINE.NOPARS |
Macro parameter with no parentheses | 19.10 | 9.1 | |
MISRA.DEFINE.NOTGLOBAL |
Define not at the global level | 19.5 | 9.1 | |
MISRA.DEFINE.SHARP |
# or ## operator in a macro definition | 19.13 | 9.1 | |
MISRA.DEFINE.SHARP.MANY |
Several # or ## operators in a macro definition | 19.12 | 9.1 | |
MISRA.DEFINE.WRONGNAME |
Usage of a name from the standard library for naming a macro | 20.1 | 9.1 | 9.2 SR2, 9.5 |
MISRA.DEFINE.WRONGNAME.UNDERSCORE |
Usage of a reserved name for naming a macro | 20.1 | 9.2 SR2 | |
MISRA.ELIF.DEFINED |
Incorrect 'defined' usage in #elif directive | 19.14 | 9.1 | |
MISRA.ELIF.OTHERFILE |
#elif in an improper file | 19.17 | 9.1 | |
MISRA.ELIF.UNDEF |
Undefined macros in #elif directive | 19.11 | 9.1 | |
MISRA.ELIF.WRAPAROUND |
Wrap-around in #elif directive | 12.11 | 9.1 | |
MISRA.ELSE.OTHERFILE |
#else in an improper file | 19.17 | 9.1 | |
MISRA.ENDIF.OTHERFILE |
#endif in an improper file | 19.17 | 9.1 | |
MISRA.ENUM.INIT |
Non-first enumerator is explicitly initialized, but not all elements are explicitly initialized. | 9.3 | 9.1 | |
MISRA.EXPANSION.DIRECTIVE |
Directive-like tokens within a macro argument | 19.9 | 9.1 | |
MISRA.EXPANSION.NARGS |
Missing macro argument | 19.8 | 9.1 | 9.2 SR2 |
MISRA.EXPANSION.UNSAFE |
Unsafe macro usage | 20.1 20.5 20.6 20.7 20.8 | 9.1 | 9.5 |
MISRA.EXPR.PARENS.INSUFFICIENT |
Limited dependence required for operator precedence rules in expressions | 12.1 | 10.1.2 | 2022.1 |
MISRA.EXPR.PARENS.REDUNDANT |
Limited dependence required for operator precedence rules in expressions | 12.1 | 10.1.2 | 11.2, 2021.1 |
MISRA.FLOAT.BIT.REPR |
Use of bit manipulations of floating-point values which rely on storage layout | 12.12 | 9.1 | 9.2 SR2, 11.0 |
MISRA.FLOAT_EQUAL |
Floating point expression is tested for equality | 13.3 | 9.1 | 2020.2 |
MISRA.FOR.COND |
For loop condition does not depend on loop counter | 13.5 | 9.1 | 9.2, 9.2 SR1 |
MISRA.FOR.COND.FLT |
Floating point object is used in the condition section of a 'for' loop | 13.4 | 9.2 | 9.5 |
MISRA.FOR.INCR.CHANGE |
For loop increment expression does not change loop counter | 13.5 | 9.1 | 2018.1 |
MISRA.FOR.STMT.CHANGE |
For loop counter is modified within the loop statement | 13.6 | 9.2 | |
MISRA.FUNC.ADDR |
Address of a function is used without & operator | 16.9 | 9.1 | 9.2 SR1 |
MISRA.FUNC.NOPROT.CALL |
Function is called but has no prototype | 8.1 | 9.2 | 9.2 SR1, 2018.3, 2020.3 |
MISRA.FUNC.NOPROT.DEF |
Function has a definition but no prototype | 8.1 | 9.2 | 2018.3 |
MISRA.FUNC.NO_PARAMS |
Function without parameters is missing void parameter type | 16.5 | 9.1 | |
MISRA.FUNC.PARAMS.IDENT |
Identifiers used in declaration and definition of function are not identical | 16.4 | 9.2 | |
MISRA.FUNC.RECUR |
Recursive function | 16.2 | 9.1 | 9.2, 9.2 SR1 |
MISRA.FUNC.STATIC.REDECL |
Function or object redeclaration does not include 'static' modifier | 8.11 | 9.2 | |
MISRA.FUNC.UNMATCHED.PARAMS |
Number of formal and actual parameters passed to function do not match | 16.6 | 9.1 | |
MISRA.FUNC.UNNAMED.PARAMS |
Function declaration has unnamed parameters | 16.3 | 9.1 | |
MISRA.FUNC.VARARG |
Function with variable number of arguments | 16.1 | 9.1 | |
MISRA.GOTO |
Goto statement is used | 14.4 | 9.1 | |
MISRA.IDENT.LONG |
Identifier is longer than 31 characters | 5.1 | 9.1 | 9.2 |
MISRA.IF.DEFINED |
Incorrect 'defined' usage in #if directive | 19.14 | 9.1 | |
MISRA.IF.NO_COMPOUND |
The body of if/else statement is not a compound statement | 14.9 | 9.1 | |
MISRA.IF.NO_ELSE |
A chain of if/else-if statements is not terminated with else or is terminated with an empty else clause | 14.10 | 9.1 | 10.4, 2018.1, 2020.4 |
MISRA.IF.UNDEF |
Undefined macros in #if directive | 19.11 | 9.1 | |
MISRA.IF.WRAPAROUND |
Wrap-around in #if directive | 12.11 | 9.1 | |
MISRA.INCGUARD |
Include guard is not provided | 19.15 | 9.1 | |
MISRA.INCL.BAD |
Non-standard include directive | 19.3 | 9.1 | 9.2, 11.1 |
MISRA.INCL.INSIDE |
Include directive preceded by a preprocessor output token | 19.1 | 9.1 | |
MISRA.INCL.SYMS |
Non-standard characters in header file names | 19.2 | 9.1 | |
MISRA.INCL.UNSAFE |
Unsafe header inclusion | 20.1 20.12 20.8 20.9 | 9.1 | |
MISRA.INCOMPLETE.STRUCT |
Incomplete struct type is used | 18.1 | 9.2 | |
MISRA.INCOMPLETE.STRUCT.UNNAMED |
Incomplete unnamed struct type is used | 18.1 | 9.2 | |
MISRA.INCOMPLETE.UNION |
Incomplete union type is used | 18.1 | 9.2 | |
MISRA.INCOMPLETE.UNION.UNNAMED |
Incomplete unnamed union type is used | 18.1 | 9.2 | |
MISRA.INCR_DECR.OTHER |
Increment or decrement operator is mixed with other operators in expression | 12.13 | 9.1 | 9.2 |
MISRA.INIT.BRACES |
Incorrect initializer braces placement. | 9.2 | 9.1 | |
MISRA.ITER.ONETERM |
Iteration statement has more than one break or goto for loop termination. | 14.6 | 9.1 | |
MISRA.LITERAL.UNSIGNED.SUFFIX |
Unsigned integer literal without 'U' suffix | 10.6 | 9.1 | 9.5, 2021.3 |
MISRA.LOGIC.OPERAND.NOT_BOOL |
Operand of logical operator is not effectively boolean | 12.6 | 9.1 | 9.2 SR1, 9.5 |
MISRA.LOGIC.OPERATOR.NOT_BOOL |
Operand of non-logical operator is effectively boolean | 12.6 | 9.1 (for C), 9.2 SR1 (for C++) | 11.2 |
MISRA.LOGIC.PRIMARY |
Operand in a logical 'and' or 'or' expression is not a primary expression | 12.5 | 9.2 SR2 | |
MISRA.LOGIC.SIDEEFF |
Right operand in a logical 'and' or 'or' expression contains side effects | 12.4 | 9.2 | 10.4 |
MISRA.LOGIC.SIDEEFF.COND |
Branch expression in a conditional expression contains side effects | 12.4 | 9.2 | |
MISRA.NULL.STMT |
Null statement is not the only statement on line or comments are placed incorrectly | 14.3 | 9.1 | 9.2 |
MISRA.OBJ.TYPE.COMPAT |
Type not compatible with type of other declaration | 8.4 | 9.1 | 11.0 |
MISRA.OBJ.TYPE.IDENT |
Type not identical with type of other declaration | 8.3 | 9.1 | 9.2 |
MISRA.ONEDEFRULE.FUNC |
Global function definition in a header file | 8.5 | 9.1 | |
MISRA.ONEDEFRULE.VAR |
Global variable definition in a header file | 8.5 | 9.1 | 2020.2 |
MISRA.PPARAM.NEEDS.CONST |
Pointer parameter is not used to modify the addressed object but is not declared as a pointer to const | 16.7 | 9.1 | 9.2 SR1, 9.5, 10.4 |
MISRA.PRAGMA |
Non-documented pragma directive | 3.4 | 9.1 | |
MISRA.PTR.ARITH |
Pointer is used in arithmetic or array index expression | 17.1 17.4 | 9.1 | 2020.2 |
MISRA.PTR.TO_PTR_TO_PTR |
Pointer declaration has more than two levels of indirection | 17.5 | 9.1 | 9.2 |
MISRA.RETURN.NOT_LAST |
Return is not the last statement in a function | 14.7 | 9.1 | 9.2 SR2, 9.5 |
MISRA.SHIFT.RANGE |
Right operand of shift operation is out of range - greater or equal to max bit-length of left operand, or negative | 12.8 | 9.1 | 9.2 |
MISRA.SIGNED_CHAR.NOT_NUMERIC |
'signed char' or 'unsigned char' is used for non-numeric value | 6.2 | 9.1 | 9.2 |
MISRA.SIZEOF.SIDE_EFFECT |
Operand of sizeof has side effects | 12.3 | 9.1 | |
MISRA.STDLIB.ABORT |
Use of 'abort', 'exit', 'getenv' or 'system' from library stdlib.h | 20.11 | 9.1 | |
MISRA.STDLIB.ATOI |
Use of 'atof', 'atoi' or 'atol' from library stdlib.h | 20.10 | 9.1 | |
MISRA.STDLIB.ERRNO |
Use of error indicator 'errno' | 20.5 | 9.1 | |
MISRA.STDLIB.LONGJMP |
Use of setjmp macro or longjmp function | 20.7 | 9.1 | |
MISRA.STDLIB.MEMORY |
Use of dynamic heap memory allocation | 20.4 | 9.1 | |
MISRA.STDLIB.SIGNAL |
Use of the signal handling facilities of signal.h | 20.8 | 9.1 | |
MISRA.STDLIB.STDIO |
Use of input/output library stdio.h in production code | 20.9 | 9.1 | |
MISRA.STDLIB.TIME |
Use of the time handling functions of library time.h | 20.12 | 9.1 | |
MISRA.STDLIB.WRONGNAME |
Reused name of standard library macro, object or function | 20.2 | 9.1 | 9.2 SR2 |
MISRA.STDLIB.WRONGNAME.UNDERSCORE |
Usage of a reserved name for naming a language entity | 20.2 | 9.2 SR2 | |
MISRA.STMT.NO_COMPOUND |
The body of switch, while, do/while or for statement is not a compound statement | 14.8 | 9.1 | |
MISRA.STMT.NO_EFFECT |
The statement has no side effects, and does not change control flow | 14.2 | 9.1 | 9.2, 9.2 SR1 |
MISRA.SWITCH.BOOL |
Condition of switch statement is boolean expression | 15.4 | 9.1 | |
MISRA.SWITCH.LABEL |
A switch label belongs to nested compound statement inside switch body | 15.1 | 9.1 | |
MISRA.SWITCH.NODEFAULT |
No default clause at the end of a switch statement | 15.3 | 9.2 | 9.2 SR1 |
MISRA.SWITCH.NO_BREAK |
No break or throw statement at the end of switch-clause | 15.2 | 9.1 | 9.2 |
MISRA.SWITCH.NO_CASE |
No case-clause in a switch statement | 15.5 | 9.1 | 9.2 |
MISRA.TOKEN.BADCOM |
Inappropriate character sequence in a comment | 2.3 | 9.1 | |
MISRA.TOKEN.CPCOM |
C++ style comments | 2.2 | 9.1 | |
MISRA.TOKEN.OCTAL.ESCAPE |
Usage of octal escape sequences | 7.1 | 9.1 | |
MISRA.TOKEN.OCTAL.INT |
Usage of octal integer constants | 7.1 | 9.1 | 2020.4 |
MISRA.TOKEN.WRONGESC |
Incorrect escape sequence in a literal | 4.1 | 9.1 | |
MISRA.TYPE.NAMECLASH.C.2004 |
Identifier in one name space has same spelling as identifier in other name space | 5.6 | 9.1 | 9.2, 9.2 SR2, 9.5, 2020.2 |
MISRA.TYPEDEF.NOT_UNIQUE |
Typedef name is used for another entity | 5.3 | 9.1 | 9.2, 9.5 |
MISRA.UMINUS.UNSIGNED |
Operand of unary minus is unsigned | 12.9 | 9.1 | 2021.2 |
MISRA.UNDEF |
Undef usage | 19.6 | 9.1 | |
MISRA.UNDEF.NOTGLOBAL |
Undef not at the global level | 19.5 | 9.1 | |
MISRA.UNDEF.WRONGNAME |
Undefinition of a name from the standard library | 20.2 | 9.1 | 9.5 |
MISRA.UNDEF.WRONGNAME.UNDERSCORE |
Undefinition of a reserved name | 20.2 | 9.2 SR2 | |
MISRA.UNION |
Union is used | 18.4 | 9.1 | |
MISRA.VAR.HIDDEN |
Identifier declared in an inner scope hides identifier in outer scope | 5.2 | 9.2 | 9.2 SR1, 9.5, 10.1, 2020.2 |
MISRA.VAR.MIN.VIS |
Name visibility is too wide | 8.7 | 9.1 | 9.2 SR2, 10.1. 2020.1 |
MISRA.VAR.UNIQUE |
Identifier clashes with other identifier | 5.7 | 9.2 | 9.2 SR2 |
MISRA.VAR.UNIQUE.STATIC |
Identifier with static storage specifier clashes with other identifier | 5.5 | 9.2 | |
MISRA.ZERO_EQ.IMPLICIT |
Non-boolean expression is implicitly tested against zero | 13.2 | 9.1 | 9.2 SR1 |
PORTING.VAR.EFFECTS |
Variable used twice in one expression where one usage is subject to side-effects | 12.2 | 9.2 | 9.5 |
SV.RVT.RETVAL_NOTTESTED |
Ignored Return Value | 16.10 | Pre-9.2 | 2021.2, 2021.3, 2022.1 |
UNINIT.HEAP.MIGHT |
Uninitialized Heap Use - possible | 9.1 | Pre-9.2 | 9.2, 9.5 |
UNINIT.HEAP.MUST |
Uninitialized Heap Use | 9.1 | Pre-9.2 | 9.2, 9.5 |
UNINIT.STACK.ARRAY.MIGHT |
Uninitialized Array - possible | 9.1 | Pre-9.2 | 9.2, 9.5 |
UNINIT.STACK.ARRAY.MUST |
Uninitialized Array | 9.1 | Pre-9.2 | 9.2, 9.5, 2021.2, 2021.4, 2022.1 |
UNINIT.STACK.ARRAY.PARTIAL.MUST |
Partially Uninitialized Array | 9.1 | Pre-9.2 | 9.2, 9.5, 2022.1 |
UNINIT.STACK.MIGHT |
Uninitialized Variable - possible | 9.1 | Pre-9.2 | 9.2, 9.5, 2018.2, 2020.2, 2022.1 |
UNINIT.STACK.MUST |
Uninitialized Variable | 9.1 | Pre-9.2 | 9.2, 9.5, 11.2, 2020.3, 2021.2, 2021.4 |
UNREACH.ENUM |
Code is unreachable due to the possible value(s) of an enum | 14.1 | 2021.3 | |
UNREACH.GEN |
Unreachable code | 14.1 | Pre-9.2 | 9.2, 9.5, 10.1, 10.3, 10.4, 11.2, 2020.3, 2021.3 |
UNREACH.RETURN |
Unreachable Void Return | 14.1 | Pre-9.2 | 9.2, 9.5, 11.2 |
Support Summary
Number of rules not statically verifiable: 11 of 142
Number of statically verifiable rules supported: 124 of 131
MISRA C:2004 coverage = 95% (excludes rules that are not statically verifiable)