MISRA-C checker reference

From current

Reference > C/C++ checkers > MISRA-C checker reference

These checkers detect violations of the MISRA C 2004 standard.

Notes

  • To use these checkers, you need to download them from Klocwork support. See the readme file listed on the support downloads page for details on enabling the MISRA checkers.
  • As of Insight version 9.5, 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 on the public wiki.
  • There are also several default checkers which detect violations of the MISRA standard. They are listed in MISRA-C rules mapped to Klocwork checkers.
  • The information on MISRA checkers in the Documentation Wiki reflects the latest service releases and patches.
Issue codeDescriptionMISRA-C ruleIntroducedImproved
MISRA.ASM.ENCAPS Assembly language is not isolated MISRA C 2.1 9.1
MISRA.ASSIGN.COND Assignment operator is used in a condition MISRA C 13.1 9.2
MISRA.ASSIGN.OVERLAP An object shall not be assigned to an overlapping object MISRA C 18.2 9.5
MISRA.ASSIGN.SUBEXPR Assignment operator is used in sub-expression MISRA C 13.1 9.1 9.2
MISRA.BITFIELD.SIGNED Signed bit-field has length 1 MISRA C 6.5 9.1 9.2
MISRA.BITFIELD.SIGNED.UNNAMED Length of an unnamed signed bit-field is less than 2 MISRA C 6.5 9.2
MISRA.BITFIELD.TYPE Type of bit-field is not signed/unsigned integer MISRA C 6.4 9.1 9.2
MISRA.BITS.NOT_UNSIGNED Operand of bitwise operation is not unsigned integer MISRA C 12.7 9.1 9.2, 9.2 SR1, 9.5
MISRA.BOOL.INVAR.FALSE The condition is always false MISRA C 13.7 9.2
MISRA.BOOL.INVAR.TRUE The condition is always true MISRA C 13.7 9.2
MISRA.BUILTIN_NUMERIC Built-in numeric type is used MISRA C 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 MISRA C 11.5 9.1 9.2
MISRA.CAST.FLOAT Non-trivial float expression is cast to a wider type MISRA C 10.4 9.1 9.2
MISRA.CAST.FUNC_PTR Cast converts function pointer to other pointer type MISRA C 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 MISRA C 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 MISRA C 11.4 9.1
MISRA.CAST.PTR.UNRELATED Object of pointer type cast to unrelated type MISRA C 11.2 9.2 9.5
MISRA.CAST.PTR_TO_INT Cast converts pointer to integral type MISRA C 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 MISRA C 10.5 9.1
MISRA.CHAR.NOT_CHARACTER 'char' is used for non-character value MISRA C 6.1 9.1
MISRA.CHAR.TRIGRAPH Trigraph usage MISRA C 4.2 9.1 9.2
MISRA.COMMA Comma operator is used MISRA C 12.10 9.1
MISRA.COMP.WRAPAROUND Wrap-around in a condition MISRA C 12.11 9.1 9.5
MISRA.CONTINUE Continue statement is used MISRA C 14.5 9.1
MISRA.CT.UNIQUE.ID Identifier clashes with type name MISRA C 5.4 9.1 9.2, 9.2 SR1
MISRA.CVALUE.IMPL.CAST The value of an expression should not be implicitly converted to a different type MISRA C 10.1, 10.2 9.2 9.5
MISRA.DECL.ARRAY_SIZE Declaration of array with unknown size MISRA C 8.12 9.1
MISRA.DECL.FUNC_LOCAL Function is declared locally MISRA C 8.6 9.1 9.2 SR1
MISRA.DECL.NO_TYPE Declaration without a type MISRA C 8.2 9.1 9.2 SR1
MISRA.DEFINE.BADEXP Inappropriate macro expansion MISRA C 19.4 9.1 9.5
MISRA.DEFINE.FUNC Function-like macro definition MISRA C 19.7 9.1
MISRA.DEFINE.LONGNAME Macro name is too long MISRA C 5.1 9.1
MISRA.DEFINE.NOPARS Macro parameter with no parentheses MISRA C 19.10 9.1
MISRA.DEFINE.NOTGLOBAL Define not at the global level MISRA C 19.5 9.1
MISRA.DEFINE.SHARP # or ## operator in a macro definition MISRA C 19.13 9.1
MISRA.DEFINE.SHARP.MANY Several # or ## operators in a macro definition MISRA C 19.12 9.1
MISRA.DEFINE.WRONGNAME Inappropriate macro name MISRA C 20.1 9.1 9.2 SR2, 9.5
MISRA.DEFINE.WRONGNAME.UNDERSCORE Usage of a reserved name for naming a macro MISRA C 20.1 9.1
MISRA.ELIF.DEFINED Incorrect 'defined' usage in #elif directive MISRA C 19.14 9.1
MISRA.ELIF.OTHERFILE #elif in an improper file MISRA C 19.17 9.1
MISRA.ELIF.UNDEF Undefined macros in #elif directive MISRA C 19.11 9.1
MISRA.ELIF.WRAPAROUND Wrap-around in #elif directive MISRA C 12.11 9.1
MISRA.ELSE.OTHERFILE #else in an improper file MISRA C 19.17 9.1
MISRA.ENDIF.OTHERFILE #endif in an improper file MISRA C 19.17 9.1
MISRA.ENUM.INIT Non-first enumerator is explicitly initialized, but not all elements are explicitly initialized MISRA C 9.3 9.1
MISRA.EXPANSION.DIRECTIVE Directive-like tokens within a macro argument MISRA C 19.9 9.1
MISRA.EXPANSION.NARGS Missing macro argument MISRA C 19.8 9.1 9.2 SR2
MISRA.EXPANSION.UNSAFE Unsafe macro usage MISRA C 20.1, 20.5, 20.6, 20.7 9.1 9.5
MISRA.EXPR.PARENS Limited dependence required for operator precedence rules in expressions MISRA C 12.1 9.2 9.2 SR1, 9.5
MISRA.FLOAT.BIT.REPR Use of bit manipulations of floating-point values which rely on storage layout MISRA C 12.12 9.1 9.2 SR1
MISRA.FLOAT_EQUAL Floating point expression is tested for equality MISRA C 13.3 9.1
MISRA.FOR.COND For loop condition does not depend on loop counter MISRA C 13.5 9.1 9.2, 9.2 SR1
MISRA.FOR.COND.CHANGE For loop condition modifies loop counter MISRA C 13.6 9.1
MISRA.FOR.COND.FLT Floating point object is used in the condition section of a 'for' loop MISRA C 13.4 9.2 9.5
MISRA.FOR.INCR.CHANGE For loop increment expression does not change loop counter MISRA C 13.5 9.1
MISRA.FOR.STMT.CHANGE For loop counter is modified within the loop loop statement MISRA C 13.6 9.2
MISRA.FUNC.ADDR Address of a function is used without & operator MISRA C 16.9 9.1 9.2 SR1
MISRA.FUNC.NO_PARAMS Function without parameters is missing void parameter type MISRA C 16.5 9.1
MISRA.FUNC.NOPROT.CALL Function is called but has no prototype MISRA C 8.1 9.2 9.2 SR1
MISRA.FUNC.NOPROT.DEF Function has a definition but no prototype MISRA C 8.1 9.2
MISRA.FUNC.PARAMS.IDENT Identifiers used in declaration and definition of function are not identical MISRA C 16.4 9.2
MISRA.FUNC.RECUR Recursive function MISRA C 16.2 9.1 9.2, 9.2 SR1
MISRA.FUNC.STATIC.REDECL Function or object redeclaration does not include 'static' modifier MISRA C 8.11 9.2
MISRA.FUNC.UNMATCHED.PARAMS Number of formal and actual parameters passed to function do not match MISRA C 16.6 9.1
MISRA.FUNC.UNNAMED.PARAMS Function declaration has unnamed parameters MISRA C 16.3 9.1
MISRA.FUNC.VARARG Function with variable number of arguments MISRA C 16.1 9.1
MISRA.GOTO Goto statement is used MISRA C 14.4 9.1
MISRA.IDENT.LONG Identifier is longer than 31 characters MISRA C 5.1 9.1 9.2
MISRA.IF.DEFINED Incorrect 'defined' usage in #if directive MISRA C 19.14 9.1
MISRA.IF.NO_COMPOUND The body of if/else statement is not a compound statement MISRA C 14.9 9.1
MISRA.IF.NO_ELSE A chain of if/else-if statements is not terminated by else MISRA C 14.10 9.1
MISRA.IF.UNDEF Undefined macros in #if directive MISRA C 19.11 9.1
MISRA.IF.WRAPAROUND Wrap-around in #if directive MISRA C 12.11 9.1
MISRA.INCGUARD Include guard is not provided MISRA C 19.15 9.1
MISRA.INCL.BAD Non-standard include directive MISRA C 19.3 9.1 9.2
MISRA.INCL.INSIDE Include directive preceded by a preprocessor output token MISRA C 19.1 9.1
MISRA.INCL.SYMS Non-standard characters in header file names MISRA C 19.2 9.1
MISRA.INCL.UNSAFE Unsafe header inclusion MISRA C 20.1, 20.8, 20.9, 20.12 9.1
MISRA.INCOMPLETE.STRUCT Incomplete struct type is used MISRA C 18.1 9.2
MISRA.INCOMPLETE.STRUCT.UNNAMED Incomplete unnamed struct type is used MISRA C 18.1 9.2
MISRA.INCOMPLETE.UNION Incomplete unnamed union type is used MISRA C 18.1 9.2
MISRA.INCOMPLETE.UNION.UNNAMED Incomplete unnamed union type is used MISRA C 18.1 9.2
MISRA.INCR_DECR.OTHER Increment or decrement operator is mixed with other operators in expression MISRA C 12.13 9.1 9.2
MISRA.INIT.BRACES Incorrect initializer braces placement MISRA C 9.2 9.1
MISRA.ITER.ONETERM Iteration statement has more than one break or goto for loop termination MISRA C 14.6 9.1
MISRA.LITERAL.UNSIGNED.SUFFIX Unsigned integer literal without 'U' suffix MISRA C 10.6 9.1 9.5
MISRA.LOGIC.OPERAND.NOT_BOOL Operand of logical operator is not effectively boolean MISRA C 12.6 9.1 9.2 SR1, 9.5
MISRA.LOGIC.OPERATOR.NOT_BOOL Operand of non-logical operator is effectively boolean MISRA C 12.6 9.1 9.2 SR1
MISRA.LOGIC.PRIMARY Operand in a logical 'and' or 'or' expression is not a primary expression MISRA C 12.5 9.5
MISRA.LOGIC.SIDEEFF Right operand in a logical 'and' or 'or' expression contains side effects MISRA C 12.4 9.2
MISRA.LOGIC.SIDEEFF.COND Branch expression in a conditional expression contains side effects MISRA C 12.4 9.2
MISRA.NULL.STMT Null statement is not the only statement on line or comments are placed incorrectly MISRA C 14.3 9.1 9.2
MISRA.OBJ.TYPE.COMPAT Type not compatible with type of other declaration MISRA C 8.4 9.1
MISRA.OBJ.TYPE.IDENT Type not identical with type of other declaration MISRA C 8.3 9.1 9.2
MISRA.ONEDEFRULE.FUNC Global function definition in a header file MISRA C 8.5 9.1
MISRA.ONEDEFRULE.VAR Global variable definition in a header file MISRA C 8.5 9.1
MISRA.PPARAM.NEEDS.CONST Pointer parameter is not used to modify the addressed object but is not declared as pointer to const MISRA C 16.7 9.1 9.2 SR1, 9.5
MISRA.PRAGMA Non-documented pragma directive MISRA C 3.4 9.1
MISRA.PTR.ARITH Pointer is used in arithmetic or array index expression MISRA C 17.1, 17.4 9.1
MISRA.PTR.TO_PTR_TO_PTR Pointer declaration has more than two levels of indirection MISRA C 17.5 9.1 9.2
MISRA.RETURN.NOT_LAST Return is not the last statement in a function MISRA C 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 MISRA C 12.8 9.1 9.2
MISRA.SIGNED_CHAR.NOT_NUMERIC 'signed char' or 'unsigned char' is used for non-numeric value MISRA C 6.2 9.1 9.2
MISRA.SIZEOF.SIDE_EFFECT Operand of sizeof has side effects MISRA C 12.3 9.1
MISRA.STDLIB.ABORT Use of 'abort', 'exit', 'getenv' or 'system' MISRA C 20.11 9.1
MISRA.STDLIB.ATOI Use of 'atof', 'atoi' or 'atol' MISRA C 20.10 9.1
MISRA.STDLIB.ERRNO Use of error indicator 'errno' MISRA C 20.5 9.1
MISRA.STDLIB.LONGJMP Use of setjmp macro or longjmp function MISRA C 20.7 9.1
MISRA.STDLIB.MEMORY Use of dynamic heap memory allocation MISRA C 20.4 9.1
MISRA.STDLIB.SIGNAL Use of the signal handling facilities of signal.h MISRA C 20.8 9.1
MISRA.STDLIB.STDIO Use of input/output library stdio.h in production code MISRA C 20.9 9.1
MISRA.STDLIB.TIME Use of the time handling functions of library time.h MISRA C 20.12 9.1
MISRA.STDLIB.WRONGNAME Reused name of standard library macro, object or function MISRA C 20.2 9.1 9.2 SR2
MISRA.STDLIB.WRONGNAME.UNDERSCORE Usage of a reserved name for naming a language entity MISRA C 20.2 9.1
MISRA.STMT.NO_COMPOUND The body of switch, while, do/while or for statement is not a compound statement MISRA C 14.8 9.1
MISRA.STMT.NO_EFFECT The statement has no side effects, and does not change control flow MISRA C 14.2 9.1 9.2, 9.2 SR1
MISRA.SWITCH.BOOL Condition of switch statement is boolean expression MISRA C 15.4 9.1
MISRA.SWITCH.LABEL A switch label belongs to nested compound statement inside switch body MISRA C 15.1 9.1
MISRA.SWITCH.NO_BREAK No break or throw statement at the end of switch-clause MISRA C 15.2 9.1 9.2
MISRA.SWITCH.NO_CASE No case-clause in a switch statement MISRA C 15.5 9.1 9.2
MISRA.SWITCH.NODEFAULT No default clause at the end of a switch statement MISRA C 15.3 9.2 9.2 SR1
MISRA.TOKEN.BADCOM Inappropriate character sequence in a comment MISRA C 2.3 9.1
MISRA.TOKEN.CPCOM C++ style comments MISRA C 2.2 9.1
MISRA.TOKEN.OCTAL.ESCAPE Usage of octal escape sequences MISRA C 7.1 9.1
MISRA.TOKEN.OCTAL.INT Usage of octal integer constants MISRA C 7.1 9.1
MISRA.TOKEN.WRONGESC Incorrect escape sequence in a literal MISRA C 4.1 9.1
MISRA.TYPE.NAMECLASH Type and variable/function with the same name MISRA C 5.6 9.1 9.2, 9.2 SR2, 9.5
MISRA.TYPEDEF.NOT_UNIQUE Name of typedef is not unique MISRA C 5.3 9.1 9.2, 9.5
MISRA.UMINUS.UNSIGNED Operand of unary minus is unsigned MISRA C 12.9 9.1
MISRA.UNDEF Undef usage MISRA C 19.6 9.1
MISRA.UNDEF.NOTGLOBAL Undef not at the global level MISRA C 19.5 9.1
MISRA.UNDEF.WRONGNAME Undefinition of a name from the standard library MISRA C 20.2 9.1 9.5
MISRA.UNDEF.WRONGNAME.UNDERSCORE Undefinition of a reserved name MISRA C 20.2 9.1
MISRA.UNION Union is used MISRA C 18.4 9.1
MISRA.VAR.HIDDEN Variable declaration hides declaration in upper scope MISRA C 5.2 9.2 9.2 SR1, 9.5
MISRA.VAR.MIN.VIS Name visibility is too wide MISRA C 8.7 9.1 9.2 SR2
MISRA.VAR.UNIQUE Identifier clashes with other identifier MISRA C 5.7 9.2 9.2 SR2
MISRA.VAR.UNIQUE.STATIC Identifier with static storage specifier clashes with other identifier MISRA C 5.5 9.2
MISRA.ZERO_EQ.IMPLICIT Non-boolean expression is implicitly tested against zero MISRA C 13.2 9.1 9.2 SR1

See also