AUTOSAR community checker reference
These Klocwork community checkers detect violations of the AUTOSAR C++14 Standard.
Notes:
- We provide full help for each AUTOSAR community checker as a part of your Klocwork installation, rather than online.
- To view this information organized by rule number, see AUTOSAR 18-10 Standard mapped to Klocwork and community C and C++ checkers.
Checker name | Description | Default severity | Enabled by default? | Version |
---|---|---|---|---|
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 | 4 | False | 2021.1 |
AUTOSAR.ADD.ASSIGN.OP.VIRTUAL | A user-defined assignment operator shall not be virtual | 4 | False | 2021.1 |
AUTOSAR.ADD.AUTO.INIT.FORMAT | A variable of type auto shall not be initialized using {} or ={} braced-initialization. | 4 | False | 2021.1 |
AUTOSAR.ADD.AUTO.SPECIFIER | The auto specifier shall not be used here | 4 | False | 2021.1 |
AUTOSAR.ADD.COND.NOT.BOOL | The condition of an if-statement and iteration statement shall have type bool | 4 | False | 2021.1 |
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 | 4 | False | 2021.1 |
AUTOSAR.ADD.CTOR.MEMBER.INIT | All class data members that are initialized by the constructor shall be initialized using member initializers | 4 | False | 2021.1 |
AUTOSAR.ADD.ENUM.OP | Enum shall not be used in arithmetic context | 4 | False | 2021.1 |
AUTOSAR.ADD.EXPR.EVAL.MULTI.CALL | The value of an expression shall be the same under any order of evaluation that the standard permits | 4 | False | 2021.1 |
AUTOSAR.ADD.EXPR.EVAL.VOLATILE | The value of an expression shall be the same under any order of evaluation that the standard permits | 4 | False | 2021.1 |
AUTOSAR.ADD.FILE.EXT | Local implementation files not having .cpp file extension | 4 | False | 2021.1 |
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 | 4 | False | 2021.1 |
AUTOSAR.ADD.LITERAL | Literal values shall not be used apart from type initialization | 4 | False | 2021.1 |
AUTOSAR.ADD.LOGIC.NOT_BOOL | The condition of an if-statement and iteration statement shall have type bool | 4 | False | 2021.1 |
AUTOSAR.ADD.NULLPTR | Only nullptr literal shall be used as the null-pointer-constant | 4 | False | 2022.3 |
AUTOSAR.ADD.ONEDEFRULE.FUNC | Function is violating one definition rule | 4 | False | 2021.1 |
AUTOSAR.ADD.ONEDEFRULE.VAR | Variable is violating one definition rule | 4 | False | 2021.1 |
AUTOSAR.ADD.OVERRIDE.VIRTUAL.SPECIFIER | Each overriding virtual function shall be declared with the override or final specifier | 4 | False | 2021.1 |
AUTOSAR.ADD.REDEF.DERIVED.FUNC | Non-virtual public or protected member functions shall not be redefined in derived classes. | 4 | False | 2021.1 |
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 | 4 | False | 2021.1 |
AUTOSAR.ADD.STR.TO.NON.CONST | String literals shall not be assigned to non-constant pointers | 4 | False | 2021.1 |
AUTOSAR.ARRAY.CSTYLE | C-style arrays shall not be used | 4 | False | 2022.2 |
AUTOSAR.ASM | The asm declaration shall not be used | 4 | False | 2020.1 |
AUTOSAR.ASSIGN.REF_QUAL | Assignment operators should be declared with the ref-qualifier & | 4 | False | 2022.2 |
AUTOSAR.ASSIGN.RETURN | An assignment operator shall return a reference to "this" | 4 | False | 2020.1 |
AUTOSAR.AUTO_PTR | The std::auto_ptr type shall not be used | 4 | False | 2020.1 |
AUTOSAR.BUILTIN_NUMERIC | Fixed width integer types from <cstdint> shall be used in place of the basic numerical types | 4 | False | 2020.1 |
AUTOSAR.CAST.CSTYLE | Traditional C-style casts shall not be used | 4 | False | 2020.1 |
AUTOSAR.CAST.DYNAMIC | dynamic_cast should not be used | 4 | False | 2020.1 |
AUTOSAR.CAST.REINTERPRET | reinterpret_cast shall not be used | 4 | False | 2020.1 |
AUTOSAR.CTOR.MOVE.COPY_SEMANTICS | Move constructor shall not initialize its class members and base classes using copy semantics | 4 | False | 2020.1 |
AUTOSAR.CTOR.NO_EXPLICIT | All constructors that are callable with a single argument of fundamental type shall be declared explicit | 4 | False | 2020.1 |
AUTOSAR.CTOR.NSDMI_INIT_LIST | Both NSDMI and a non-static member initializer in a constructor shall not be used in the same type | 4 | False | 2020.1 |
AUTOSAR.DECL.IN_DEFN | A class, structure, or enumeration shall not be declared in the definition of its type | 4 | False | 2020.1 |
AUTOSAR.DECL.NONTYPE_SPECIFIER | A non-type specifier shall be placed before a type specifier in a declaration | 4 | False | 2022.4 |
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 | 4 | False | 2020.1 |
AUTOSAR.DO | Do statements should not be used | 4 | False | 2020.1 |
AUTOSAR.DTOR.NON_VIRTUAL | If a public destructor of a class is non-virtual, then the class should be declared final | 4 | False | 2020.1 |
AUTOSAR.ENUM.EXPLICIT_BASE_TYPE | Enumeration underlying base type shall be explicitly defined | 4 | False | 2020.1 |
AUTOSAR.ENUM.UNSCOPED | Enumerations shall be declared as scoped enum classes | 4 | False | 2020.1 |
AUTOSAR.EXCPT.DYNAMIC_SPEC | Dynamic exception-specification shall not be used | 4 | False | 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 | 4 | False | 2020.1 |
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 | 4 | False | 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 | 4 | False | 2020.1 |
AUTOSAR.FRIEND_DECL | Friend declarations shall not be used | 4 | False | 2020.1 |
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 | 4 | False | 2020.1 |
AUTOSAR.FUNC.TMPL.EXPLICIT_SPEC | Explicit specializations of function templates shall not be used | 4 | False | 2020.1 |
AUTOSAR.GOTO | The goto statement shall not be used | 4 | False | 2020.1 |
AUTOSAR.HEX.UPPER | Hexadecimal constants should be upper case | 4 | False | 2020.1 |
AUTOSAR.LAMBDA.IMPLICIT_CAPTURE | Variables shall not be implicitly captured in a lambda expression | 4 | False | 2020.1 |
AUTOSAR.LAMBDA.IMPLICIT_RETURN_TYPE | Return type of a non-void return type lambda expression should be explicitly specified | 4 | False | 2020.1 |
AUTOSAR.LAMBDA.NESTED | Lambda expressions should not be defined inside another lambda expression | 4 | False | 2020.1 |
AUTOSAR.LAMBDA.NO_PARAM_LIST | Parameter list (possibly empty) shall be included in every lambda expression | 4 | False | 2020.1 |
AUTOSAR.LAMBDA.REF_LIFETIME | A lambda expression object shall not outlive any of its reference-captured objects | 4 | False | 2020.1 |
AUTOSAR.LAMBDA.TYPE_OPERAND | A lambda shall not be an operand to decltype or typeid | 4 | False | 2020.1 |
AUTOSAR.MEMB.VIRTUAL.FINAL | Virtual functions shall not be introduced in a final class | 4 | False | 2020.1 |
AUTOSAR.MEMB.VIRTUAL.SPEC | Virtual function declaration shall contain exactly one of the three specifiers: (1) virtual, (2) override, (3) final. | 4 | False | 2020.1 |
AUTOSAR.OP.BINARY.RETVAL | A binary arithmetic operator and a bitwise operator shall return a "prvalue" | 4 | False | 2023.4 |
AUTOSAR.OP.COMPARE.MEMBER | Comparison operators shall be non-member functions | 4 | False | 2020.1 |
AUTOSAR.OP.COMPARE.NON_NOEXCEPT | Comparison operators shall be noexcept | 4 | False | 2020.1 |
AUTOSAR.OP.COMPARE.PARAMS | Comparison operators shall have identical parameter types | 4 | False | 2020.1 |
AUTOSAR.OP.CONV | User-defined conversion operators should not be used | 4 | False | 2020.1 |
AUTOSAR.OP.CONV.NON_EXPLICIT | All user-defined conversion operators shall be defined explicit | 4 | False | 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 | 4 | False | 2020.1 |
AUTOSAR.OP.INDEX.NON_CONST | If "operator[]" is to be overloaded with a non-const version, const version shall also be implemented | 4 | False | 2020.1 |
AUTOSAR.OP.LITERAL.SUFFIX | User defined suffixes of the user defined literal operators shall start with underscore followed by one or more letters | 4 | False | 2020.1 |
AUTOSAR.OP.NEW_DELETE | Non-placement new or delete expressions shall not be used | 4 | False | 2020.1 |
AUTOSAR.OP.NEW_NO_DELETE | "operator new" and "operator delete" shall be defined together | 4 | False | 2020.1 |
AUTOSAR.OP.RELATIONAL.RETVAL | A relational operator shall return a boolean value | 4 | False | 2022.1 |
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 | 4 | False | 2020.1 |
AUTOSAR.REGISTER | The register keyword shall not be used | 4 | False | 2020.1 |
AUTOSAR.SETLOCALE | The library <clocale> (locale.h) and the setlocale function shall not be used | 4 | False | 2020.1 |
AUTOSAR.STDLIB.BIND | The std::bind shall not be used | 4 | False | 2020.1 |
AUTOSAR.STDLIB.CCTYPE.UCHAR | Arguments to character-handling functions defined in <cctype> shall be representable as an unsigned char | 4 | False | 2020.1 |
AUTOSAR.STDLIB.MEMORY | Functions malloc, calloc, realloc and free shall not be used | 4 | False | 2020.1 |
AUTOSAR.STDLIB.MOVE.CONST | The std::move shall not be used on objects declared const or const& | 4 | False | 2020.1 |
AUTOSAR.STDLIB.RAND | Pseudorandom numbers shall not be generated using std::rand() | 4 | False | 2020.1 |
AUTOSAR.STDLIB.RANDOM.NBR_GEN_DEFAULT_INIT | Random number engines shall not be default-initialized | 3 | False | 2022.2 |
AUTOSAR.STDLIB.RANDOM_SHUFFLE | Pseudorandom numbers shall not be generated using std::rand() | 4 | False | 2020.1 |
AUTOSAR.STYLE.SINGLE_DECL_PER_LINE | Each expression statement and identifier declaration shall be placed on a separate line | 4 | False | 2020.1 |
AUTOSAR.STYLE.SINGLE_STMT_PER_LINE | Each expression statement and identifier declaration shall be placed on a separate line | 4 | False | 2020.1 |
AUTOSAR.SWITCH.CASECOUNT | A switch statement shall have at least two case-clauses, distinct from the default label | 4 | False | 2020.1 |
AUTOSAR.TERNARY.NESTED | The ternary conditional operator shall not be used as a sub-expression | 4 | False | 2020.1 |
AUTOSAR.TYPEDEF | The typedef specifier shall not be used | 4 | False | 2020.1 |
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 | 4 | False | 2020.1 |
AUTOSAR.TYPE.LONG_DOUBLE | Type long double shall not be used | 4 | False | 2020.1 |
AUTOSAR.TYPE.QUAL.VOLATILE | The volatile type qualifier shall not be used | 4 | False | 2020.1 |
AUTOSAR.TYPE.WCHAR_T | Type wchar_t shall not be used | 4 | False | 2020.1 |
AUTOSAR.UNION | Unions shall not be used | 4 | False | 2020.1 |
AUTOSAR.VECTOR.BOOL | The std::vector<bool> specialization shall not be used | 4 | False | 2020.1 |
AUTOSAR.VIRTUAL.PTR_COMPARE | A pointer to member virtual function shall only be tested for equality with null-pointer-constant | 4 | False | 2020.1 |