MISRA C:2023 C11 rules mapped to Klocwork checkers
Guideline | Category | Checker name and description |
---|---|---|
Dir. 1.1 | Required | |
Dir. 2.1 | Required | |
Dir. 3.1 | Required | |
Dir 4.1 | Required |
ABV.ANY_SIZE_ARRAY Buffer Overflow - Array Index Out of Bounds ABV.GENERAL Buffer Overflow - Array Index Out of Bounds ABV.GENERAL.MULTIDIMENSION Buffer Overflow - Array Index Out of Bounds ABV.ITERATOR Buffer Overflow - Array Index may be out of Bounds ABV.MEMBER Buffer Overflow - Array Index Out of Bounds ABV.STACK Buffer Overflow - Local Array Index Out of Bounds ABV.UNICODE.BOUND_MAP Buffer overflow in mapping character function ABV.UNICODE.FAILED_MAP Mapping function failed ABV.UNICODE.NNTS_MAP Buffer overflow in mapping character function ABV.UNICODE.SELF_MAP Mapping function failed ABV.UNKNOWN_SIZE Buffer Overflow - Array Index Out of Bounds DBZ.CONST Division by a zero constant occurs DBZ.CONST.CALL The value '0' is passed to function that can use this value as divisor DBZ.GENERAL Division by zero might occur DBZ.ITERATOR Division by zero might occur in a loop iterator DBZ.ITERATOR.CALL Division by zero might occur in a function call NUM.OVERFLOW.DF Possible numeric overflow or wraparound UNINIT.CTOR.MIGHT Uninitialized Variable in Constructor - possible UNINIT.CTOR.MUST Uninitialized Variable in Constructor UNINIT.HEAP.MIGHT Uninitialized Heap Use - possible UNINIT.HEAP.MUST Uninitialized Heap Use UNINIT.STACK.ARRAY.MIGHT Uninitialized Array - possible UNINIT.STACK.ARRAY.MUST Uninitialized Array UNINIT.STACK.ARRAY.PARTIAL.MUST Partially Uninitialized Array UNINIT.STACK.MIGHT Uninitialized Variable - possible UNINIT.STACK.MUST Uninitialized Variable |
Dir 4.2 | Advisory |
MISRA.ASM.ENCAPS Assembly language is not isolated. |
Dir 4.3 | Required |
MISRA.ASM.ENCAPS Assembly language is not isolated. |
Dir 4.4 | Advisory |
MISRA.TOKEN.COMMENTED.CODE Comment appears to contain commented out source code |
Dir. 4.5 | Advisory | |
Dir 4.6 | Advisory |
MISRA.BUILTIN_NUMERIC Builtin numeric type is used |
Dir 4.7 | Required |
SV.RVT.RETVAL_NOTTESTED Ignored Return Value |
Dir 4.8 | Advisory |
MISRA.STRUCT_DEF.HIDDEN.2012 If a pointer to a structure or union is never dereferenced within a translation unit, then the implementation of the object should be hidden |
Dir 4.9 | Advisory |
MISRA.DEFINE.FUNC Function-like macro definition |
Dir 4.10 | Required |
MISRA.INCGUARD Include guard is not provided |
Dir. 4.11 | Required | |
Dir. 4.12 | Required | |
Dir. 4.13 | Advisory | |
Dir 4.14 | Required |
ABV.TAINTED Buffer Overflow from Unvalidated Input NNTS.TAINTED Unvalidated User Input Causing Buffer Overflow - Non-Null Terminated String SV.TAINTED.ALLOC_SIZE Use of Unvalidated Integer in Memory Allocation SV.TAINTED.BINOP Use of Unvalidated Integer in Binary Operation SV.TAINTED.CALL.BINOP Use of Unvalidated Integer in Binary Operation SV.TAINTED.CALL.DEREF Dereference Of An Unvalidated Pointer SV.TAINTED.CALL.INDEX_ACCESS Use of Unvalidated Integer as Array Index by Function Call SV.TAINTED.CALL.LOOP_BOUND Use of Unvalidated Integer in Loop Condition through a Function Call SV.TAINTED.DEREF Dereference Of An Unvalidated Pointer SV.TAINTED.FMTSTR Use of Unvalidated Data in a Format String SV.TAINTED.INDEX_ACCESS Use of Unvalidated Integer as Array Index SV.TAINTED.INJECTION Command Injection SV.TAINTED.LOOP_BOUND Use of Unvalidated Integer in Loop Condition SV.TAINTED.PATH_TRAVERSAL Use of Unvalidated Data in a Path Traversal SV.TAINTED.SECURITY_DECISION Security Decision |
Dir. 4.15 | Required | |
Dir. 5.1 | Required | |
Dir. 5.2 | Required | |
Dir. 5.3 | Required | |
Rule 1.2 | Advisory |
MISRA.LANG.EXTENSIONS Language extensions should not be used |
Rule 1.4 | Required |
MISRA.INCL.LANG.FEATURES.2012 Emergent language feature headers should not be used MISRA.INCL.LANG.FEATURES.MT.2012 Emergent multithreading language feature headers should not be used MISRA.LANG.FEATURES.2012 Emergent language features should not be used MISRA.LANG.FEATURES.MT.2012 Emergent multithreading language features should not be used |
Rule 2.1 | Required |
UNREACH.ENUM Code is unreachable due to the possible value(s) of an enum UNREACH.GEN Unreachable code UNREACH.RETURN Unreachable Void Return |
Rule 2.2 | Required |
EFFECT Statement has no effect LV_UNUSED.GEN Local variable unused VA_UNUSED.GEN Value is Never Used after Assignment VA_UNUSED.INIT Value is Never Used after Initialization |
Rule 2.3 | Advisory |
MISRA.UNUSED.LOCAL_TYPE A project should not contain unused type declarations |
Rule 2.4 | Advisory |
MISRA.UNUSED.ENUM_TAG A project should not contain unused tag declarations |
Rule 2.5 | Advisory | |
Rule 2.6 | Advisory |
LA_UNUSED Label unused |
Rule 2.7 | Advisory |
MISRA.FUNC.UNUSEDPAR.2012 Unused parameters in functions |
Rule 3.1 | Required |
MISRA.TOKEN.BADCOM Inappropriate character sequence in a comment |
Rule 3.2 | Required |
MISRA.TOKEN.CPCOM.MULTILINE.2012 Line-splicing used in a // comment |
Rule 4.1 | Required |
MISRA.TOKEN.UNTERMINATED.ESCAPE.2012 Unterminated escape sequence in a string literal |
Rule 4.2 | Advisory |
MISRA.CHAR.TRIGRAPH Trigraph usage |
Rule 5.1 | Required |
MISRA.EXT.IDENT.DISTINCT.2012.C99 External identifiers must be distinct within the limits imposed by the implementation. |
Rule 5.2 | Required |
MISRA.IDENT.DISTINCT.C99.2012 Identifiers declared in the same scope or name space are not distinct |
Rule 5.3 | Required |
MISRA.VAR.HIDDEN Identifier declared in an inner scope hides identifier in outer scope |
Rule 5.4 | Required |
MISRA.DEFINE.NOT_DISTINCT.C99.2012 Identifier name is too long |
Rule 5.5 | Required | |
Rule 5.6 | Required |
MISRA.TYPEDEF.NOT_UNIQUE.2012 Typedef name is used for another entity |
Rule 5.7 | Required |
MISRA.CT.UNIQUE.ID.2012 Identifier clashes with tag name |
Rule 5.8 | Required |
MISRA.IDENT.NONUNIQUE.EXTERNAL.2012 Identifiers that define objects or functions with external linkage shall be unique. |
Rule 5.9 | Advisory |
MISRA.IDENT.NONUNIQUE.INTERNAL.2012 Identifiers that define objects or functions with internal linkage should be unique. |
Rule 6.1 | Required |
MISRA.BITFIELD.TYPE.2012 Type of bit-field is neither bool, nor signed/unsigned integer |
Rule 6.2 | Required |
MISRA.BITFIELD.SIGNED Length of a named signed bit-field is less than 2 |
Rule 6.3 | Required |
MISRA.BITFIELD.UNION Union contains bit field(s) as member(s) |
Rule 7.1 | Required |
MISRA.TOKEN.OCTAL.INT Usage of octal integer constants |
Rule 7.2 | Required |
MISRA.LITERAL.UNSIGNED.SUFFIX Unsigned integer literal without 'U' suffix |
Rule 7.3 | Required |
MISRA.TOKEN.L.SUFFIX.FLOAT Usage of lowercase character "l" suffix in floating constant MISRA.TOKEN.L.SUFFIX.INT Usage of lowercase character "l" suffix in integer constant |
Rule 7.4 | Required |
MISRA.STRING_LITERAL.NON_CONST.2012 A string literal shall not be assigned to an object unless the object's type is pointer to const-qualified char |
Rule 7.5 | Mandatory |
MISRA.INTEGER_CONSTANT.MACRO.FLOAT_VALUE The argument of an integer-constant macro must not be a floating-point number MISRA.INTEGER_CONSTANT.MACRO.RANGE The argument of an integer-constant macro must be within the range MISRA.INTEGER_CONSTANT.MACRO.SUFFIX The argument of an integer-constant macro must be an unsuffixed integer constant |
Rule 8.2 | Required |
MISRA.FUNC.NO_PARAMS Function without parameters is missing void parameter type MISRA.FUNC.PROT_FORM.KR.2012 Function types shall be in prototype form MISRA.FUNC.UNMATCHED.PARAMS Number of formal and actual parameters passed to function do not match MISRA.FUNC.UNNAMED.PARAMS Function declaration has unnamed parameters |
Rule 8.3 | Required |
EMENDA.EAA.FUNC.DECL.TYPE.QUAL MISRA.DECL.FUNC.NAME.QUAL.2012 All declarations of an object or function shall use the same name and type qualifiers |
Rule 8.4 | Required |
MISRA.FUNC.NOPROT.DEF.2012 Function has a definition but no prototype |
Rule 8.5 | Required |
MISRA.DECL.EXTERNAL.MULTIPLE Declaration of object or function with external linkage shall exist only in one location. |
Rule 8.6 | Required |
MISRA.DEFINE.EXTERNAL.MULTIPLE Definition of object or function with external linkage shall exist only in one location. |
Rule 8.7 | Advisory |
MISRA.EXT.LINKAGE.REDUNDANT.2012 Functions and objects should not be defined with external linkage if they are referenced in only one translation unit |
Rule 8.8 | Required |
MISRA.FUNC.STATIC.REDECL Function or object redeclaration does not include 'static' modifier |
Rule 8.9 | Advisory |
CXX.ID_VIS.GLOBAL_VARIABLE.EXTERN Visibility of extern global variable is too wide CXX.ID_VIS.GLOBAL_VARIABLE.STATIC Visibility of static global variable is too wide |
Rule 8.10 | Required |
MISRA.DECL.FUNC.INLINE.STATIC.2012 Declaration of inline function without static storage class |
Rule 8.11 | Advisory |
MISRA.DECL.ARRAY_SIZE Declaration of array with unknown size |
Rule 8.12 | Required |
MISRA.ENUM.IMPLICIT.VAL.NON_UNIQUE.2012 Implicit enumerator value is not unique |
Rule 8.13 | Advisory |
MISRA.PPARAM.NEEDS.CONST Pointer parameter is not used to modify the addressed object but is not declared as a pointer to const |
Rule 8.14 | Required |
MISRA.TYPE.RESTRICT.QUAL.2012 The restrict type qualifier shall not be used |
Rule 9.1 | Mandatory |
UNINIT.HEAP.MIGHT Uninitialized Heap Use - possible UNINIT.HEAP.MUST Uninitialized Heap Use UNINIT.STACK.ARRAY.MIGHT Uninitialized Array - possible UNINIT.STACK.ARRAY.MUST Uninitialized Array UNINIT.STACK.ARRAY.PARTIAL.MUST Partially Uninitialized Array UNINIT.STACK.MIGHT Uninitialized Variable - possible UNINIT.STACK.MUST Uninitialized Variable |
Rule 9.2 | Required |
MISRA.INIT.BRACES.2012 The initializer for an aggregate or union is not enclosed in braces |
Rule 9.3 | Required |
MISRA.INIT.PARTIAL.2012 Array is partially initialized |
Rule 9.4 | Required |
MISRA.INIT.MULTIPLE.2012 An element of an object is initialized more than once |
Rule 9.5 | Required |
MISRA.INIT.SIZE.IMPLICIT.2012 A designated initializer is used to initialize an array object when the size of the array is not specified explicitly |
Rule 10.1 | Required |
MISRA.ETYPE.INAPPR.OPERAND.BINOP.2012 Operand(s) to a binary operator have inappropriate essential type MISRA.ETYPE.INAPPR.OPERAND.INDEXPR.2012 Index expression has inappropriate essential type MISRA.ETYPE.INAPPR.OPERAND.TERNOP.2012 First operand to a ternary operator has inappropriate essential type MISRA.ETYPE.INAPPR.OPERAND.UNOP.2012 Operand to a unary operator has inappropriate essential type |
Rule 10.2 | Required |
MISRA.ETYPE.INAPPR.CHAR.2012 Inappropriate usage of Essentially Character type in an addition or subtraction operation |
Rule 10.3 | Required |
MISRA.ETYPE.ASSIGN.2012 Assignment to an object of a narrower essential type or a different essential type category |
Rule 10.4 | Required |
MISRA.ETYPE.CATEGORY.DIFFERENT.2012 The operands of an operator in which the usual arithmetic conversions are performed do not have the same essential type category |
Rule 10.5 | Advisory |
MISRA.ETYPE.INAPPR.CAST.2012 The value of an expression is cast to an inappropriate essential type |
Rule 10.6 | Required |
MISRA.ETYPE.COMP.ASSIGN.2012 The value of a composite expression is assigned to an object with a wider essential type |
Rule 10.7 | Required |
MISRA.ETYPE.COMP.CAST.IMPL.WIDER.2012 A composite expression used as an operand of an operator in which the usual arithmetic conversions are performed has its other operand having a wider essential type |
Rule 10.8 | Required |
MISRA.ETYPE.COMP.CAST.EXPL.DIFFERENT.2012 The value of a composite expression is cast to a different essential type category MISRA.ETYPE.COMP.CAST.EXPL.WIDER.2012 The value of a composite expression is cast to a wider essential type |
Rule 11.1 | Required |
MISRA.CAST.FUNC_PTR.2012 Conversion performed between a pointer to a function and another incompatible type |
Rule 11.2 | Required |
MISRA.CAST.INCOMPLETE_PTR_TO_ANY.2012 Conversion performed between a pointer to an incomplete type and a different type |
Rule 11.3 | Required |
MISRA.CAST.OBJ_PTR_TO_OBJ_PTR.2012 Cast between a pointer to object type and a pointer to a different object type |
Rule 11.4 | Advisory |
MISRA.CAST.OBJ_PTR_TO_INT.2012 Conversion performed between a pointer to an object and an integer type |
Rule 11.5 | Advisory |
MISRA.CAST.VOID_PTR_TO_OBJ_PTR.2012 Conversion performed from a pointer to void to a pointer to an object |
Rule 11.6 | Required |
MISRA.CAST.VOID_PTR_TO_INT.2012 Cast between a pointer to void and an arithmetic type |
Rule 11.7 | Required |
MISRA.CAST.OBJ_PTR_TO_NON_INT.2012 A cast between a pointer to object and a non-integer arithmetic type |
Rule 11.8 | Required |
MISRA.CAST.CONST Cast operation removes const or volatile modifier from a pointer or reference |
Rule 11.9 | Required |
MISRA.LITERAL.NULL.PTR.CONST.2012 The macro NULL is the only permitted form of integer null pointer constant |
Rule 12.1 | Advisory |
MISRA.EXPR.PARENS.2012 The precedence of operators within expressions should be made explicit. MISRA.EXPR.PARENS.SIZEOF.2012 The operand of the sizeof operator should be parenthesized. |
Rule 12.2 | Required |
MISRA.SHIFT.RANGE.2012 Right operand of shift operation is out of range - greater or equal to the essential type size of left operand, or is negative |
Rule 12.3 | Advisory |
MISRA.COMMA Comma operator is used |
Rule 12.4 | Advisory |
MISRA.COMP.WRAPAROUND Wrap-around in a condition |
Rule 12.5 | Mandatory |
MISRA.EXPR.SIZEOF.ARRAY_PARAM.2012_AMD1 The sizeof operator has an operand which is a function parameter declared as "array of type" |
Rule 13.1 | Required |
MISRA.INIT.SIDE_EFFECT Initializer list value contains persistent side effects |
Rule 13.2 | Required |
PORTING.VAR.EFFECTS Variable used twice in one expression where one usage is subject to side-effects |
Rule 13.3 | Advisory |
MISRA.INCR_DECR.SIDEEFF.2012 A 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.4 | Advisory |
MISRA.ASSIGN.SUBEXPR.2012 The result of an assignment operator is used |
Rule 13.5 | Required |
MISRA.LOGIC.SIDEEFF Right operand in a logical 'and' or 'or' expression contains side effects |
Rule 13.6 | Required |
MISRA.SIZEOF.SIDE_EFFECT Operand of sizeof has side effects |
Rule 14.1 | Required |
MISRA.FOR.COUNTER.FLT For loop counter has a floating point type |
Rule 14.2 | Required |
MISRA.FOR.BODY.LOOP_CTR_MODIFIED The loop counter should not be modified in the loop body MISRA.FOR.BODY.LOOP_CTR_MODIFIED.MIGHT The loop counter should not be modified in the loop body MISRA.FOR.COND.COUNTER_UNUSED Loop second clause shall use the loop counter MISRA.FOR.COND.INVALID_USE Loop second clause shall not used any object that is modified in the loop body MISRA.FOR.COND.INVALID_USE.MIGHT Loop second clause shall not used any object that is modified in the loop body MISRA.FOR.COND.PURE Loop second clause shall be a single expression with no persistent side effects MISRA.FOR.COND.SINGLE_PURE Loop second clause shall be a single expression with no persistent side effects MISRA.FOR.ITER_EXPR.INVALID_USE Loop third clause shall not used any object that is modified in the loop body MISRA.FOR.ITER_EXPR.INVALID_USE.MIGHT Loop third clause shall not used any object that is modified in the loop body MISRA.FOR.ITER_EXPR.MULTI_SIDE_EFFECTS Loop third clause shall only contain persistent side effect to the loop counter MISRA.FOR.ITER_EXPR.ONE_EXPR Loop third clause shall be a single expression MISRA.FOR.MULTI_INIT Loop first clause shall be empty or assign a value to the loop counter MISRA.FOR.UNINIT_COUNTER Loop first clause shall be empty or assign a value to the loop counter |
Rule 14.3 | Required |
INVARIANT_CONDITION.GEN Invariant expression in a condition INVARIANT_CONDITION.UNREACH Invariant expression in a condition |
Rule 14.4 | Required |
MISRA.STMT.COND.NOT_BOOLEAN.2012 The controlling expression of an if statement or loop statement is not 'Essentially Boolean' type |
Rule 15.1 | Advisory |
MISRA.GOTO Goto statement is used |
Rule 15.2 | Required |
MISRA.GOTO.AFTER_LABEL.2012 Goto jumps to label declared before in same function. |
Rule 15.3 | Required |
MISRA.GOTO.NESTED.2012 Label referenced by goto is not in this or enclosing block. |
Rule 15.4 | Advisory |
MISRA.BREAK_OR_GOTO.MULTIPLE.2012 Iteration statement has more than one break or goto for loop termination. |
Rule 15.5 | Advisory |
MISRA.RETURN.NOT_LAST Return is not the last statement in a function |
Rule 15.6 | Required |
MISRA.IF.NO_COMPOUND The body of if/else statement is not a compound statement MISRA.STMT.NO_COMPOUND The body of switch, while, do/while or for statement is not a compound statement |
Rule 15.7 | Required |
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 16.1 | Required |
MISRA.SWITCH.WELL_FORMED.2012 All switch statements shall be well-formed. |
Rule 16.2 | Required |
MISRA.SWITCH.WELL_FORMED.NESTED_LABEL.2012 A switch label shall only be used when the most closely-enclosing compound statement is the body of the switch statement. |
Rule 16.3 | Required |
MISRA.SWITCH.WELL_FORMED.BREAK.2012 An unconditional break statement shall terminate every switch-clause. |
Rule 16.4 | Required |
MISRA.SWITCH.WELL_FORMED.DEFAULT.2012 Every switch statement shall have a default label. |
Rule 16.5 | Required |
MISRA.SWITCH.WELL_FORMED.DEFAULT.FIRST_OR_LAST.2012 A default label shall appear as either the first or the last switch label of a switch statement. |
Rule 16.6 | Required |
MISRA.SWITCH.WELL_FORMED.TWO_CLAUSES.2012 Every switch statement shall have at least two switch-clauses. |
Rule 16.7 | Required |
MISRA.SWITCH.COND.BOOL.2012 A switch-expression shall not have essentially Boolean type. |
Rule 17.1 | Required |
MISRA.FUNC.VARARG Function with variable number of arguments |
Rule 17.2 | Required |
MISRA.FUNC.RECUR Recursive function |
Rule 17.4 | Mandatory |
FUNCRET.GEN Non-void function does not return value FUNCRET.IMPLICIT Non-void function implicitly returning int does not return value |
Rule 17.5 | Required |
MISRA.ARRAY.ARG_SIZE Array argument should be appropriate size MISRA.ARRAY.ARG_SIZE.MIGHT Array argument should be appropriate size |
Rule 17.6 | Mandatory |
MISRA.FUNC.ARRAY.PARAM.STATIC.2012 The declaration of an array parameter shall not contain the static keyword between the [] |
Rule 17.7 | Required |
MISRA.FUNC.UNUSEDRET.2012 The return value of a non-void function shall be used. |
Rule 17.8 | Advisory |
MISRA.FUNC.MODIFIEDPAR.2012 A function parameter should not be modified |
Rule 18.1 | Required |
ABV.GENERAL Buffer Overflow - Array Index Out of Bounds ABV.GENERAL.MULTIDIMENSION Buffer Overflow - Array Index Out of Bounds ABV.STACK Buffer Overflow - Local Array Index Out of Bounds MISRA.PTR.ARITH.NOT_SAME.2012 A pointer resulting from arithmetic on a pointer operand shall address an element of the same array as that pointer operand |
Rule 18.2 | Required |
MISRA.PTR.SUB Pointer subtraction shall only be applied if pointing to same array MISRA.PTR.SUB.OBJECT Pointer subtraction shall only be applied if pointing to same object |
Rule 18.3 | Required |
MISRA.PTR.CMP.2008 Pointer comparison using comparison operators shall only be applied if pointing to same array and within the range MISRA.PTR.CMP.OBJECT.2008 Pointer comparison using comparison operators shall only be applied if pointing to same object and within the range |
Rule 18.4 | Advisory |
MISRA.PTR.ARITH.2012 Pointer is used in arithmetic expression |
Rule 18.5 | Advisory |
MISRA.PTR.TO_PTR_TO_PTR Pointer declaration has more than two levels of indirection |
Rule 18.6 | Required |
LOCRET.ARG Function returns address of local variable LOCRET.GLOB Function returns address of local variable LOCRET.RET Function returns address of local variable |
Rule 18.7 | Required |
MISRA.MEMB.FLEX_ARRAY.2012 Flexible array member shall not be declared |
Rule 18.8 | Required |
MISRA.ARRAY.VAR_LENGTH.2012 Variable-length array types shall not be used |
Rule 19.1 | Mandatory |
MISRA.ASSIGN.OVERLAP Object is assigned to an overlapping object |
Rule 19.2 | Advisory |
MISRA.UNION Union is used |
Rule 20.1 | Advisory |
MISRA.INCL.INSIDE Include directive preceded by a preprocessor output token |
Rule 20.2 | Required |
MISRA.INCL.SYMS Non-standard characters in header file names |
Rule 20.3 | Required |
MISRA.INCL.BAD Non-standard include directive |
Rule 20.4 | Required |
MISRA.DEFINE.WRONGNAME.C99.2012 A macro shall not be defined with the same name as a keyword |
Rule 20.5 | Advisory |
MISRA.UNDEF Undef usage |
Rule 20.6 | Required |
MISRA.EXPANSION.DIRECTIVE Directive-like tokens within a macro argument |
Rule 20.7 | Required |
MISRA.MACRO_ARG.EXPRESSION.2012 Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses |
Rule 20.8 | Required |
MISRA.ELIF.COND.NOT_BOOL.2012 #elif condition is not 0 or 1 MISRA.IF.COND.NOT_BOOL.2012 #if condition is not 0 or 1 |
Rule 20.9 | Required |
MISRA.ELIF.UNDEF Undefined macros in #elif directive MISRA.IF.UNDEF Undefined macros in #if directive |
Rule 20.10 | Advisory |
MISRA.DEFINE.SHARP # or ## operator in a macro definition |
Rule 20.11 | Required |
MISRA.DEFINE.SHARP.ORDER.2012 Unspecified order of evaluation of multiple '#' or '##' |
Rule 20.12 | Required |
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 |
Rule 20.13 | Required |
MISRA.USE.UNKNOWNDIR Unknown preprocessor directive is used |
Rule 20.14 | Required |
MISRA.ELIF.OTHERFILE #elif in an improper file MISRA.ELSE.OTHERFILE #else in an improper file MISRA.ENDIF.OTHERFILE #endif in an improper file |
Rule 21.1 | Required |
MISRA.DEFINE.WRONGNAME Usage of a name from the standard library for naming a macro MISRA.DEFINE.WRONGNAME.UNDERSCORE Usage of a reserved name for naming a macro MISRA.UNDEF.WRONGNAME Undefinition of a name from the standard library MISRA.UNDEF.WRONGNAME.UNDERSCORE Undefinition of a reserved name |
Rule 21.2 | Required |
MISRA.STDLIB.WRONGNAME Reused name of standard library macro, object or function MISRA.STDLIB.WRONGNAME.UNDERSCORE Usage of a reserved name for naming a language entity |
Rule 21.3 | Required |
MISRA.STDLIB.MEMORY Use of dynamic heap memory allocation |
Rule 21.4 | Required |
MISRA.STDLIB.LONGJMP Use of setjmp macro or longjmp function |
Rule 21.5 | Required |
MISRA.INCL.SIGNAL.2012 The standard header file signal.h shall not be used MISRA.STDLIB.SIGNAL Use of the signal handling facilities of signal.h |
Rule 21.6 | Required |
MISRA.DEFINE.STDIO.WCHAR.2012 Inappropriate macro expansion MISRA.INCL.STDIO.2012 The standard header files stdio.h shall not be used MISRA.STDLIB.STDIO Use of input/output library stdio.h in production code MISRA.STDLIB.STDIO.WCHAR.2012 Wide-character equivalent identifiers from stdio.h shall not be used |
Rule 21.7 | Required |
MISRA.STDLIB.ATOI Use of 'atof', 'atoi' or 'atol' from library stdlib.h |
Rule 21.8 | Required |
MISRA.STDLIB.ABORT.2012_AMD2 Use of 'abort', 'exit', 'quick_exit' or '_Exit' from library stdlib.h |
Rule 21.9 | Required |
MISRA.STDLIB.BSEARCH.2012 Use of 'bsearch' or 'qsort' from library stdlib.h |
Rule 21.10 | Required |
MISRA.DEFINE.WCSFTIME.2012 No macro with 'wcsftime' name shall be expanded MISRA.INCL.TIME.2012 The standard header file time.h shall not be used MISRA.STDLIB.TIME Use of the time handling functions of library time.h MISRA.STDLIB.WCSFTIME.2012 The identifier 'wcsftime' shall not be used |
Rule 21.11 | Advisory |
MISRA.INCL.TGMATH.2012 The standard header file tgmath.h shall not be used |
Rule 21.12 | Required |
MISRA.STDLIB.FENV.2012 Floating-point exception feature from fenv.h is used MISRA.STDLIB.FENV.MACRO.2012 Floating-point exception feature from fenv.h is used |
Rule 21.13 | Mandatory |
MISRA.STDLIB.CTYPE.ARG_VAL Any value passed to a function in <ctype.h> shall be representable as an unsigned char or be the value of EOF MISRA.STDLIB.CTYPE.RANGE.2012_AMD1 Any value passed to a function in ctype.h shall be representable as an unsigned char or be the value EOF |
Rule 21.14 | Required |
MISRA.MEMCMP.NTS.2012_AMD1 The memcmp function shall only be used to compare non null terminated strings MISRA.MEMCMP.NTS.GLOBAL.2012_AMD1 The memcmp function shall only be used to compare non null terminated strings |
Rule 21.15 | Required |
MISRA.STDLIB.INCOMPAT_ARGS.2012_AMD1 The pointer arguments to memcpy, memmove, or memcmp are not pointers to compatible types |
Rule 21.16 | Required |
MISRA.STDLIB.MEMCMP.PTR_ARG_TYPES The pointer arguments to the Standard Library function memcmp shall point to either a pointer type, an essentially signed type, an essentially unsigned type, an essentially Boolean type or an essentially enum type |
Rule 21.17 | Mandatory |
ABV.ANY_SIZE_ARRAY Buffer Overflow - Array Index Out of Bounds ABV.GENERAL Buffer Overflow - Array Index Out of Bounds ABV.GENERAL.MULTIDIMENSION Buffer Overflow - Array Index Out of Bounds ABV.MEMBER Buffer Overflow - Array Index Out of Bounds ABV.STACK Buffer Overflow - Local Array Index Out of Bounds ABV.UNKNOWN_SIZE Buffer Overflow - Array Index Out of Bounds NNTS.MIGHT Buffer Overflow - Non-null Terminated String NNTS.MUST Buffer Overflow - Non-null Terminated String |
Rule 21.18 | Mandatory |
ABV.ANY_SIZE_ARRAY Buffer Overflow - Array Index Out of Bounds ABV.GENERAL Buffer Overflow - Array Index Out of Bounds ABV.GENERAL.MULTIDIMENSION Buffer Overflow - Array Index Out of Bounds ABV.MEMBER Buffer Overflow - Array Index Out of Bounds ABV.STACK Buffer Overflow - Local Array Index Out of Bounds ABV.UNKNOWN_SIZE Buffer Overflow - Array Index Out of Bounds |
Rule 21.19 | Mandatory |
MISRA.STDLIB.ILLEGAL_WRITE.2012_AMD1 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 MISRA.STDLIB.RET.NONCONST_PTR.LOCAL The pointers returned by the Standard Library functions localeconv, getenv, setlocale or, strerror shall only be used as if they have the pointer to const-qualified type |
Rule 21.20 | Mandatory |
MISRA.STDLIB.ILLEGAL_REUSE.2012_AMD1 The pointer returned by the Standard Library functions asctime and similar shall not be used following a subsequent call to the same function |
Rule 21.21 | Required |
MISRA.STDLIB.SYSTEM.2012_AMD2 Use of 'system' from library stdlib.h |
Rule 22.1 | Required |
MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak MLK.RET.MIGHT Memory Leak - possible MLK.RET.MUST Memory Leak RH.LEAK Resource leak |
Rule 22.2 | Mandatory |
FMM.MIGHT Freeing Mismatched Memory - possible FMM.MUST Freeing Mismatched Memory FNH.MIGHT Freeing Non-Heap Memory - possible FNH.MUST Freeing Non-Heap Memory FUM.GEN.MIGHT Freeing Unallocated Memory - possible FUM.GEN.MUST Freeing Unallocated Memory |
Rule 22.3 | Required |
MISRA.RESOURCES.FILE.OPEN_READ_WRITE.2012 Multiple streams opened for same file |
Rule 22.4 | Mandatory |
MISRA.RESOURCES.FILE.READ_ONLY_WRITE.2012 There shall be no attempt to write to a stream which has been opened as read-only |
Rule 22.5 | Mandatory |
MISRA.FILE_PTR.DEREF.2012 A pointer to a FILE object shall not be dereferenced MISRA.FILE_PTR.DEREF.CAST.2012 Object is casted to a FILE pointer, and it shall not be dereferenced MISRA.FILE_PTR.DEREF.INDIRECT.2012 A pointer to a FILE object shall not be indirectly dereferenced by a system function MISRA.FILE_PTR.DEREF.RETURN.2012 A pointer to a FILE object (returned by function) shall not be dereferenced |
Rule 22.6 | Mandatory |
MISRA.RESOURCES.FILE.USE_AFTER_CLOSE.2012 The value of a pointer to a FILE shall not be used after the associated stream has been closed |
Rule 22.7 | Required |
MISRA.STDLIB.EOF.BAD_CMP.2012_AMD1 The macro EOF shall only be compared with the unmodified return value from any Standard Library function capable of returning EOF |
Rule 22.8 | Required |
CXX.ERRNO.NOT_SET Errno is not reset to zero before calling library function |
Rule 22.9 | Required |
CXX.ERRNO.NOT_CHECKED Errno condition check is missing after calling library function |
Rule 22.10 | Required |
CXX.ERRNO.INCORRECTLY_CHECKED Errno condition check not required after calling library function |
"MISRA", "MISRA C" and "MISRA C++" are registered trademarks of The MISRA Consortium Limited.