AUTOSAR 18-10: C and C++
You can use the AUTOSAR C++14 taxonomy to ensure compliance with the AUTOSAR C++14 Standard, release 18-10. The AUTOSAR C++14 (18-10) taxonomy detects violations of our both our Klocwork C/C++ checkers and our MISRA checkers.
| Rule | Checker name and description |
|---|---|
| A0-1-2 (Required): The value returned by a function having a non-void return type that is not an overloaded operator shall be used. |
MISRA.FUNC.UNUSEDRET Return value of a non-void function is not used |
| A0-1-4 (Required): There shall be no unused named parameters in non-virtual functions. |
MISRA.FUNC.UNUSEDPAR Formal parameter of a non-virtual function is not used |
| A0-1-5 (Required): There shall be no unused named parameters in the set of parameters for a virtual function and all the functions that override it. |
MISRA.FUNC.VIRTUAL.UNUSEDPAR Formal parameter of a virtual function set is not used |
| A0-4-2 (Required): Type long double shall not be used. |
AUTOSAR.TYPE.LONG_DOUBLE Type long double shall not be used |
| A2-5-1 (Required): Trigraphs shall not be used. |
MISRA.CHAR.TRIGRAPH Trigraph usage |
| A2-5-2 (Required): Digraphs shall not be used. |
MISRA.CHAR.DIGRAPH Digraph usage |
| A2-7-2 (Required): Sections of code shall not be “commented out”. |
MISRA.TOKEN.COMMENTED.CODE Comment appears to contain commented out source code |
| A2-10-5 (Advisory): An identifier name of a function with static storage duration or a non-member object with external or internal linkage should not be reused. |
MISRA.VAR.UNIQUE.STATIC Identifier with static storage specifier clashes with other identifier |
| A2-10-6 (Required): A class or enumeration name shall not be hidden by a variable, function or enumerator declaration in the same scope. |
MISRA.TYPE.NAMECLASH.CPP.2008 Identifier in one name space has same spelling as identifier in other name space |
| A2-11-1 (Required): Volatile keyword shall not be used. |
AUTOSAR.TYPE.QUAL.VOLATILE The volatile type qualifier shall not be used |
| A2-13-1 (Required): Only those escape sequences that are defined in ISO/IEC 14882:2014 shall be used. |
MISRA.TOKEN.WRONGESC.CPP.2008 Incorrect escape sequence in a literal |
| A2-13-3 (Required): Type wchar_t shall not be used. |
AUTOSAR.TYPE.WCHAR_T Type wchar_t shall not be used |
| A2-13-4 (Required): String literals shall not be assigned to non-constant pointers. |
AUTOSAR.ADD.STR.TO.NON.CONST String literals shall not be assigned to non-constant pointers |
| A2-13-5 (Advisory): Hexadecimal constants should be upper case. |
AUTOSAR.HEX.UPPER Hexadecimal constants should be upper case |
| A3-1-1 (Required): It shall be possible to include any header file in multiple translation units without violating the One Definition Rule. |
AUTOSAR.ADD.ONEDEFRULE.FUNC Function is violating one definition rule AUTOSAR.ADD.ONEDEFRULE.VAR Variable is violating one definition rule |
| A3-1-3 (Advisory): Implementation files, that are defined locally in the project, should have a file name extension of ".cpp". |
AUTOSAR.ADD.FILE.EXT Local implementation files not having .cpp file extension |
| A3-1-4 (Required): When an array with external linkage is declared, its size shall be stated explicitly. |
MISRA.DECL.ARRAY_SIZE Declaration of array with unknown size |
| A3-1-5 (Required): A function definition shall only be placed in a class definition if (1) the function is intended to be inlined (2) it is a member function template (3) it is a member function of a class template. |
AUTOSAR.FUNC.INLINE_DEF A function definition shall only be placed in a class definition if (1) the function is intended to be inlined (2); it is a member function template; (3) it is a member function of a class template |
| A3-3-1 (Required): Objects or functions with external linkage (including members of named namespaces) shall be declared in a header file. |
MISRA.LINKAGE.EXTERN Object or function declaration with external linkage not in header file |
| A3-9-1 (Required): Fixed width integer types from <cstdint>, indicating the size and signedness, shall be used in place of the basic numerical types. |
AUTOSAR.BUILTIN_NUMERIC Fixed width integer types from <cstdint> shall be used in place of the basic numerical types |
| A4-5-1 (Required): Expressions with type enum or enum class shall not be used as operands to built-in and overloaded operators. |
AUTOSAR.ADD.ENUM.OP Enum shall not be used in arithmetic context |
| A4-10-1 (Required): Only nullptr literal shall be used as the null-pointer-constant. |
AUTOSAR.ADD.NULLPTR Only nullptr literal shall be used as the null-pointer-constant |
| A5-0-1 (Required): The value of an expression shall be the same under any order of evaluation that the standard permits. |
AUTOSAR.ADD.EXPR.EVAL.MULTI.CALL The value of an expression shall be the same under any order of evaluation that the standard permits AUTOSAR.ADD.EXPR.EVAL.VOLATILE The value of an expression shall be the same under any order of evaluation that the standard permits |
| A5-0-2 (Required): The condition of an if-statement and the condition of an iteration statement shall have type bool. |
AUTOSAR.ADD.COND.NOT.BOOL The condition of an if-statement and iteration statement shall have type bool AUTOSAR.ADD.LOGIC.NOT_BOOL The condition of an if-statement and iteration statement shall have type bool |
| A5-0-3 (Required): The declaration of objects shall contain no more than two levels of pointer indirection. |
MISRA.PTR.TO_PTR_TO_PTR Pointer declaration has more than two levels of indirection |
| A5-1-1 (Required): Literal values shall not be used apart from type initialization, otherwise symbolic names shall be used instead. |
AUTOSAR.ADD.LITERAL Literal values shall not be used apart from type initialization |
| A5-1-2 (Required): Variables shall not be implicitly captured in a lambda expression. |
AUTOSAR.LAMBDA.IMPLICIT_CAPTURE Variables shall not be implicitly captured in a lambda expression |
| A5-1-3 (Required): Parameter list (possibly empty) shall be included in every lambda expression. |
AUTOSAR.LAMBDA.NO_PARAM_LIST Parameter list (possibly empty) shall be included in every lambda expression |
| A5-1-4 (Required): A lambda expression object shall not outlive any of its reference-captured objects. |
AUTOSAR.LAMBDA.REF_LIFETIME A lambda expression object shall not outlive any of its reference-captured objects |
| A5-1-6 (Advisory): Return type of a non-void return type lambda expression should be explicitly specified. |
AUTOSAR.LAMBDA.IMPLICIT_RETURN_TYPE Return type of a non-void return type lambda expression should be explicitly specified |
| A5-1-7 (Required): A lambda shall not be an operand to decltype or typeid. |
AUTOSAR.LAMBDA.TYPE_OPERAND A lambda shall not be an operand to decltype or typeid |
| A5-1-8 (Advisory): Lambda expressions should not be defined inside another lambda expression. |
AUTOSAR.LAMBDA.NESTED Lambda expressions should not be defined inside another lambda expression |
| A5-2-1 (Advisory): dynamic_cast should not be used. |
AUTOSAR.CAST.DYNAMIC dynamic_cast should not be used |
| A5-2-2 (Required): Traditional C-style casts shall not be used. |
AUTOSAR.CAST.CSTYLE Traditional C-style casts shall not be used |
| A5-2-3 (Required): A cast shall not remove any const or volatile qualification from the type of a pointer or reference. |
MISRA.CAST.CONST Cast operation removes const or volatile modifier from a pointer or reference |
| A5-2-4 (Required): reinterpret_cast shall not be used. |
AUTOSAR.CAST.REINTERPRET reinterpret_cast shall not be used |
| A5-2-5 (Required): An array or container shall not be accessed beyond its range. |
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.NON_ARRAY Non-array object is used as an array ABV.STACK Buffer Overflow - Local Array Index Out of Bounds ABV.TAINTED Buffer Overflow from Unvalidated Input 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 |
| A5-2-6 (Required): The operands of a logical && or \\ shall be parenthesized if the operands contain binary operators. |
MISRA.LOGIC.POSTFIX Operand in a logical 'and' or 'or' expression is not a postfix expression |
| A5-3-2 (Required): Null pointers shall not be dereferenced. |
NPD.CHECK.CALL.MIGHT Pointer may be passed to function that can dereference it after it was positively checked for NULL NPD.CHECK.CALL.MUST Pointer will be passed to function that may dereference it after it was positively checked for NULL NPD.CHECK.MIGHT Pointer may be dereferenced after it was positively checked for NULL NPD.CHECK.MUST Pointer will be dereferenced after it was positively checked for NULL NPD.CONST.CALL NULL is passed to function that can dereference it NPD.CONST.DEREF NULL is dereferenced NPD.FUNC.CALL.MIGHT Result of function that may return NULL may be passed to another function that may dereference it NPD.FUNC.CALL.MUST Result of function that may return NULL will be passed to another function that may dereference it NPD.FUNC.MIGHT Result of function that can return NULL may be dereferenced NPD.FUNC.MUST Result of function that may return NULL will be dereferenced NPD.GEN.CALL.MIGHT Null pointer may be passed to function that may dereference it NPD.GEN.CALL.MUST Null pointer will be passed to function that may dereference it NPD.GEN.MIGHT Null pointer may be dereferenced NPD.GEN.MUST Null pointer will be dereferenced |
| A5-6-1 (Required): The right hand operand of the integer division or remainder operators shall not be equal to zero. |
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.GENERAL.FLOAT Division by floating-point 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 DBZ.ITERATOR.FLOAT Division by zero might occur in a loop iterator |
| A5-10-1 (Required): A pointer to member virtual function shall only be tested for equality with null-pointer-constant. |
AUTOSAR.VIRTUAL.PTR_COMPARE A pointer to member virtual function shall only be tested for equality with null-pointer-constant |
| A5-16-1 (Required): The ternary conditional operator shall not be used as a sub-expression. |
AUTOSAR.TERNARY.NESTED The ternary conditional operator shall not be used as a sub-expression |
| A6-2-1 (Required): Move and copy assignment operators shall either move or respectively copy base classes and data members of a class, without any side effects. |
AUTOSAR.ADD.ASSIGN.OP.SIDE.EFFECT Move and copy assignment operators shall either move or respectively copy base classes and data members of a class, without any side effects |
| A6-4-1 (Required): A switch statement shall have at least two case-clauses, distinct from the default label. |
AUTOSAR.SWITCH.CASECOUNT A switch statement shall have at least two case-clauses, distinct from the default label |
| A6-5-2 (Required): A for loop shall contain a single loop-counter which shall not have floating-point type. |
MISRA.FOR.COUNTER.FLT For loop counter has a floating point type MISRA.FOR.COUNTER.MANY Many counters in a for loop |
| A6-5-3 (Advisory): Do statements should not be used. |
AUTOSAR.DO Do statements should not be used |
| A6-5-4 (Advisory): For-init-statement and expression should not perform actions other than loop-counter initialization and modification. |
MISRA.FOR.COUNTER.MANY Many counters in a for loop |
| A6-6-1 (Required): The goto statement shall not be used. |
AUTOSAR.GOTO The goto statement shall not be used |
| A7-1-1 (Required): Constexpr or const specifiers shall be used for immutable data declaration. |
MISRA.VAR.NEEDS.CONST Variable is not modified but is declared without const qualifier |
| A7-1-3 (Required): CV-qualifiers shall be placed on the right hand side of the type that is a typedef or a using name. |
AUTOSAR.TYPEDEF.CVQ_EAST CV-qualifiers shall be placed on the right hand side of the type that is a typedef or a using name |
| A7-1-4 (Required): The register keyword shall not be used. |
AUTOSAR.REGISTER The register keyword shall not be used |
| A7-1-5 (Required): The auto specifier shall not be used apart from following cases: ... |
AUTOSAR.ADD.AUTO.SPECIFIER The auto specifier shall not be used here |
| A7-1-6 (Required): The typedef specifier shall not be used. |
AUTOSAR.TYPEDEF The typedef specifier shall not be used |
| A7-1-7 (Required): Each expression statement and identifier declaration shall be placed on a separate line. |
AUTOSAR.STYLE.SINGLE_DECL_PER_LINE Each expression statement and identifier declaration shall be placed on a separate line AUTOSAR.STYLE.SINGLE_STMT_PER_LINE Each expression statement and identifier declaration shall be placed on a separate line |
| A7-1-8 (Required): A non-type specifier shall be placed before a type specifier in a declaration. |
AUTOSAR.DECL.NONTYPE_SPECIFIER A non-type specifier shall be placed before a type specifier in a declaration |
| A7-1-9 (Required): A class, structure, or enumeration shall not be declared in the definition of its type. |
AUTOSAR.DECL.IN_DEFN A class, structure, or enumeration shall not be declared in the definition of its type |
| A7-2-2 (Required): Enumeration underlying base type shall be explicitly defined. |
AUTOSAR.ENUM.EXPLICIT_BASE_TYPE Enumeration underlying base type shall be explicitly defined |
| A7-2-3 (Required): Enumerations shall be declared as scoped enum classes. |
AUTOSAR.ENUM.UNSCOPED Enumerations shall be declared as scoped enum classes |
| A7-2-4 (Required): In an enumeration, either (1) none, (2) the first or (3) all enumerators shall be initialized. |
MISRA.ENUM.INIT Non-first enumerator is explicitly initialized, but not all elements are explicitly initialized. |
| A7-3-1 (Required): All overloads of a function shall be visible from where it is called. |
MISRA.NS.USING_DECL Multiple declarations for an identifier in the same namespace should not straddle a using-declaration for that identifier |
| A7-4-1 (Required): The asm declaration shall not be used. |
AUTOSAR.ASM The asm declaration shall not be used |
| A7-5-1 (Required): A function shall not return a reference or a pointer to a parameter that is passed by reference to const. |
AUTOSAR.ADD.RTN.REF.CONST.PARAM A function shall not return a reference or a pointer to a parameter that is passed by reference to const |
| A7-5-2 (Required): Functions shall not call themselves, either directly or indirectly. |
MISRA.FUNC.RECUR Recursive function |
| A8-2-1 (Required): When declaring function templates, the trailing return type syntax shall be used if the return type depends on the type of parameters. |
AUTOSAR.ADD.FUNC.TEMPLATE.TRAIL.RTN In function templates, the trailing return type syntax shall be used if the return type depends on the type of parameters |
| A8-4-1 (Required): Functions shall not be defined using the ellipsis notation. |
MISRA.FUNC.VARARG Function with variable number of arguments |
| A8-4-2 (Required): All exit paths from a function with non-void return type shall have an explicit return statement with an expression. |
FUNCRET.GEN Non-void function does not return value |
| A8-5-0 (Required): All memory shall be initialized before it is read. |
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 |
| A8-5-1 (Required): In an initialization list, the order of initialization shall be following: ... |
CWARN.MEMBER.INIT.ORDER Members of the initialization list are not listed in the order in which they are declared in the class |
| A8-5-3 (Required): A variable of type auto shall not be initialized using {} or ={} braced-initialization. |
AUTOSAR.ADD.AUTO.INIT.FORMAT A variable of type auto shall not be initialized using {} or ={} braced-initialization. |
| A8-5-4 (Advisory): If a class has a user-declared constructor that takes a parameter of type std::initializer_list, then it shall be the only constructor apart from special member function constructors. |
AUTOSAR.ADD.CTOR.INIT.LIST If a class has a user-declared constructor that takes a parameter of type std::initializer_list, then it shall be the only constructor apart from special member function constructors |
| A9-5-1 (Required): Unions shall not be used. |
AUTOSAR.UNION Unions shall not be used |
| A10-2-1 (Required): Non-virtual public or protected member functions shall not be redefined in derived classes. |
AUTOSAR.ADD.REDEF.DERIVED.FUNC Non-virtual public or protected member functions shall not be redefined in derived classes. |
| A10-3-1 (Required): Virtual function declaration shall contain exactly one of the three specifiers: (1) virtual, (2) override, (3) final. |
AUTOSAR.MEMB.VIRTUAL.SPEC Virtual function declaration shall contain exactly one of the three specifiers: (1) virtual, (2) override, (3) final. |
| A10-3-2 (Required): Each overriding virtual function shall be declared with the override or final specifier. |
AUTOSAR.ADD.OVERRIDE.VIRTUAL.SPECIFIER Each overriding virtual function shall be declared with the override or final specifier |
| A10-3-3 (Required): Virtual functions shall not be introduced in a final class. |
AUTOSAR.MEMB.VIRTUAL.FINAL Virtual functions shall not be introduced in a final class |
| A10-3-5 (Required): A user-defined assignment operator shall not be virtual. |
AUTOSAR.ADD.ASSIGN.OP.VIRTUAL A user-defined assignment operator shall not be virtual |
| A11-3-1 (Required): Friend declarations shall not be used. |
AUTOSAR.FRIEND_DECL Friend declarations shall not be used |
| A12-1-1 (Required): Constructors shall explicitly initialize all virtual base classes, all direct non-virtual base classes and all non-static data members. |
MISRA.CTOR.BASE Constructor does not explicitly call constructor of its base class |
| A12-1-2 (Required): Both NSDMI and a non-static member initializer in a constructor shall not be used in the same type. |
AUTOSAR.CTOR.NSDMI_INIT_LIST Both NSDMI and a non-static member initializer in a constructor shall not be used in the same type |
| A12-1-4 (Required): All constructors that are callable with a single argument of fundamental type shall be declared explicit. |
AUTOSAR.CTOR.NO_EXPLICIT All constructors that are callable with a single argument of fundamental type shall be declared explicit |
| A12-4-2 (Advisory): If a public destructor of a class is non-virtual, then the class should be declared final. |
AUTOSAR.DTOR.NON_VIRTUAL If a public destructor of a class is non-virtual, then the class should be declared final |
| A12-6-1 (Required): All class data members that are initialized by the constructor shall be initialized using member initializers. |
AUTOSAR.ADD.CTOR.MEMBER.INIT All class data members that are initialized by the constructor shall be initialized using member initializers |
| A12-8-4 (Required): Move constructor shall not initialize its class members and base classes using copy semantics. |
AUTOSAR.CTOR.MOVE.COPY_SEMANTICS Move constructor shall not initialize its class members and base classes using copy semantics |
| A12-8-5 (Required): A copy assignment and a move assignment operators shall handle self-assignment. |
CL.SELF-ASSIGN Use of free memory (double free) - in operator= |
| A12-8-7 (Advisory): Assignment operators should be declared with the ref-qualifier &. |
AUTOSAR.ASSIGN.REF_QUAL Assignment operators should be declared with the ref-qualifier & |
| A13-1-2 (Required): User defined suffixes of the user defined literal operators shall start with underscore followed by one or more letters. |
AUTOSAR.OP.LITERAL.SUFFIX User defined suffixes of the user defined literal operators shall start with underscore followed by one or more letters |
| A13-2-1 (Required): An assignment operator shall return a reference to “this”. |
AUTOSAR.ASSIGN.RETURN An assignment operator shall return a reference to "this" |
| A13-2-2 (Required): A binary arithmetic operator and a bitwise operator shall return a “prvalue”. |
AUTOSAR.OP.BINARY.RETVAL A binary arithmetic operator and a bitwise operator shall return a "prvalue" |
| A13-2-3 (Required): A relational operator shall return a boolean value. |
AUTOSAR.OP.RELATIONAL.RETVAL A relational operator shall return a boolean value |
| A13-5-1 (Required): If “operator[]” is to be overloaded with a non-const version, const version shall also be implemented. |
AUTOSAR.OP.INDEX.NON_CONST If "operator[]" is to be overloaded with a non-const version, const version shall also be implemented |
| A13-5-2 (Required): All user-defined conversion operators shall be defined explicit. |
AUTOSAR.OP.CONV.NON_EXPLICIT All user-defined conversion operators shall be defined explicit |
| A13-5-3 (Advisory): User-defined conversion operators should not be used. |
AUTOSAR.OP.CONV User-defined conversion operators should not be used |
| A13-5-5 (Required): Comparison operators shall be non-member functions with identical parameter types and noexcept. |
AUTOSAR.OP.COMPARE.MEMBER Comparison operators shall be non-member functions AUTOSAR.OP.COMPARE.NON_NOEXCEPT Comparison operators shall be noexcept AUTOSAR.OP.COMPARE.PARAMS Comparison operators shall have identical parameter types |
| A13-6-1 (Required): Digit sequences separators ’ shall only be used as follows: (1) for decimal, every 3 digits, (2) for hexadecimal, every 2 digits, (3) for binary, every 4 digits. |
AUTOSAR.DIGIT_SEPARATORS Digit sequences separators ' shall only be used as follows (1) for decimal, every 3 digits, (2) for hexadecimal, every 2 digits, (3) for binary, every 4 digits |
| A14-5-3 (Advisory): A non-member generic operator shall only be declared in a namespace that does not contain class (struct) type, enum type or union type declarations. |
AUTOSAR.OP.TMPL.NON_MEMBER A non-member generic operator shall only be declared in a namespace that does not contain class (struct) type, enum type or union type declarations |
| A14-8-2 (Required): Explicit specializations of function templates shall not be used. |
AUTOSAR.FUNC.TMPL.EXPLICIT_SPEC Explicit specializations of function templates shall not be used |
| A15-1-2 (Required): An exception object shall not be a pointer. |
MISRA.THROW.PTR Exception object is a pointer |
| A15-1-4 (Required): If a function exits with an exception, then before a throw, the function shall place all objects/resources that the function constructed in valid states or it shall delete them. |
MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak MLK.RET.MIGHT Memory Leak - possible MLK.RET.MUST Memory Leak |
| A15-2-2 (Required): If a constructor is not noexcept and the constructor cannot finish object initialization, then it shall deallocate the object’s resources and it shall throw an exception. |
CL.MLK Memory Leak - in destructor |
| A15-3-3 (Required): Main function and a task main function shall catch at least: base class exceptions from all third-party libraries used, std::exception and all otherwise unhandled exceptions. |
MISRA.CATCH.ALL No ellipsis exception handler in a try-catch block |
| A15-3-5 (Required): A class type exception shall be caught by reference or const reference. |
MISRA.CATCH.BY_VALUE Exception object of class type is caught by value |
| A15-4-1 (Required): Dynamic exception-specification shall not be used. |
AUTOSAR.EXCPT.DYNAMIC_SPEC Dynamic exception-specification shall not be used |
| A15-4-2 (Required): If a function is declared to be noexcept, noexcept(true) or noexcept(<true condition>), then it shall not exit with an exception. |
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 |
| A15-5-1 (Required): All user-provided class destructors, deallocation functions, move constructors, move assignment operators and swap functions shall not exit with an exception. |
AUTOSAR.EXCPT.SPECIAL_MEMBER_THROW All user-provided class destructors, deallocation functions, move constructors, move assignment operators and swap functions shall not exit with an exception |
| A16-0-1 (Required): ... inclusion and include guards, and using the following directives: ... |
MISRA.USE.DEFINE Non-guarding macro definition |
| A16-2-1 (Required): The ’, ", /*, //, \ characters shall not occur in a header file name or in #include directive. |
MISRA.INCL.SYMS Non-standard characters in header file names |
| A17-0-1 (Required): Reserved identifiers, macros and functions in the C++ standard library shall not be defined, redefined or undefined. |
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 |
| A18-0-2 (Required): The error state of a conversion from string to a numeric value shall be checked. |
MISRA.STDLIB.ATOI Use of 'atof', 'atoi' or 'atol' from library stdlib.h |
| A18-0-3 (Required): The library <clocale> (locale.h) and the setlocale function shall not be used. |
AUTOSAR.SETLOCALE The library <clocale> (locale.h) and the setlocale function shall not be used |
| A18-1-1 (Required): C-style arrays shall not be used. |
AUTOSAR.ARRAY.CSTYLE C-style arrays shall not be used |
| A18-1-2 (Required): The std::vector<bool> specialization shall not be used. |
AUTOSAR.VECTOR.BOOL The std::vector<bool> specialization shall not be used |
| A18-1-3 (Required): The std::auto_ptr type shall not be used. |
AUTOSAR.AUTO_PTR The std::auto_ptr type shall not be used |
| A18-5-1 (Required): Functions malloc, calloc, realloc and free shall not be used. |
AUTOSAR.STDLIB.MEMORY Functions malloc, calloc, realloc and free shall not be used |
| A18-5-2 (Required): Non-placement new or delete expressions shall not be used. |
AUTOSAR.OP.NEW_DELETE Non-placement new or delete expressions shall not be used |
| A18-5-3 (Required): The form of the delete expression shall match the form of the new expression used to allocate the memory. |
FMM.MIGHT Freeing Mismatched Memory - possible FMM.MUST Freeing Mismatched Memory |
| A18-5-4 (Required): If a project has sized or unsized version of operator “delete” globally defined, then both sized and unsized versions shall be defined. |
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 |
| A18-5-11 (Required): “operator new” and “operator delete” shall be defined together. |
AUTOSAR.OP.NEW_NO_DELETE "operator new" and "operator delete" shall be defined together |
| A18-9-1 (Required): The std::bind shall not be used. |
AUTOSAR.STDLIB.BIND The std::bind shall not be used |
| A18-9-2 (Required): 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. |
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 |
| A18-9-3 (Required): The std::move shall not be used on objects declared const or const&. |
AUTOSAR.STDLIB.MOVE.CONST The std::move shall not be used on objects declared const or const& |
| A21-8-1 (Required): Arguments to character-handling functions shall be representable as an unsigned char. |
AUTOSAR.STDLIB.CCTYPE.UCHAR Arguments to character-handling functions defined in <cctype> shall be representable as an unsigned char |
| A26-5-1 (Required): Pseudorandom numbers shall not be generated using std::rand(). |
AUTOSAR.STDLIB.RAND Pseudorandom numbers shall not be generated using std::rand() AUTOSAR.STDLIB.RANDOM_SHUFFLE Pseudorandom numbers shall not be generated using std::rand() |
| A26-5-2 (Required): Random number engines shall not be default-initialized. |
AUTOSAR.STDLIB.RANDOM.NBR_GEN_DEFAULT_INIT Random number engines shall not be default-initialized |
| A27-0-2 (Advisory): A C-style string shall guarantee sufficient space for data and the null terminator. |
NNTS.MIGHT Buffer Overflow - Non-null Terminated String NNTS.MUST Buffer Overflow - Non-null Terminated String NNTS.TAINTED Unvalidated User Input Causing Buffer Overflow - Non-Null Terminated String SV.UNBOUND_STRING_INPUT.CIN Usage of cin for unbounded string input SV.UNBOUND_STRING_INPUT.FUNC Usage of unbounded string input |
| A27-0-4 (Required): C-style strings shall not be used. |
SV.BANNED.RECOMMENDED.ALLOCA Banned recommended API: stack allocation functions SV.BANNED.RECOMMENDED.NUMERIC Banned recommended API: unsafe numeric conversion functions SV.BANNED.RECOMMENDED.OEM Banned recommended API: OEM character page conversion functions SV.BANNED.RECOMMENDED.PATH Banned recommended API: unsafe path name manipulation functions SV.BANNED.RECOMMENDED.SCANF Banned recommended API: unsafe scanf-type functions SV.BANNED.RECOMMENDED.SPRINTF Banned recommended API: unsafe sprintf-type functions SV.BANNED.RECOMMENDED.STRLEN Banned recommended API: unsafe string length functions SV.BANNED.RECOMMENDED.TOKEN Banned recommended API: unsafe string tokenizing functions SV.BANNED.RECOMMENDED.WINDOW Banned recommended API: unsafe window functions |
| M0-1-1 (Required): A project shall not contain unreachable code. |
UNREACH.ENUM Code is unreachable due to the possible value(s) of an enum UNREACH.GEN Unreachable code UNREACH.RETURN Unreachable Void Return |
| M0-1-2 (Required): A project shall not contain infeasible paths. |
CWARN.NOEFFECT.UCMP.GE Comparison of unsigned value against 0 is always true CWARN.NOEFFECT.UCMP.GE.MACRO Comparison of unsigned value against 0 within a macro is always true CWARN.NOEFFECT.UCMP.LT Comparison of unsigned value against 0 is always false CWARN.NOEFFECT.UCMP.LT.MACRO Comparison of unsigned value against 0 within a macro is always false |
| M0-1-3 (Required): A project shall not contain unused variables. |
LV_UNUSED.GEN Local variable unused |
| M0-1-9 (Required): There shall be no dead code. |
VA_UNUSED.GEN Value is Never Used after Assignment VA_UNUSED.INIT Value is Never Used after Initialization |
| M0-1-10 (Advisory): Every defined function should be called at least once. |
UNUSED.FUNC.GEN Function defined but not used |
| M0-2-1 (Required): An object shall not be assigned to an overlapping object. |
MISRA.ASSIGN.OVERLAP Object is assigned to an overlapping object |
| M2-7-1 (Required): The character sequence /* shall not be used within a C-style comment. |
MISRA.TOKEN.BADCOM Inappropriate character sequence in a comment |
| M2-13-2 (Required): Octal constants (other than zero) and octal escape sequences (other than “\0” ) shall not be used. |
MISRA.TOKEN.OCTAL.ESCAPE Usage of octal escape sequences MISRA.TOKEN.OCTAL.INT Usage of octal integer constants |
| M2-13-3 (Required): A “U” suffix shall be applied to all octal or hexadecimal integer literals of unsigned type. |
MISRA.LITERAL.UNSIGNED.SUFFIX Unsigned integer literal without 'U' suffix |
| M2-13-4 (Required): Literal suffixes shall be upper case. |
MISRA.LITERAL.SUFFIX.CASE Literal suffix in lower case. |
| M3-1-2 (Required): Functions shall not be declared at block scope. |
MISRA.DECL.FUNC_LOCAL Function is declared locally |
| M3-2-1 (Required): All declarations of an object or function shall have compatible types. |
MISRA.OBJ.TYPE.COMPAT Type not compatible with type of other declaration |
| M3-3-2 (Required): If a function has internal linkage then all re-declarations shall include the static storage class specifier. |
MISRA.FUNC.STATIC.REDECL Function or object redeclaration does not include 'static' modifier |
| M3-4-1 (Required): An identifier declared to be an object or type shall be defined in a block that minimizes its visibility. |
MISRA.VAR.MIN.VIS Name visibility is too wide |
| M3-9-1 (Required): The types used for an object, a function return type, or a function parameter shall be token-for-token identical in all declarations and re-declarations. |
MISRA.OBJ.TYPE.IDENT Type not identical with type of other declaration |
| M3-9-3 (Required): The underlying bit representations of floating-point values shall not be used. |
MISRA.FLOAT.BIT.REPR Use of bit manipulations of floating-point values which rely on storage layout |
| M4-5-1 (Required): Expressions with type bool shall not be used as operands to built-in operators. |
MISRA.LOGIC.OPERATOR.NOT_BOOL Operand of non-logical operator is effectively boolean |
| M4-5-3 (Required): Expressions with type (plain) char and wchar_t shall not be used as operands to built-in operators other than the assignment operator =, the equality operators == and ! =, and the unary & operator. |
MISRA.CHAR.OPERAND Expression of type 'char' or 'wchar_t' is used as non-character operand |
| M4-10-1 (Required): NULL shall not be used as an integer value. |
MISRA.LITERAL.NULL.INT NULL used as an integer value. |
| M4-10-2 (Required): Literal zero (0) shall not be used as the null-pointer-constant. |
MISRA.LITERAL.NULL.PTR Literal zero used as the null-pointer-constant. |
| M5-0-2 (Advisory): Limited dependence should be placed on C++ operator precedence rules in expressions. |
MISRA.EXPR.PARENS.INSUFFICIENT Limited dependence required for operator precedence rules in expressions MISRA.EXPR.PARENS.REDUNDANT Limited dependence required for operator precedence rules in expressions |
| M5-0-3 (Required): A cvalue expression shall not be implicitly converted to a different underlying type. |
MISRA.CVALUE.IMPL.CAST.CPP The value of an expression implicitly converted to a different type |
| M5-0-4 (Required): An implicit integral conversion shall not change the signedness of the underlying type. |
MISRA.CONV.INT.SIGN Implicit integral conversion changes signedness |
| M5-0-5 (Required): There shall be no implicit floating-integral conversions. |
MISRA.CONV.FLOAT Implicit floating-point conversion |
| M5-0-6 (Required): An implicit integral or floating-point conversion shall not reduce the size of the underlying type. |
MISRA.CONV.NUM.NARROWER Implicit numeric conversion to narrower type |
| M5-0-7 (Required): There shall be no explicit floating-integral conversions of a cvalue expression. |
MISRA.CAST.FLOAT_INT Cast of floating point expression to integral type MISRA.CAST.INT_FLOAT Cast of integral expression to floating point type |
| M5-0-8 (Required): An explicit integral or floating-point conversion shall not increase the size of the underlying type of a cvalue expression. |
MISRA.CAST.FLOAT.WIDER Cast of floating point expression to a wider floating point type MISRA.CAST.INT.WIDER Cast of integral expression to a wider integral type |
| M5-0-9 (Required): An explicit integral conversion shall not change the signedness of the underlying type of a cvalue expression. |
MISRA.CAST.INT.SIGN Non-trivial integral expression is cast to type with different signedness |
| M5-0-10 (Required): If the bitwise operators ~and << are applied to an operand with an underlying type of unsigned char or unsigned short, the result shall be immediately cast to the underlying type of the operand. |
MISRA.CAST.UNSIGNED_BITS The result of bitwise operation on unsigned char or short is not cast back to original type |
| M5-0-11 (Required): The plain char type shall only be used for the storage and use of character values. |
MISRA.CHAR.NOT_CHARACTER 'char' is used for non-character value |
| M5-0-12 (Required): Signed char and unsigned char type shall only be used for the storage and use of numeric values. |
MISRA.SIGNED_CHAR.NOT_NUMERIC 'signed char' or 'unsigned char' is used for non-numeric value |
| M5-0-14 (Required): The first operand of a conditional-operator shall have type bool. |
MISRA.EXPR.COND.NOT_BOOLEAN First operand of conditional expression is not a boolean expression |
| M5-0-15 (Required): Array indexing shall be the only form of pointer arithmetic. |
MISRA.PTR.ARITH Pointer is used in arithmetic or array index expression |
| M5-0-16 (Required): A pointer operand and any pointer resulting from pointer arithmetic using that operand shall both address elements of the same array. |
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 |
| M5-0-20 (Required): Non-constant operands to a binary bitwise operator shall have the same underlying type. |
MISRA.BITS.OPERAND Operands of bitwise operation have different underlying types |
| M5-0-21 (Required): Bitwise operators shall only be applied to operands of unsigned underlying type. |
MISRA.BITS.NOT_UNSIGNED Operand of bitwise operation is not unsigned integer MISRA.BITS.NOT_UNSIGNED.PREP Operand of bitwise operation is not unsigned integer |
| M5-2-2 (Required): A pointer to a virtual base class shall only be cast to a pointer to a derived class by means of dynamic_cast. |
MISRA.CAST.PTR.VRCLASS A cast form pointer to a virtual base class to pointer to a derived class does not use 'dynamic_cast' |
| M5-2-3 (Advisory): Casts from a base class to a derived class should not be performed on polymorphic types. |
MISRA.CAST.POLY.TYPE Cast from a polymorphic base class to a derived class |
| M5-2-6 (Required): A cast shall not convert a pointer to a function to any other pointer type, including a pointer to function type. |
MISRA.CAST.FUNC_PTR.CPP Cast converts function pointer to other pointer type |
| M5-2-8 (Required): An object with integer type or pointer to void type shall not be converted to an object with pointer type. |
MISRA.CAST.INT_TO_PTR Object with integer type or pointer to void cast to pointer type |
| M5-2-9 (Required): A cast shall not convert a pointer type to an integral type. |
MISRA.CAST.PTR_TO_INT Cast between a pointer and an integral type |
| M5-2-10 (Required): The increment (++) and decrement (−−) operators shall not be mixed with other operators in an expression. |
MISRA.INCR_DECR.OTHER Increment or decrement operator is mixed with other operators in expression |
| M5-2-11 (Required): The comma operator, && operator and the || operator shall not be overloaded. |
MISRA.BIN_OP.OVERLOAD Comma, || or && operator overloaded |
| M5-2-12 (Required): An identifier with array type passed as a function argument shall not decay to a pointer. |
MISRA.FUNC.ARRAY.PARAMS Function argument with array type decay to a pointer |
| M5-3-1 (Required): Each operand of the ! operator, the logical && or the logical || operators shall have type bool. |
MISRA.LOGIC.NOT_BOOL Operand of logical operation is not boolean |
| M5-3-2 (Required): The unary minus operator shall not be applied to an expression whose underlying type is unsigned. |
MISRA.UMINUS.UNSIGNED Operand of unary minus is unsigned |
| M5-3-3 (Required): The unary & operator shall not be overloaded. |
MISRA.UN_OP.OVERLOAD Unary & operator is overloaded |
| M5-3-4 (Required): Evaluation of the operand to the sizeof operator shall not contain side effects. |
MISRA.SIZEOF.SIDE_EFFECT Operand of sizeof has side effects |
| M5-8-1 (Required): The right hand operand of a shift operator shall lie between zero and one less than the width in bits of the underlying type of the left hand operand. |
MISRA.SHIFT.RANGE Right operand of shift operation is out of range - greater or equal to max bit-length of left operand, or negative |
| M5-14-1 (Required): The right hand operand of a logical &&, || operators shall not contain side effects. |
MISRA.LOGIC.SIDEEFF Right operand in a logical 'and' or 'or' expression contains side effects |
| M5-18-1 (Required): The comma operator shall not be used. |
MISRA.COMMA Comma operator is used |
| M5-19-1 (Required): Evaluation of constant unsigned integer expressions shall not lead to wrap-around. |
MISRA.COMP.WRAPAROUND Wrap-around in a condition MISRA.ELIF.WRAPAROUND Wrap-around in #elif directive |
| M6-2-1 (Required): Assignment operators shall not be used in sub-expressions. |
MISRA.ASSIGN.COND Assignment operator is used in a condition MISRA.ASSIGN.SUBEXPR Assignment operator is used in a sub-expression outside a condition |
| M6-2-2 (Required): Floating-point expressions shall not be directly or indirectly tested for equality or inequality. |
MISRA.FLOAT_EQUAL Floating point expression is tested for equality |
| M6-2-3 (Required): Before preprocessing, a null statement shall only occur on a line by itself; it may be followed by a comment, provided that the first character following the null statement is a white-space character. |
MISRA.NULL.STMT Null statement is not the only statement on line or comments are placed incorrectly |
| M6-3-1 (Required): The statement forming the body of a switch, while, do ... while or for statement shall be a compound statement. |
MISRA.STMT.NO_COMPOUND The body of switch, while, do/while or for statement is not a compound statement |
| M6-4-1 (Required): An if ( condition ) construct shall be followed by a compound statement. The else keyword shall be followed by either a compound statement, or another if statement. |
MISRA.IF.NO_COMPOUND The body of if/else statement is not a compound statement |
| M6-4-2 (Required): All if ... else if constructs shall be terminated with an else clause. |
MISRA.IF.NO_ELSE A chain of if/else-if statements is not terminated with else or is terminated with an empty else clause |
| M6-4-3 (Required): A switch statement shall be a well-formed switch statement. |
MISRA.SWITCH.NOT_WELL_FORMED Switch statement is not well-formed |
| M6-4-4 (Required): A switch-label shall only be used when the most closely-enclosing compound statement is the body of a switch statement. |
MISRA.SWITCH.LABEL A switch label belongs to nested compound statement inside switch body |
| M6-4-5 (Required): An unconditional throw or break statement shall terminate every non-empty switch-clause. |
MISRA.SWITCH.NO_BREAK No break or throw statement at the end of switch-clause |
| M6-4-6 (Required): The final clause of a switch statement shall be the default-clause. |
MISRA.SWITCH.NODEFAULT No default clause at the end of a switch statement |
| M6-4-7 (Required): The condition of a switch statement shall not have bool type. |
MISRA.SWITCH.BOOL Condition of switch statement is boolean expression |
| M6-5-2 (Required): If loop-counter is not modified by −− or ++, then, within condition, the loop-counter shall only be used as an operand to <=, <, > or >=. |
MISRA.FOR.COND.EQ ++ or -- operations are not used to change loop counter, but condition tests loop counter for equality |
| M6-5-3 (Required): The loop-counter shall not be modified within condition or statement. |
MISRA.FOR.COND.CHANGE For loop counter is modified within the loop condition section MISRA.FOR.STMT.CHANGE For loop counter is modified within the loop statement |
| M6-5-4 (Required): The loop-counter shall be modified by one of: −−, ++, − = n, or + = n; where n remains constant for the duration of the loop. |
MISRA.FOR.INCR For loop counter is modified in an inappropriate way |
| M6-5-5 (Required): A loop-control-variable other than the loop-counter shall not be modified within condition or expression. |
MISRA.FOR.LOOP_CONTROL.CHANGE.COND Loop control variable is modified in condition section of a for loop MISRA.FOR.LOOP_CONTROL.CHANGE.EXPR Loop control variable is modified in expression section of a for loop |
| M6-5-6 (Required): A loop-control-variable other than the loop-counter which is modified in statement shall have type bool. |
MISRA.FOR.LOOP_CONTROL.NOT_BOOLEAN Loop control variable is not boolean |
| M6-6-1 (Required): Any label referenced by a goto statement shall be declared in the same block, or in a block enclosing the goto statement. |
MISRA.GOTO.NESTED Goto to a label declared in a nested compound statement |
| M6-6-2 (Required): The goto statement shall jump to a label declared later in the same function body. |
MISRA.GOTO.AFTER.LABEL Unconstrained use of goto |
| M6-6-3 (Required): The continue statement shall only be used within a well-formed for loop. |
MISRA.CONTINUE.ILL Continue statement is used in an ill-formed for loop |
| M7-1-2 (Required): A pointer or reference parameter in a function shall be declared as pointer to const or reference to const if the corresponding object is not modified. |
MISRA.PPARAM.NEEDS.CONST Pointer parameter is not used to modify the addressed object but is not declared as a pointer to const |
| M7-3-1 (Required): The global namespace shall only contain main, namespace declarations and extern "C" declarations. |
MISRA.NS.GLOBAL Function, variable or type declaration in global namespace MISRA.NS.GLOBAL.USING Using directive or declaration in global namespace |
| M7-3-2 (Required): The identifier main shall not be used for a function other than the global function main. |
MISRA.NS.MAIN Non-global function with name 'main' is defined |
| M7-3-3 (Required): There shall be no unnamed namespaces in header files. |
MISRA.NAMESPACE.UNMD Unnamed namespace in header file |
| M7-3-4 (Required): Using-directives shall not be used. |
MISRA.NS.USING_DIR Using directive |
| M7-3-6 (Required): Using-directives and using-declarations (excluding class scope or function scope using-declarations) shall not be used in header files. |
MISRA.NAMESPACE.DECL Using-declaration in header file MISRA.NAMESPACE.DIR Using-directive in header file MISRA.NS.USING.HEADER Using directive or declaration is used in a header file |
| M7-4-2 (Required): Assembler instructions shall only be introduced using the asm declaration. |
MISRA.PRAGMA.ASM Incorrect assembler instruction |
| M7-4-3 (Required): Assembly language shall be encapsulated and isolated. |
MISRA.ASM.ENCAPS Assembly language is not isolated. |
| M8-0-1 (Required): An init-declarator-list or a member-declarator-list shall consist of a single init-declarator or member-declarator respectively. |
MISRA.DECL.MANY_DCLS More than one declarator in one declaration |
| M8-3-1 (Required): Parameters in an overriding virtual function shall either use the same default arguments as the function they override, or else shall not specify any default arguments. |
MISRA.SAME.DEFPARAMS Overriding virtual function and the function it overrides have different default arguments |
| M8-4-2 (Required): The identifiers used for the parameters in a re-declaration of a function shall be identical to those in the declaration. |
MISRA.FUNC.PARAMS.IDENT Identifiers used in declaration and definition of function are not identical |
| M8-4-4 (Required): A function identifier shall either be used to call the function or it shall be preceded by &. |
MISRA.FUNC.ADDR Address of a function is used without & operator |
| M8-5-2 (Required): Braces shall be used to indicate and match the structure in the non-zero initialization of arrays and structures. |
MISRA.INIT.BRACES Incorrect initializer braces placement. |
| M9-3-1 (Required): Const member functions shall not return non-const pointers or references to class-data. |
MISRA.CONST.RET.NON_CONST Constant member function returns non-const pointer to member variable |
| M9-3-3 (Required): If a member function can be made static then it shall be made static, otherwise if it can be made const then it shall be made const. |
MISRA.MEMB.NON_CONST Non-const member function does not change any member variables MISRA.MEMB.NON_STATIC Non-static member function does not use other non-static members of the same class |
| M9-6-4 (Required): Named bit-fields with signed integer type shall have a length of more than one bit. |
MISRA.BITFIELD.SIGNED Length of a named signed bit-field is less than 2 |
| M10-1-1 (Advisory): Classes should not be derived from virtual bases. |
MISRA.DERIVE.VIRTUAL Class is derived from virtual base |
| M10-1-2 (Required): A base class shall only be declared virtual if it is used in a diamond hierarchy. |
MISRA.VIRTUAL.BASE.DIAMOND Base class is used as virtual not in diamond hierarchy |
| M10-1-3 (Required): An accessible base class shall not be both virtual and non-virtual in the same hierarchy. |
MISRA.BASE.VIRTUAL.NOTVIRTUAL Base class is used as both virtual and not virtual in inheritance hierarchy |
| M10-2-1 (Advisory): All accessible entity names within a multiple inheritance hierarchy should be unique. |
MISRA.BASE.IDS.UNIQUE Member name is used twice in inheritance hierarchy |
| M10-3-3 (Required): A virtual function shall only be overridden by a pure virtual function if it is itself declared as pure virtual. |
MISRA.PUREVIRT.OVRD Pure virtual function overrides a non pure virtual function |
| M11-0-1 (Required): Member data in non-POD class types shall be private. |
MISRA.MEMB.NOT_PRIVATE Member variable in non-POD class is not private |
| M12-1-1 (Required): An object’s dynamic type shall not be used from the body of its constructor or destructor. |
MISRA.CTOR.DYNAMIC Object's dynamic type is used from the body of its constructor MISRA.DTOR.DYNAMIC Object's dynamic type is used from the body of its destructor |
| M14-5-3 (Required): A copy assignment operator shall be declared when there is a template assignment operator with a parameter that is a generic parameter. |
MISRA.COPYASSIGN.TMPL A copy ssignment operator should be defined when class has a template copy assignment operator with a single generic parameter |
| M14-6-1 (Required): In a class template with a dependent base, any name that may be found in that dependent base shall be referred to using a qualified-id or this->. |
MISRA.TEMPLMEM.NOQUAL In an instantiated template a member declared in a dependant base is used without a qualificator or 'this' |
| M15-0-3 (Required): Control shall not be transferred into a try or catch block using a goto or a switch statement. |
MISRA.TRY.JUMP Control can be transferred into a try block with goto or switch statement |
| M15-1-2 (Required): NULL shall not be thrown explicitly. |
MISRA.THROW.NULL NULL is thrown explicitly |
| M15-1-3 (Required): An empty throw (throw;) shall only be used in the compound statement of a catch handler. |
MISRA.THROW.EMPTY Empty throw expression does not belong to a catch block |
| M15-3-3 (Required): Handlers of a function-try-block implementation of a class constructor or destructor shall not reference non-static members from this class or its bases. |
MISRA.CTOR.TRY.NON_STATIC Function try/catch block of constructor or destructor references non-static members |
| M15-3-6 (Required): Where multiple handlers are provided in a single try-catch statement or function-try-block for a derived class and some or all of its bases, the handlers shall be ordered most-derived to base class. |
MISRA.CATCH.WRONGORD Handler for a base exception class precedes to a handler for a derived exception class in a try-catch block |
| M15-3-7 (Required): Where multiple handlers are provided in a single try-catch statement or function-try-block, any ellipsis (catch-all) handler shall occur last. |
MISRA.CATCH.NOALL Ellipsis exception handler is not the last one in a try-catch block |
| M16-0-1 (Required): #include directives in a file shall only be preceded by other pre-processor directives or comments. |
MISRA.INCL.INSIDE Include directive preceded by a preprocessor output token |
| M16-0-2 (Required): Macros shall only be #define’d or #undef’d in the global namespace. |
MISRA.DEFINE.NOTGLOBAL Define not at the global level MISRA.UNDEF.NOTGLOBAL Undef not at the global level |
| M16-0-5 (Required): Arguments to a function-like macro shall not contain tokens that look like pre-processing directives. |
MISRA.EXPANSION.DIRECTIVE Directive-like tokens within a macro argument |
| M16-0-6 (Required): In the definition of a function-like macro, each instance of a parameter shall be enclosed in parentheses, unless it is used as the operand of # or ##. |
MISRA.DEFINE.NOPARS Macro parameter with no parentheses |
| M16-0-7 (Required): Undefined macro identifiers shall not be used in #if or #elif pre-processor directives, except as operands to the defined operator. |
MISRA.ELIF.UNDEF Undefined macros in #elif directive MISRA.IF.UNDEF Undefined macros in #if directive |
| M16-0-8 (Required): If the # token appears as the first token on a line, then it shall be immediately followed by a pre-processing token. |
MISRA.USE.UNKNOWNDIR Unknown preprocessor directive is used |
| M16-1-1 (Required): The defined pre-processor operator shall only be used in one of the two standard forms. |
MISRA.ELIF.DEFINED Incorrect 'defined' usage in #elif directive MISRA.IF.DEFINED Incorrect 'defined' usage in #if directive |
| M16-1-2 (Required): All #else, #elif and #endif pre-processor directives shall reside in the same file as the #if or #ifdef directive to which they are related. |
MISRA.ELIF.OTHERFILE #elif in an improper file MISRA.ELSE.OTHERFILE #else in an improper file MISRA.ENDIF.OTHERFILE #endif in an improper file |
| M16-2-3 (Required): Include guards shall be provided. |
MISRA.INCGUARD Include guard is not provided |
| M16-3-1 (Required): There shall be at most one occurrence of the # or ## operators in a single macro definition. |
MISRA.DEFINE.SHARP.MANY Several # or ## operators in a macro definition |
| M16-3-2 (Advisory): The # and ## operators should not be used. |
MISRA.DEFINE.SHARP # or ## operator in a macro definition |
| M17-0-2 (Required): The names of standard library macros and objects shall not be reused. |
MISRA.UNDEF.WRONGNAME Undefinition of a name from the standard library MISRA.UNDEF.WRONGNAME.UNDERSCORE Undefinition of a reserved name |
| M17-0-3 (Required): The names of standard library functions shall not be overridden. |
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 |
| M17-0-5 (Required): The setjmp macro and the longjmp function shall not be used. |
MISRA.STDLIB.LONGJMP Use of setjmp macro or longjmp function |
| M18-0-3 (Required): The library functions abort, exit, getenv and system from library <cstdlib> shall not be used. |
MISRA.STDLIB.ABORT Use of 'abort', 'exit', 'getenv' or 'system' from library stdlib.h |
| M18-0-4 (Required): The time handling functions of library <ctime> shall not be used. |
MISRA.STDLIB.TIME Use of the time handling functions of library time.h |
| M18-0-5 (Required): The unbounded functions of library <cstring> shall not be used. |
MISRA.STDLIB.CSTRING Function from 'cstring' library is used MISRA.STDLIB.CSTRING.MACRO Macro from 'cstring' library is used |
| M18-7-1 (Required): The signal handling facilities of <csignal> shall not be used. |
MISRA.STDLIB.SIGNAL Use of the signal handling facilities of signal.h |
| M19-3-1 (Required): The error indicator errno shall not be used. |
MISRA.STDLIB.ERRNO Use of error indicator 'errno' |
| M27-0-1 (Required): The stream input/output library <cstdio> shall not be used. |
MISRA.STDLIB.STDIO Use of input/output library stdio.h in production code |
Support Summary:
- 228 enforced rules