MISRA C++:2023 checker reference - certified

These checkers detect violations of the MISRA C++:2023 standard.

Notes

  • To view this information organized by rule number, see MISRA C++:2023 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
AUTOSAR.ARRAY.CSTYLE C-style arrays shall not be used 11.3.1 2022.2
AUTOSAR.ASM The asm declaration shall not be used 10.4.1 2020.1
AUTOSAR.CAST.REINTERPRET reinterpret_cast shall not be used 8.2.5 2020.1
AUTOSAR.EXCPT.NOEXCPT_THROW If a function is declared to be noexcept, noexcept(true) or noexcept(<true condition>), then it shall not exit with an exception 18.5.1 2020.1
AUTOSAR.FORWARD Forwarding values to other functions shall be done via: (1) std::move if the value is an rvalue reference, (2) std::forward if the value is forwarding reference 28.6.2 2020.1
AUTOSAR.GOTO The goto statement shall not be used 9.6.1 2020.1
AUTOSAR.LAMBDA.IMPLICIT_CAPTURE Variables shall not be implicitly captured in a lambda expression 8.1.2 2020.1
AUTOSAR.MEMB.VIRTUAL.SPEC Virtual function declaration shall contain exactly one of the three specifiers: (1) virtual, (2) override, (3) final. 13.3.1 2020.1
AUTOSAR.OP.DELETE.MISSING_VERSION If a project has sized or unsized version of operator "delete" globally defined, then both sized and unsized versions shall be defined 21.6.4 2020.1
AUTOSAR.SETLOCALE The library <clocale> (locale.h) and the setlocale function shall not be used 25.5.1 2020.1
AUTOSAR.STDLIB.MOVE.CONST The std::move shall not be used on objects declared const or const& 28.6.1 2020.1
AUTOSAR.VECTOR.BOOL The std::vector<bool> specialization shall not be used 26.3.1 2020.1
AUTOSAR.VIRTUAL.PTR_COMPARE A pointer to member virtual function shall only be tested for equality with null-pointer-constant 13.3.4 2020.1
CERT.EXPR.DELETE_PTR.INCOMPLETE_TYPE Do not delete a pointer to an incomplete type 21.6.5 2020.1
CERT.EXPR.VOLATILE.ADDR.PARAM Do not pass a volatile object to a function through a nonvolatile pointer 10.1.2 2020.1
CL.SELF-ASSIGN Use of free memory (double free) - in operator= 15.8.1 Pre-2020.1
CXX.BITOP.BOOL_OPERAND Potential logic error: Boolean expressions should not be used directly as bitwise operator arguments. Consider using logical operators instead. 7.0.1 2021.1
CXX.STDLIB.ILLEGAL_REUSE The pointer returned by the Standard Library functions asctime and similar shall not be used following a subsequent call to the same function 25.5.3 2021.3
CXX.STDLIB.ILLEGAL_WRITE The pointers returned by the Standard Library functions localeconv, getenv, setlocale or, strerror shall only be used as if they have pointer to const-qualified type 25.5.2 2021.3
FUNCRET.GEN Non-void function does not return value 9.6.5 Pre-2020.1
INVARIANT_CONDITION.GEN Invariant expression in a condition 0.0.2 2020.1
INVARIANT_CONDITION.UNREACH Invariant expression in a condition 0.0.2 Pre-2020.1
LOCRET.ARG Function returns address of local variable 6.8.3 Pre-2020.1
LOCRET.GLOB Function returns address of local variable 6.8.3 Pre-2020.1
LOCRET.RET Function returns address of local variable 6.8.1 6.8.2 Pre-2020.1
LV_UNUSED.GEN Local variable unused 0.2.1 2020.3
MISRA.ADDR.REF.PARAM Function returns reference to parameter passed by reference 4.1.3 Pre-2020.1
MISRA.ADDR.REF.PARAM.PTR Function returns address of parameter passed by reference 4.1.3 Pre-2020.1
MISRA.ASSIGN.COND Assignment operator is used in a condition 8.18.2 Pre-2020.1
MISRA.ASSIGN.OVERLAP Object is assigned to an overlapping object 8.18.1 2023.2
MISRA.ASSIGN.SUBEXPR Assignment operator is used in a sub-expression outside a condition 8.18.2 Pre-2020.1
MISRA.BASE.IDS.UNIQUE Member name is used twice in inheritance hierarchy 6.4.2 Pre-2020.1
MISRA.BASE.VIRTUAL.NOTVIRTUAL Base class is used as both virtual and not virtual in inheritance hierarchy 13.1.2 Pre-2020.1
MISRA.BITFIELD.SIGNED Length of a named signed bit-field is less than 2 12.2.3 Pre-2020.1
MISRA.BITS.NOT_UNSIGNED Operand of bitwise operation is not unsigned integer 7.0.4 Pre-2020.1
MISRA.BITS.NOT_UNSIGNED.PREP Operand of bitwise operation is not unsigned integer 7.0.4 Pre-2020.1
MISRA.BITS.OPERAND Operands of bitwise operation have different underlying types 7.0.4 Pre-2020.1
MISRA.BUILTIN_NUMERIC Builtin numeric type is used 6.9.2 Pre-2020.1
MISRA.CAST.CONST Cast operation removes const or volatile modifier from a pointer or reference 8.2.3 Pre-2020.1
MISRA.CAST.FLOAT_INT Cast of floating point expression to integral type 7.0.5 Pre-2020.1
MISRA.CAST.FUNC_PTR.CPP Cast converts function pointer to other pointer type 7.11.3 8.2.4 Pre-2020.1
MISRA.CAST.INT.SIGN Non-trivial integral expression is cast to type with different signedness 7.0.5 Pre-2020.1
MISRA.CAST.INT_FLOAT Cast of integral expression to floating point type 7.0.5 Pre-2020.1
MISRA.CAST.INT_TO_PTR Object with integer type or pointer to void cast to pointer type 7.11.3 8.2.6 Pre-2020.1
MISRA.CAST.PTR.UNRELATED Object of pointer type cast to unrelated type 7.11.3 2023.2
MISRA.CAST.PTR.VRCLASS A cast form pointer to a virtual base class to pointer to a derived class does not use 'dynamic_cast' 8.2.1 Pre-2020.1
MISRA.CAST.PTR_TO_INT Cast between a pointer and an integral type 8.2.7 Pre-2020.1
MISRA.CATCH.ALL No ellipsis exception handler in a try-catch block 18.3.1 Pre-2020.1
MISRA.CATCH.BY_VALUE Exception object of class type is caught by value 18.3.2 Pre-2020.1
MISRA.CHAR.NOT_CHARACTER 'char' is used for non-character value 7.0.3 Pre-2020.1
MISRA.CHAR.OPERAND Expression of type 'char' or 'wchar_t' is used as non-character operand 7.0.6 Pre-2020.1
MISRA.CHAR.TRIGRAPH Trigraph usage 5.0.1 Pre-2020.1
MISRA.COMMA Comma operator is used 8.19.1 Pre-2020.1
MISRA.COMP.WRAPAROUND Wrap-around in a condition 8.20.1 2020.3
MISRA.CONST.RET.NON_CONST Constant member function returns non-const pointer to member variable 10.1.1 Pre-2020.1
MISRA.CONV.FLOAT Implicit floating-point conversion 4.1.3 Pre-2020.1
MISRA.CONV.INT.SIGN Implicit integral conversion changes signedness 7.0.5 Pre-2020.1
MISRA.CTOR.BASE Constructor does not explicitly call constructor of its base class 15.1.2 2020.2
MISRA.CTOR.DYNAMIC Object's dynamic type is used from the body of its constructor 15.1.1 Pre-2020.1
MISRA.CTOR.NOT_EXPLICIT Constructor with one argument of built-in type is not declared 'explicit' 15.1.3 Pre-2020.1
MISRA.CTOR.TRY.NON_STATIC Function try/catch block of constructor or destructor references non-static members 18.3.3 Pre-2020.1
MISRA.C_CAST C-style cast to non-void type 8.2.2 Pre-2020.1
MISRA.DECL.ARRAY_SIZE Declaration of array with unknown size 6.0.2 Pre-2020.1
MISRA.DECL.EXCPT.SPEC Function is declared with different exception specifications 4.1.3 Pre-2020.1
MISRA.DECL.FUNC_LOCAL Function is declared locally 6.0.1 Pre-2020.1
MISRA.DECL.MANY_DCLS More than one declarator in one declaration 10.0.1 Pre-2020.1
MISRA.DEFINE.FUNC Function-like macro definition 19.0.2 Pre-2020.1
MISRA.DEFINE.NOPARS Macro parameter with no parentheses 19.3.4 8.0.1 2020.4
MISRA.DEFINE.SHARP # or ## operator in a macro definition 19.3.1 Pre-2020.1
MISRA.DEFINE.SHARP.ORDER.2012 Unspecified order of evaluation of multiple '#' or '##' 19.3.2 2020.4
MISRA.DEFINE.SHARP.REPLACE.2012 A macro parameter used as an operand to the '#' or '##' operators, which is itself subject to further macro replacement, shall only be used as an operand to these operators 19.3.3 Pre-2020.1
MISRA.DEFINE.WRONGNAME Usage of a name from the standard library for naming a macro 4.1.3 Pre-2020.1
MISRA.DEFINE.WRONGNAME.UNDERSCORE Usage of a reserved name for naming a macro 4.1.3 Pre-2020.1
MISRA.DERIVE.VIRTUAL Class is derived from virtual base 13.1.1 Pre-2020.1
MISRA.DTOR.DYNAMIC Object's dynamic type is used from the body of its destructor 15.1.1 Pre-2020.1
MISRA.ELIF.DEFINED Incorrect 'defined' usage in #elif directive 19.1.1 Pre-2020.1
MISRA.ELIF.OTHERFILE #elif in an improper file 19.1.2 Pre-2020.1
MISRA.ELIF.UNDEF Undefined macros in #elif directive 19.1.3 Pre-2020.1
MISRA.ELIF.WRAPAROUND Wrap-around in #elif directive 8.20.1 Pre-2020.1
MISRA.ELSE.OTHERFILE #else in an improper file 19.1.2 Pre-2020.1
MISRA.ENDIF.OTHERFILE #endif in an improper file 19.1.2 Pre-2020.1
MISRA.ENUM.IMPLICIT.VAL.NON_UNIQUE.2012 Implicit enumerator value is not unique 11.6.3 Pre-2020.1
MISRA.ENUM.OPERAND Expression of enum type is used in arithmetic context 7.0.6 Pre-2020.1
MISRA.EXPANSION.DIRECTIVE Directive-like tokens within a macro argument 19.3.5 Pre-2020.1
MISRA.EXPR.PARENS.REDUNDANT Limited dependence required for operator precedence rules in expressions 8.0.1 2024.1
MISRA.FOR.COND.CHANGE For loop counter is modified within the loop condition section 9.5.1 Pre-2020.1
MISRA.FOR.COUNTER.FLT For loop counter has a floating point type 9.5.1 Pre-2020.1
MISRA.FOR.COUNTER.MANY Many counters in a for loop 9.5.1 Pre-2020.1
MISRA.FOR.INCR For loop counter is modified in an inappropriate way 9.5.1 Pre-2020.1
MISRA.FOR.STMT.CHANGE For loop counter is modified within the loop statement 9.5.1 Pre-2020.1
MISRA.FUNC.ARRAY.PARAMS Function argument with array type decay to a pointer 7.11.2 Pre-2020.1
MISRA.FUNC.PARAMS.IDENT Identifiers used in declaration and definition of function are not identical 13.3.3 Pre-2020.1
MISRA.FUNC.RECUR Recursive function 8.2.10 Pre-2020.1
MISRA.FUNC.SPEC.OVRLD Viable function set for a function call contains an overloaded template and its explicit specialization 17.8.1 Pre-2020.1
MISRA.FUNC.UNUSEDPAR Formal parameter of a non-virtual function is not used 0.2.2 Pre-2020.1
MISRA.FUNC.UNUSEDRET Return value of a non-void function is not used 0.1.2 Pre-2020.1
MISRA.FUNC.VARARG Function with variable number of arguments 21.10.1 Pre-2020.1
MISRA.FUNC_CAST Functional notation cast different from explicit constructor call 8.2.2 2020.2
MISRA.GOTO.AFTER.LABEL Unconstrained use of goto 9.6.3 Pre-2020.1
MISRA.GOTO.NESTED Goto to a label declared in a nested compound statement 9.6.2 Pre-2020.1
MISRA.IF.DEFINED Incorrect 'defined' usage in #if directive 19.1.1 Pre-2020.1
MISRA.IF.NO_COMPOUND The body of if/else statement is not a compound statement 9.3.1 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 9.4.1 Pre-2020.1
MISRA.IF.UNDEF Undefined macros in #if directive 19.1.3 Pre-2020.1
MISRA.IF.WRAPAROUND Wrap-around in #if directive 8.20.1 Pre-2020.1
MISRA.INCGUARD Include guard is not provided 19.2.1 Pre-2020.1
MISRA.INCL.BAD Non-standard include directive 19.2.2 2020.4
MISRA.INCL.INSIDE Include directive preceded by a preprocessor output token 19.0.3 Pre-2020.1
MISRA.INCL.SYMS Non-standard characters in header file names 19.2.3 Pre-2020.1
MISRA.INCL.UNSAFE Unsafe header inclusion 4.1.3 2022.2
MISRA.LINKAGE.EXTERN Object or function declaration with external linkage not in header file 6.5.1 Pre-2020.1
MISRA.LITERAL.NULL.INT NULL used as an integer value. 7.11.1 2020.1
MISRA.LITERAL.NULL.PTR Literal zero used as the null-pointer-constant. 7.11.1 Pre-2020.1
MISRA.LITERAL.UNSIGNED.SUFFIX Unsigned integer literal without 'U' suffix 5.13.4 Pre-2020.1
MISRA.LOGIC.OPERATOR.NOT_BOOL Operand of non-logical operator is effectively boolean 7.0.1 2021.2
MISRA.LOGIC.POSTFIX Operand in a logical 'and' or 'or' expression is not a postfix expression 8.0.1 Pre-2020.1
MISRA.LOGIC.SIDEEFF Right operand in a logical 'and' or 'or' expression contains side effects 8.14.1 Pre-2020.1
MISRA.NAMESPACE.UNMD Unnamed namespace in header file 10.3.1 2024.1
MISRA.NS.GLOBAL Function, variable or type declaration in global namespace 6.0.3 Pre-2020.1
MISRA.NS.GLOBAL.USING Using directive or declaration in global namespace 6.0.3 Pre-2020.1
MISRA.NS.MAIN Non-global function with name 'main' is defined 6.0.4 Pre-2020.1
MISRA.OBJ.TYPE.COMPAT Type not compatible with type of other declaration 6.2.2 Pre-2020.1
MISRA.OBJ.TYPE.IDENT Type not identical with type of other declaration 6.9.1 Pre-2020.1
MISRA.ONEDEFRULE.FUNC Global function definition in a header file 6.2.4 Pre-2020.1
MISRA.ONEDEFRULE.VAR Global variable definition in a header file 6.2.4 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 10.1.1 Pre-2020.1
MISRA.PRAGMA.ASM Incorrect assembler instruction 19.6.1 Pre-2020.1
MISRA.PTR.ARITH Pointer is used in arithmetic or array index expression 8.7.1 2020.2
MISRA.PTR.ARITH.NOT_SAME.2008 A pointer resulting from arithmetic on a pointer operand shall address an element of the same array as that pointer operand 8.7.1 2020.2
MISRA.PTR.CMP.2008 Pointer comparison using comparison operators shall only be applied if pointing to same array and within the range 8.9.1 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 8.9.1 2022.1
MISRA.PTR.SUB Pointer subtraction shall only be applied if pointing to same array 8.7.2 2022.4
MISRA.PTR.SUB.OBJECT Pointer subtraction shall only be applied if pointing to same object 8.7.2 2022.4
MISRA.PTR.TO_PTR_TO_PTR Pointer declaration has more than two levels of indirection 11.3.2 Pre-2020.1
MISRA.RET.REF.NON_CONST Member function returns non-const handle to member variable 10.1.1 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 7.0.4 Pre-2020.1
MISRA.SPEC.SAMEFILE Template specialization and its primary template are declared in different files 4.1.3 Pre-2020.1
MISRA.STDLIB.ATOI Use of 'atof', 'atoi' or 'atol' from library stdlib.h 21.2.1 Pre-2020.1
MISRA.STDLIB.CSTRING Function from 'cstring' library is used 21.2.2 Pre-2020.1
MISRA.STDLIB.CSTRING.MACRO Macro from 'cstring' library is used 4.1.3 Pre-2020.1
MISRA.STDLIB.LONGJMP Use of setjmp macro or longjmp function 21.10.2 Pre-2020.1
MISRA.STDLIB.MEMORY Use of dynamic heap memory allocation 21.6.1 21.6.2 Pre-2020.1
MISRA.STDLIB.SIGNAL Use of the signal handling facilities of signal.h 21.10.3 Pre-2020.1
MISRA.STDLIB.STDIO Use of input/output library stdio.h in production code 30.0.1 Pre-2020.1
MISRA.STDLIB.SYSTEM.2012_AMD2 Use of 'system' from library stdlib.h 21.2.3 Pre-2020.1
MISRA.STMT.NO_COMPOUND The body of switch, while, do/while or for statement is not a compound statement 9.3.1 Pre-2020.1
MISRA.STRINGS.CONCAT Narrow and wide string literals concatenated 5.13.7 Pre-2020.1
MISRA.SWITCH.BOOL Condition of switch statement is boolean expression 9.4.2 Pre-2020.1
MISRA.SWITCH.LABEL A switch label belongs to nested compound statement inside switch body 9.4.2 Pre-2020.1
MISRA.SWITCH.NOT_WELL_FORMED Switch statement is not well-formed 9.4.2 Pre-2020.1
MISRA.SWITCH.NO_CASE No case-clause in a switch statement 9.4.2 Pre-2020.1
MISRA.TEMPLMEM.NOQUAL In an instantiated template a member declared in a dependant base is used without a qualificator or 'this' 6.4.3 Pre-2020.1
MISRA.TERMINATE terminate() function is called explicitly 18.5.2 Pre-2020.1
MISRA.THROW.EMPTY Empty throw expression does not belong to a catch block 18.1.2 Pre-2020.1
MISRA.THROW.PTR Exception object is a pointer 18.1.1 Pre-2020.1
MISRA.TOKEN.BADCOM Inappropriate character sequence in a comment 5.7.1 Pre-2020.1
MISRA.TOKEN.OCTAL.ESCAPE Usage of octal escape sequences 4.1.2 Pre-2020.1
MISRA.TOKEN.OCTAL.INT Usage of octal integer constants 4.1.2 5.13.3 2020.4
MISRA.TOKEN.WRONGESC Incorrect escape sequence in a literal 4.1.3 Pre-2020.1
MISRA.UMINUS.UNSIGNED Operand of unary minus is unsigned 8.3.1 2021.2
MISRA.UNION Union is used 12.3.1 Pre-2020.1
MISRA.UN_OP.OVERLOAD Unary & operator is overloaded 16.5.2 Pre-2020.1
MISRA.USE.UNKNOWNDIR Unknown preprocessor directive is used 19.0.1 Pre-2020.1
MISRA.VAR.HIDDEN Identifier declared in an inner scope hides identifier in outer scope 6.4.1 2020.2
NUM.OVERFLOW.DF Possible numeric overflow or wraparound 8.20.1 2022.3
PORTING.CMPSPEC.TYPE.BOOL Assignment to a 'bool' type is larger than 1 byte 7.0.2 Pre-2020.1
PORTING.PRAGMA.ALIGN #pragma align usage 19.6.1 Pre-2020.1
PORTING.PRAGMA.PACK #pragma pack usage 19.6.1 Pre-2020.1
RETVOID.GEN Non-void function returns void value 9.6.5 Pre-2020.1
UFM.DEREF.MUST Use of Freed Memory by Pointer 6.8.1 Pre-2020.1
UFM.FFM.MIGHT Use of free memory (double free) - possible 6.8.1 Pre-2020.1
UFM.FFM.MUST Freeing Freed Memory 6.8.1 Pre-2020.1
UFM.RETURN.MIGHT Use of freed memory (return) - possible 6.8.1 Pre-2020.1
UFM.RETURN.MUST Use of Freed Memory on Return 6.8.1 Pre-2020.1
UFM.USE.MIGHT Use of free memory - possible 6.8.1 Pre-2020.1
UFM.USE.MUST Use of Freed Memory 6.8.1 Pre-2020.1
UNINIT.CTOR.MIGHT Uninitialized Variable in Constructor - possible 11.6.2 Pre-2020.1
UNINIT.CTOR.MUST Uninitialized Variable in Constructor 11.6.2 2020.1
UNINIT.HEAP.MIGHT Uninitialized Heap Use - possible 11.6.2 Pre-2020.1
UNINIT.HEAP.MUST Uninitialized Heap Use 11.6.2 Pre-2020.1
UNINIT.STACK.ARRAY.MIGHT Uninitialized Array - possible 11.6.2 Pre-2020.1
UNINIT.STACK.ARRAY.MUST Uninitialized Array 11.6.2 Pre-2020.1
UNINIT.STACK.ARRAY.PARTIAL.MUST Partially Uninitialized Array 11.6.2 Pre-2020.1
UNINIT.STACK.MIGHT Uninitialized Variable - possible 11.6.2 Pre-2020.1
UNINIT.STACK.MUST Uninitialized Variable 11.6.2 Pre-2020.1
UNREACH.ENUM Code is unreachable due to the possible value(s) of an enum 0.0.1 2021.3
UNREACH.GEN Unreachable code 0.0.1 Pre-2020.1
UNREACH.RETURN Unreachable Void Return 0.0.1 Pre-2020.1
UNREACH.SIZEOF Architecture-related unreachable code 0.0.1 Pre-2020.1
UNUSED.FUNC.GEN Function defined but not used 0.2.4 2023.4
VA_UNUSED.GEN Value is Never Used after Assignment 0.1.1 Pre-2020.1
VA_UNUSED.INIT Value is Never Used after Initialization 0.1.1 Pre-2020.1

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