MISRA C:2004 checker reference

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

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)

"MISRA", "MISRA C" and "MISRA C++" are registered trademarks of The MISRA Consortium Limited. ​