C++ Core Guidelines
The following table maps C++ Core Guidelines to Klocwork checkers.
| Rule | Checker name and description |
|---|---|
| C.1: Organize related data into structures (structs or classes) |
Currently, there is no applicable checker for this rule. |
| C.2: Use class if the class has an invariant; use struct if the data members can vary independently |
Currently, there is no applicable checker for this rule. |
| C.3: Represent the distinction between an interface and an implementation using a class |
Currently, there is no applicable checker for this rule. |
| C.4: Make a function a member only if it needs direct access to the representation of a class |
MISRA.MEMB.NON_STATIC Non-static member function does not use other non-static members of the same class |
| C.5: Place helper functions in the same namespace as the class they support |
Currently, there is no applicable checker for this rule. |
| C.7: Don't define a class or enum and declare a variable of its type in the same statement |
Currently, there is no applicable checker for this rule. |
| C.8: Use class rather than struct if any member is non-public |
Currently, there is no applicable checker for this rule. |
| C.9: Minimize exposure of members |
MISRA.MEMB.NOT_PRIVATE Member variable in non-POD class is not private |
| C.10: Prefer concrete types over class hierarchies |
Currently, there is no applicable checker for this rule. |
| C.11: Make concrete types regular |
Currently, there is no applicable checker for this rule. |
| C.12: Don't make data members const or references in a copyable or movable type |
Currently, there is no applicable checker for this rule. |
| C.20: If you can avoid defining any default operations, do |
Currently, there is no applicable checker for this rule. |
| C.21: If you define or =delete any copy, move, or destructor function, define or =delete them all |
Currently, there is no applicable checker for this rule. |
| C.22: Make default operations consistent |
Currently, there is no applicable checker for this rule. |
| C.30: Define a destructor if a class needs an explicit action at object destruction |
Currently, there is no applicable checker for this rule. |
| C.31: All resources acquired by a class must be released by the class's destructor |
CL.MLK Memory Leak - in destructor CL.MLK.ASSIGN Memory Leak - in assignment operator CL.MLK.VIRTUAL Memory Leak - possible in destructor MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak RH.LEAK Resource leak |
| C.32: If a class has a raw pointer (T*) or reference (T&), consider whether it might be owning |
MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak MLK.RET.MIGHT Memory Leak - possible MLK.RET.MUST Memory Leak |
| C.33: If a class has an owning pointer member, define a destructor |
CL.MLK Memory Leak - in destructor CL.MLK.ASSIGN Memory Leak - in assignment operator CL.MLK.VIRTUAL Memory Leak - possible in destructor |
| C.35: A base class destructor should be either public and virtual, or protected and non-virtual |
CWARN.DTOR.NONVIRT.DELETE Delete expression for an object of a class with virtual methods and no virtual destructor |
| C.36: A destructor must not fail |
MISRA.DTOR.THROW Throw in destructor |
| C.37: Make destructors noexcept |
MISRA.DTOR.THROW Throw in destructor |
| C.40: Define a constructor if a class has an invariant |
Currently, there is no applicable checker for this rule. |
| C.41: A constructor should create a fully initialized object |
UNINIT.CTOR.MIGHT Uninitialized Variable in Constructor - possible UNINIT.CTOR.MUST Uninitialized Variable in Constructor |
| C.42: If a constructor cannot construct a valid object, throw an exception |
Currently, there is no applicable checker for this rule. |
| C.43: Ensure that a copyable class has a default constructor |
Currently, there is no applicable checker for this rule. |
| C.44: Prefer default constructors to be simple and non-throwing |
Currently, there is no applicable checker for this rule. |
| C.45: Don't define a default constructor that only initializes data members; use member initializers instead |
Currently, there is no applicable checker for this rule. |
| C.46: By default, declare single-argument constructors explicit |
MISRA.CTOR.NOT_EXPLICIT Constructor with one argument of built-in type is not declared 'explicit' AUTOSAR.CTOR.NO_EXPLICIT All constructors that are callable with a single argument of fundamental type shall be declared explicit |
| C.47: Define and initialize data members in the order of member declaration |
CWARN.MEMBER.INIT.ORDER Members of the initialization list are not listed in the order in which they are declared in the class CERT.OOP.CTOR.INIT_ORDER Write constructor member initializers in the canonical order |
| C.48: Prefer in-class initializers to member initializers in constructors for constant initializers |
Currently, there is no applicable checker for this rule. |
| C.49: Prefer initialization to assignment in constructors |
Currently, there is no applicable checker for this rule. |
| C.50: Use a factory function if you need virtual behavior during initialization |
Currently, there is no applicable checker for this rule. |
| C.51: Use delegating constructors to represent common actions for all constructors of a class |
Currently, there is no applicable checker for this rule. |
| C.52: Use inheriting constructors to import constructors into a derived class that does not need further explicit initialization |
Currently, there is no applicable checker for this rule. |
| C.60: Make copy assignment non-virtual, take the parameter by const&, and return by non-const& |
CL.SELF-ASSIGN Use of free memory (double free) - in operator= CL.SHALLOW.ASSIGN Use of free memory (double free) - shallow copy in operator= CL.SHALLOW.COPY Use of free memory (double free) - shallow copy in copy constructor |
| C.61: A copy operation should copy |
Currently, there is no applicable checker for this rule. |
| C.62: Make copy assignment safe for self-assignment |
CL.SELF-ASSIGN Use of free memory (double free) - in operator= |
| C.63: Make move assignment non-virtual, take the parameter by &&, and return by non-const& |
CL.FFM.ASSIGN Use of free memory (double free) - no operator= CL.FFM.COPY Use of free memory (double free) - no copy constructor |
| C.64: A move operation should move and leave its source in a valid state |
Currently, there is no applicable checker for this rule. |
| C.65: Make move assignment safe for self-assignment |
Currently, there is no applicable checker for this rule. |
| C.66: Make move operations noexcept |
Currently, there is no applicable checker for this rule. |
| C.67: A polymorphic class should suppress public copy/move |
CL.SHALLOW.ASSIGN Use of free memory (double free) - shallow copy in operator= CL.SHALLOW.COPY Use of free memory (double free) - shallow copy in copy constructor |
| C.80: Use =default if you have to be explicit about using the default semantics |
Currently, there is no applicable checker for this rule. |
| C.81: Use =delete when you want to disable default behavior (without wanting an alternative) |
Currently, there is no applicable checker for this rule. |
| C.82: Don't call virtual functions in constructors and destructors |
CL.MLK.VIRTUAL Memory Leak - possible in 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 CERT.OOP.CTOR.VIRTUAL_FUNC Do not invoke virtual functions from constructors or destructors |
| C.83: For value-like types, consider providing a noexcept swap function |
Currently, there is no applicable checker for this rule. |
| C.84: A swap function must not fail |
Currently, there is no applicable checker for this rule. |
| C.85: Make swap noexcept |
Currently, there is no applicable checker for this rule. |
| C.86: Make == symmetric with respect of operand types and noexcept |
Currently, there is no applicable checker for this rule. |
| C.87: Beware of == on base classes |
Currently, there is no applicable checker for this rule. |
| C.89: Make a hash noexcept |
Currently, there is no applicable checker for this rule. |
| C.90: Rely on constructors and assignment operators, not memset and memcpy |
Currently, there is no applicable checker for this rule. |
| C.100: Follow the STL when defining a container |
Currently, there is no applicable checker for this rule. |
| C.101: Give a container value semantics |
Currently, there is no applicable checker for this rule. |
| C.102: Give a container move operations |
Currently, there is no applicable checker for this rule. |
| C.103: Give a container an initializer list constructor |
Currently, there is no applicable checker for this rule. |
| C.104: Give a container a default constructor that sets it to empty |
Currently, there is no applicable checker for this rule. |
| C.109: If a resource handle has pointer semantics, provide * and -> |
Currently, there is no applicable checker for this rule. |
| C.120: Use class hierarchies to represent concepts with inherent hierarchical structure |
Currently, there is no applicable checker for this rule. |
| C.121: If a base class is used as an interface, make it a pure abstract class |
Currently, there is no applicable checker for this rule. |
| C.122: Use abstract classes as interfaces when complete separation of interface and implementation is needed |
Currently, there is no applicable checker for this rule. |
| C.126: An abstract class typically doesn't need a user-written constructor |
Currently, there is no applicable checker for this rule. |
| C.127: A class with a virtual function should have a virtual or protected destructor |
CWARN.DTOR.NONVIRT.DELETE Delete expression for an object of a class with virtual methods and no virtual destructor |
| C.128: Virtual functions should specify exactly one of virtual, override, or final |
AUTOSAR.MEMB.VIRTUAL.SPEC Virtual function declaration shall contain exactly one of the three specifiers: (1) virtual, (2) override, (3) final. |
| C.129: When designing a class hierarchy, distinguish between implementation inheritance and interface inheritance |
Currently, there is no applicable checker for this rule. |
| C.130: For making deep copies of polymorphic classes prefer a virtual clone function instead of copy construction/assignment |
Currently, there is no applicable checker for this rule. |
| C.131: Avoid trivial getters and setters |
Currently, there is no applicable checker for this rule. |
| C.132: Don't make a function virtual without reason |
Currently, there is no applicable checker for this rule. |
| C.133: Avoid protected data |
Currently, there is no applicable checker for this rule. |
| C.134: Ensure all non-const data members have the same access level |
Currently, there is no applicable checker for this rule. |
| C.135: Use multiple inheritance to represent multiple distinct interfaces |
Currently, there is no applicable checker for this rule. |
| C.136: Use multiple inheritance to represent the union of implementation attributes |
Currently, there is no applicable checker for this rule. |
| C.137: Use virtual bases to avoid overly general base classes |
Currently, there is no applicable checker for this rule. |
| C.138: Create an overload set for a derived class and its bases with using |
Currently, there is no applicable checker for this rule. |
| C.139: Use final on classes sparingly |
Currently, there is no applicable checker for this rule. |
| C.140: Do not provide different default arguments for a virtual function and an overrider |
MISRA.SAME.DEFPARAMS Overriding virtual function and the function it overrides have different default arguments |
| C.145: Access polymorphic objects through pointers and references |
Currently, there is no applicable checker for this rule. |
| C.146: Use dynamic_cast where class hierarchy navigation is unavoidable |
Currently, there is no applicable checker for this rule. |
| C.147: Use dynamic_cast to a reference type when failure to find the required class is considered an error |
Currently, there is no applicable checker for this rule. |
| C.148: Use dynamic_cast to a pointer type when failure to find the required class is considered a valid alternative |
Currently, there is no applicable checker for this rule. |
| C.149: Use unique_ptr or shared_ptr to avoid forgetting to delete objects created using new |
MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak MLK.RET.MIGHT Memory Leak - possible MLK.RET.MUST Memory Leak |
| C.150: Use make_unique() to construct objects owned by unique_ptrs |
Currently, there is no applicable checker for this rule. |
| C.151: Use make_shared() to construct objects owned by shared_ptrs |
Currently, there is no applicable checker for this rule. |
| C.152: Never assign a pointer to an array of derived class objects to a pointer to its base |
Currently, there is no applicable checker for this rule. |
| C.153: Prefer virtual function to casting |
Currently, there is no applicable checker for this rule. |
| C.160: Define operators primarily to mimic conventional usage |
Currently, there is no applicable checker for this rule. |
| C.161: Use non-member functions for symmetric operators |
Currently, there is no applicable checker for this rule. |
| C.162: Overload operations that are roughly equivalent |
Currently, there is no applicable checker for this rule. |
| C.163: Overload only for operations that are roughly equivalent |
Currently, there is no applicable checker for this rule. |
| C.164: Avoid implicit conversion operators |
AUTOSAR.OP.CONV.NON_EXPLICIT All user-defined conversion operators shall be defined explicit |
| C.165: Use using for customization points |
Currently, there is no applicable checker for this rule. |
| C.166: Overload unary & only as part of a system of smart pointers and references |
MISRA.UN_OP.OVERLOAD Unary & operator is overloaded |
| C.167: Use an operator for an operation with its conventional meaning |
Currently, there is no applicable checker for this rule. |
| C.168: Define overloaded operators in the namespace of their operands |
Currently, there is no applicable checker for this rule. |
| C.170: If you feel like overloading a lambda, use a generic lambda |
Currently, there is no applicable checker for this rule. |
| C.180: Use unions to save memory |
Currently, there is no applicable checker for this rule. |
| C.181: Avoid naked unions |
MISRA.UNION Union is used |
| C.182: Use anonymous unions to implement tagged unions |
Currently, there is no applicable checker for this rule. |
| C.183: Don't use a union for type punning |
Currently, there is no applicable checker for this rule. |
| CP.1: Assume that your code will run as part of a multi-threaded program |
Currently, there is no applicable checker for this rule. |
| CP.2: Avoid data races |
CONC.DBL_LOCK Double Lock CONC.DBL_UNLOCK Double Unlock CONC.DL Deadlock CONC.NO_LOCK Missing lock for variable SV.TOCTOU.FILE_ACCESS Time of Creation/Time of Use Race condition in File Access CERT.CONC.LIB_FUNC_USE Avoid race conditions when using library functions CERT.CONC.ATOMIC_TWICE_EXPR Do not refer to an atomic variable twice in an expression |
| CP.3: Minimize explicit sharing of writable data |
Currently, there is no applicable checker for this rule. |
| CP.4: Think in terms of tasks, rather than threads |
Currently, there is no applicable checker for this rule. |
| CP.8: Don't try to use volatile for synchronization |
Currently, there is no applicable checker for this rule. |
| CP.9: Whenever feasible use tools to validate your concurrent code |
Currently, there is no applicable checker for this rule. |
| CP.20: Use RAII, never plain lock()/unlock() |
CERT.CONC.MUTEX.DESTROY_WHILE_LOCKED Do not destroy a mutex while it is locked CONC.DBL_LOCK Double Lock CONC.DBL_UNLOCK Double Unlock CONC.NO_LOCK Missing lock for variable |
| CP.21: Use std::lock() or std::scoped_lock to acquire multiple mutexes |
CONC.DL Deadlock |
| CP.22: Never call unknown code while holding a lock |
CONC.DL Deadlock |
| CP.23: Think of a joining thread as a scoped container |
Currently, there is no applicable checker for this rule. |
| CP.24: Think of a thread as a global container |
Currently, there is no applicable checker for this rule. |
| CP.25: Prefer gsl::joining_thread over std::thread |
Currently, there is no applicable checker for this rule. |
| CP.26: Don't detach() a thread |
INFINITE_LOOP.GLOBAL Infinite loop INFINITE_LOOP.LOCAL Infinite loop |
| CP.31: Pass small amounts of data between threads by value, rather than by reference or pointer |
Currently, there is no applicable checker for this rule. |
| CP.32: To share ownership between unrelated threads use shared_ptr |
Currently, there is no applicable checker for this rule. |
| CP.40: Minimize context switching |
Currently, there is no applicable checker for this rule. |
| CP.41: Minimize thread creation and destruction |
Currently, there is no applicable checker for this rule. |
| CP.42: Don't wait without a condition |
INFINITE_LOOP.GLOBAL Infinite loop INFINITE_LOOP.LOCAL Infinite loop INFINITE_LOOP.MACRO Infinite loop CERT.CONC.WAKE_IN_LOOP Wrap functions that can spuriously wake up in a loop CERT.CONC.UNSAFE_COND_VAR Preserve thread safety and liveness when using condition variables |
| CP.43: Minimize time spent in a critical section |
Currently, there is no applicable checker for this rule. |
| CP.44: Remember to name your lock_guards and unique_locks |
Currently, there is no applicable checker for this rule. |
| CP.45: Don't lock a mutex that is not a std::mutex |
Currently, there is no applicable checker for this rule. |
| CP.50: Define a mutex together with the data it guards |
Currently, there is no applicable checker for this rule. |
| CP.51: Do not use capturing lambdas that are coroutines |
UFM.USE.MIGHT Use of free memory - possible UFM.USE.MUST Use of Freed Memory |
| CP.52: Do not hold locks or other synchronization primitives across suspension points |
Currently, there is no applicable checker for this rule. |
| CP.53: Parameters of coroutines should not be passed by reference |
Currently, there is no applicable checker for this rule. |
| CP.60: Use a future to return a value from a concurrent task |
Currently, there is no applicable checker for this rule. |
| CP.61: Use async() to spawn a concurrent task |
Currently, there is no applicable checker for this rule. |
| CP.100: Don't use lock-free programming unless you absolutely have to |
Currently, there is no applicable checker for this rule. |
| CP.101: Distrust your hardware/compiler combination |
Currently, there is no applicable checker for this rule. |
| CP.102: Carefully study the literature |
Currently, there is no applicable checker for this rule. |
| CP.110: Do not write your own double-checked locking for initialization |
CXX.STATIC.OBJ.RECURSION Do not reenter function during initialization of static objects |
| CP.111: Use a conventional pattern if you really need double-checked locking |
Currently, there is no applicable checker for this rule. |
| CP.200: Use volatile only to talk to non-C++ memory |
Currently, there is no applicable checker for this rule. |
| CPL.1: Prefer C++ to C |
SV.BANNED.REQUIRED.GETS Banned required API: unsafe stream reading functions SV.BANNED.REQUIRED.COPY Banned required API: unsafe buffer copy functions SV.BANNED.REQUIRED.CONCAT Banned required API: unsafe string concatenation functions SV.BANNED.REQUIRED.SPRINTF Banned required API: unsafe sprintf-type 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.UNBOUND_STRING_INPUT.CIN Usage of cin for unbounded string input SV.UNBOUND_STRING_INPUT.FUNC Usage of unbounded string input MISRA.STDLIB.CSTRING Function from 'cstring' library is used MISRA.STDLIB.CSTRING.MACRO Macro from 'cstring' library is used AUTOSAR.ARRAY.CSTYLE C-style arrays shall not be used |
| CPL.2: If you must use C, use the common subset of C and C++, and compile the C code as C++ |
MISRA.CAST.VOID_PTR_TO_OBJ_PTR.2012 Conversion performed from a pointer to void to a pointer to an object PORTING.CAST.PTR.SIZE Attempt to cast an expression to a type of a potentially incompatible size PORTING.UNSIGNEDCHAR.OVERFLOW.FALSE Relational expression may be always false depending on 'char' type signedness MISRA.SIGNED_CHAR.NOT_NUMERIC 'signed char' or 'unsigned char' is used for non-numeric value |
| CPL.3: If you must use C for interfaces, use C++ in the calling code using C++ wrappers |
SV.TAINTED.INJECTION Command Injection SV.CODE_INJECTION.SHELL_EXEC Command Injection into Shell Execution |
| Con.1: By default, make objects immutable |
MISRA.CAST.CONST Cast operation removes const or volatile modifier from a pointer or reference SV.LPP.CONST Use of Insecure Macro for Dangerous Functions |
| Con.2: By default, make member functions const |
MISRA.MEMB.NON_CONST Non-const member function does not change any member variables |
| Con.3: By default, pass pointers and references to consts |
MISRA.PPARAM.NEEDS.CONST Pointer parameter is not used to modify the addressed object but is not declared as a pointer to const |
| Con.4: Use const to define objects with values that do not change after construction |
LV_UNUSED.GEN Local variable unused VA_UNUSED.GEN Value is Never Used after Assignment MISRA.VAR.NEEDS.CONST Variable is not modified but is declared without const qualifier |
| Con.5: Use constexpr for values that can be computed at compile time |
Currently, there is no applicable checker for this rule. |
| E.1: Develop an error-handling strategy early in a design |
SV.RVT.RETVAL_NOTTESTED Ignored Return Value RETVOID.GEN Non-void function returns void value RETVOID.IMPLICIT Implicitly int function returns void value |
| E.2: Throw an exception to signal that a function can't perform its assigned task |
Currently, there is no applicable checker for this rule. |
| E.3: Use exceptions for error handling only |
Currently, there is no applicable checker for this rule. |
| E.4: Design your error-handling strategy around invariants |
INVARIANT_CONDITION.GEN Invariant expression in a condition INVARIANT_CONDITION.UNREACH Invariant expression in a condition |
| E.5: Let a constructor establish an invariant, and throw if it cannot |
Currently, there is no applicable checker for this rule. |
| E.6: Use RAII to prevent leaks |
MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak RH.LEAK Resource leak |
| E.7: State your preconditions |
Currently, there is no applicable checker for this rule. |
| E.8: State your postconditions |
Currently, there is no applicable checker for this rule. |
| E.12: Use noexcept when exiting a function because of a throw is impossible or unacceptable |
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 |
| E.13: Never throw while being the direct owner of an object |
Currently, there is no applicable checker for this rule. |
| E.14: Use purpose-designed user-defined types as exceptions (not built-in types) |
Currently, there is no applicable checker for this rule. |
| E.15: Throw by value, catch exceptions from a hierarchy by reference |
MISRA.CATCH.BY_VALUE Exception object of class type is caught by value MISRA.THROW.PTR Exception object is a pointer |
| E.16: Destructors, deallocation, swap, and exception type copy/move construction must never fail |
MISRA.DTOR.THROW Throw in destructor 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 |
| E.17: Don't try to catch every exception in every function |
Currently, there is no applicable checker for this rule. |
| E.18: Minimize the use of explicit try/catch |
Currently, there is no applicable checker for this rule. |
| E.19: Use a final_action object to express cleanup if no suitable resource handle is available |
Currently, there is no applicable checker for this rule. |
| E.25: If you cannot throw exceptions, simulate RAII for resource management |
MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak RH.LEAK Resource leak |
| E.26: If you cannot throw exceptions, consider failing fast |
Currently, there is no applicable checker for this rule. |
| E.27: If you cannot throw exceptions, use error codes systematically |
SV.RVT.RETVAL_NOTTESTED Ignored Return Value |
| E.28: Avoid error handling based on global state (e.g. errno) |
Currently, there is no applicable checker for this rule. |
| E.30: Don't use exception specifications |
Currently, there is no applicable checker for this rule. |
| E.31: Properly order your catch-clauses |
MISRA.CATCH.WRONGORD Handler for a base exception class precedes to a handler for a derived exception class in a try-catch block MISRA.CATCH.NOALL Ellipsis exception handler is not the last one in a try-catch block |
| ES.5: Keep scopes small |
VA_UNUSED.GEN Value is Never Used after Assignment VA_UNUSED.INIT Value is Never Used after Initialization LV_UNUSED.GEN Local variable unused |
| ES.6: Declare names in for-statement initializers and conditions to limit scope |
Currently, there is no applicable checker for this rule. |
| ES.7: Keep common and local names short, and keep uncommon and non-local names longer |
Currently, there is no applicable checker for this rule. |
| ES.8: Avoid similar-looking names |
Currently, there is no applicable checker for this rule. |
| ES.9: Avoid ALL_CAPS names |
Currently, there is no applicable checker for this rule. |
| ES.10: Declare one name (only) per declaration |
MISRA.DECL.MANY_DCLS More than one declarator in one declaration |
| ES.11: Use auto to avoid redundant repetition of type names |
Currently, there is no applicable checker for this rule. |
| ES.12: Do not reuse names in nested scopes |
MISRA.VAR.HIDDEN Identifier declared in an inner scope hides identifier in outer scope |
| ES.20: Always initialize an object |
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 |
| ES.21: Don't introduce a variable (or constant) before you need to use it |
VA_UNUSED.GEN Value is Never Used after Assignment VA_UNUSED.INIT Value is Never Used after Initialization LV_UNUSED.GEN Local variable unused |
| ES.22: Don't declare a variable until you have a value to initialize it with |
UNINIT.STACK.MIGHT Uninitialized Variable - possible UNINIT.STACK.MUST Uninitialized Variable UNINIT.HEAP.MIGHT Uninitialized Heap Use - possible UNINIT.HEAP.MUST Uninitialized Heap Use |
| ES.23: Prefer the {}-initializer syntax |
MISRA.INIT.BRACES.2012 The initializer for an aggregate or union is not enclosed in braces |
| ES.24: Use a unique_ptr<T> to hold pointers |
Currently, there is no applicable checker for this rule. |
| ES.25: Declare an object const or constexpr unless you want to modify its value later |
LV_UNUSED.GEN Local variable unused VA_UNUSED.GEN Value is Never Used after Assignment MISRA.VAR.NEEDS.CONST Variable is not modified but is declared without const qualifier |
| ES.26: Don't use a variable for two unrelated purposes |
Currently, there is no applicable checker for this rule. |
| ES.27: Use std::array or stack_array for arrays on the stack |
Currently, there is no applicable checker for this rule. |
| ES.28: Use lambdas for complex initialization, especially of const variables |
UNINIT.STACK.MIGHT Uninitialized Variable - possible UNINIT.STACK.MUST Uninitialized Variable |
| ES.30: Don't use macros for program text manipulation |
Currently, there is no applicable checker for this rule. |
| ES.31: Don't use macros for constants or functions |
MISRA.DEFINE.FUNC Function-like macro definition |
| ES.32: Use ALL_CAPS for all macro names |
Currently, there is no applicable checker for this rule. |
| ES.33: If you must use macros, give them unique names |
Currently, there is no applicable checker for this rule. |
| ES.34: Don't define a (C-style) variadic function |
SV.FMT_STR.PRINT_PARAMS_WRONGNUM.FEW Too few arguments in a print function call SV.FMT_STR.PRINT_PARAMS_WRONGNUM.MANY Too many arguments in a print function call SV.FMT_STR.SCAN_PARAMS_WRONGNUM.FEW Too few arguments in a scan function call SV.FMT_STR.SCAN_PARAMS_WRONGNUM.MANY Too many arguments in a scan function call SV.FMT_STR.PRINT_FORMAT_MISMATCH.BAD Incompatible type of a print function parameter SV.FMT_STR.PRINT_FORMAT_MISMATCH.UNDESIRED Unexpected type of a print function parameter SV.FMT_STR.SCAN_FORMAT_MISMATCH.BAD Incompatible type of a scan function parameter SV.FMT_STR.SCAN_FORMAT_MISMATCH.UNDESIRED Unexpected type of a scan function parameter MISRA.FUNC.VARARG Function with variable number of arguments |
| ES.40: Avoid complicated expressions |
ASSIGCOND.CALL Assignment in condition (call) ASSIGCOND.GEN Assignment in condition EFFECT Statement has no effect MISRA.LOGIC.SIDEEFF Right operand in a logical 'and' or 'or' expression contains side effects MISRA.LOGIC.SIDEEFF.COND Branch expression in a conditional expression contains side effects SEMICOL Suspiciously placed semicolon MISRA.INCR_DECR.OTHER Increment or decrement operator is mixed with other operators in expression 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 |
| ES.41: If in doubt about operator precedence, parenthesize |
MISRA.EXPR.PARENS.2012 The precedence of operators within expressions should be made explicit. MISRA.EXPR.PARENS.INSUFFICIENT Limited dependence required for operator precedence rules in expressions |
| ES.42: Keep use of pointers simple and straightforward |
MISRA.PTR.TO_PTR_TO_PTR Pointer declaration has more than two levels of indirection |
| ES.43: Avoid expressions with undefined order of evaluation |
MISRA.LOGIC.SIDEEFF Right operand in a logical 'and' or 'or' expression contains side effects MISRA.LOGIC.SIDEEFF.COND Branch expression in a conditional expression contains side effects PORTING.VAR.EFFECTS Variable used twice in one expression where one usage is subject to side-effects |
| ES.44: Don't depend on order of evaluation of function arguments |
PORTING.VAR.EFFECTS Variable used twice in one expression where one usage is subject to side-effects |
| ES.45: Avoid 'magic constants'; use symbolic constants |
HCC Use of hardcoded credentials HCC.PWD Use of a hardcoded password HCC.USER Use of a hardcoded user name CXX.USE.MAGIC_NUMBER Use of magic number |
| ES.46: Avoid lossy (narrowing, truncating) arithmetic conversions |
MISRA.CAST.INT Non-trivial integer expression is cast to a wider type, or type with a different signedness MISRA.CAST.UNSIGNED_BITS The result of bitwise operation on unsigned char or short is not cast back to original type MISRA.CONV.INT.SIGN Implicit integral conversion changes signedness MISRA.CVALUE.IMPL.CAST.CPP The value of an expression implicitly converted to a different type MISRA.UMINUS.UNSIGNED Operand of unary minus is unsigned NUM.OVERFLOW Possible Overflow NUM.OVERFLOW.DF Possible numeric overflow or wraparound PRECISION.LOSS Loss of Precision PRECISION.LOSS.CALL Loss of Precision during function call PRECISION.LOSS.INIT Loss of Precision during initialization |
| ES.47: Use nullptr rather than 0 or NULL |
NPD.CONST.CALL NULL is passed to function that can dereference it NPD.CONST.DEREF NULL is dereferenced MISRA.LITERAL.NULL.PTR.CONST.2012 The macro NULL is the only permitted form of integer null pointer constant |
| ES.48: Avoid casts |
MISRA.CAST.CONST Cast operation removes const or volatile modifier from a pointer or reference MISRA.CAST.FUNC_PTR.2012 Conversion performed between a pointer to a function and another incompatible type MISRA.CAST.INT Non-trivial integer expression is cast to a wider type, or type with a different signedness MISRA.CAST.OBJ_PTR_TO_INT.2012 Conversion performed between a pointer to an object and an integer type MISRA.CAST.OBJ_PTR_TO_NON_INT.2012 A cast between a pointer to object and a non-integer arithmetic type MISRA.CAST.OBJ_PTR_TO_OBJ_PTR.2012 Cast between a pointer to object type and a pointer to a different object type MISRA.CAST.VOID_PTR_TO_INT.2012 Cast between a pointer to void and an arithmetic type MISRA.CAST.VOID_PTR_TO_OBJ_PTR.2012 Conversion performed from a pointer to void to a pointer to an object PORTING.CAST.FLTPNT Cast of a floating point expression to a non floating point type PORTING.CAST.PTR.FLTPNT Cast of a pointer to a floating point expression to a non floating point type pointer PORTING.CAST.PTR.SIZE Attempt to cast an expression to a type of a potentially incompatible size AUTOSAR.CAST.REINTERPRET reinterpret_cast shall not be used AUTOSAR.CAST.CSTYLE Traditional C-style casts shall not be used |
| ES.49: If you must use a cast, use a named cast |
MISRA.CAST.CONST Cast operation removes const or volatile modifier from a pointer or reference MISRA.CAST.OBJ_PTR_TO_OBJ_PTR.2012 Cast between a pointer to object type and a pointer to a different object type AUTOSAR.CAST.CSTYLE Traditional C-style casts shall not be used |
| ES.50: Don't cast away const |
MISRA.CAST.CONST Cast operation removes const or volatile modifier from a pointer or reference |
| ES.55: Avoid the need for range checking |
Currently, there is no applicable checker for this rule. |
| ES.56: Write std::move() only when you need to explicitly move an object |
UFM.USE.MIGHT Use of free memory - possible UFM.USE.MUST Use of Freed Memory AUTOSAR.STDLIB.MOVE.CONST The std::move shall not be used on objects declared const or const& |
| ES.60: Avoid new and delete outside resource management functions |
MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak UFM.FFM.MIGHT Use of free memory (double free) - possible UFM.FFM.MUST Freeing Freed Memory |
| ES.61: Delete arrays using delete[] and non-arrays using delete |
FMM.MIGHT Freeing Mismatched Memory - possible FMM.MUST Freeing Mismatched Memory CL.FMM Freeing Mismatched Memory - in destructor |
| ES.62: Don't compare pointers into different arrays |
CWARN.BAD.PTR.ARITH Bad pointer arithmetic MISRA.PTR.ARITH Pointer is used in arithmetic or array index expression |
| ES.63: Don't slice |
CL.SHALLOW.ASSIGN Use of free memory (double free) - shallow copy in operator= CL.SHALLOW.COPY Use of free memory (double free) - shallow copy in copy constructor |
| ES.64: Use the T{e} notation for construction |
Currently, there is no applicable checker for this rule. |
| ES.65: Don't dereference an invalid pointer |
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 RNPD.CALL Suspicious dereference of pointer in function call before NULL check RNPD.DEREF Suspicious dereference of pointer before NULL check UFM.DEREF.MIGHT Use of free memory (access) - possible UFM.DEREF.MUST Use of Freed Memory by Pointer |
| ES.70: Prefer a switch-statement to an if-statement when there is a choice |
MISRA.SWITCH.NO_BREAK No break or throw statement at the end of switch-clause MISRA.SWITCH.WELL_FORMED.BREAK.2012 An unconditional break statement shall terminate every switch-clause. MISRA.SWITCH.WELL_FORMED.DEFAULT.2012 Every switch statement shall have a default label. |
| ES.71: Prefer a range-for-statement to a for-statement when there is a choice |
Currently, there is no applicable checker for this rule. |
| ES.72: Prefer a for-statement to a while-statement when there is an obvious loop variable |
Currently, there is no applicable checker for this rule. |
| ES.73: Prefer a while-statement to a for-statement when there is no obvious loop variable |
Currently, there is no applicable checker for this rule. |
| ES.74: Prefer to declare a loop variable in the initializer part of a for-statement |
Currently, there is no applicable checker for this rule. |
| ES.75: Avoid do-statements |
Currently, there is no applicable checker for this rule. |
| ES.76: Avoid goto |
AUTOSAR.GOTO The goto statement shall not be used MISRA.GOTO Goto statement is used |
| ES.77: Minimize the use of break and continue in loops |
Currently, there is no applicable checker for this rule. |
| ES.78: Don't rely on implicit fallthrough in switch statements |
MISRA.SWITCH.NO_BREAK No break or throw statement at the end of switch-clause MISRA.SWITCH.WELL_FORMED.BREAK.2012 An unconditional break statement shall terminate every switch-clause. |
| ES.79: Use default to handle common cases only |
MISRA.SWITCH.WELL_FORMED.DEFAULT.2012 Every switch statement shall have a default label. |
| ES.80: Don't use a cast to reinterpret a switch condition |
Currently, there is no applicable checker for this rule. |
| ES.81: Don't write loop bodies that end with an unconditional jump |
Currently, there is no applicable checker for this rule. |
| ES.82: Don't declare a variable in a switch case |
CERT.DCL.SWITCH.VAR_BEFORE_CASE Do not declare variables inside a switch statement before the first case label |
| ES.83: Don't use a compound expression as a for-loop variable |
Currently, there is no applicable checker for this rule. |
| ES.84: Don't try to declare a local variable with no name |
LV_UNUSED.GEN Local variable unused VA_UNUSED.GEN Value is Never Used after Assignment VA_UNUSED.INIT Value is Never Used after Initialization |
| ES.85: Make empty statements visible |
EFFECT Statement has no effect SEMICOL Suspiciously placed semicolon |
| ES.86: Avoid modifying loop control variables inside the body of raw for-loops |
SV.TAINTED.LOOP_BOUND Use of Unvalidated Integer in Loop Condition SV.TAINTED.CALL.LOOP_BOUND Use of Unvalidated Integer in Loop Condition through a Function Call 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.STMT.CHANGE For loop counter is modified within the loop statement |
| ES.87: Don't add redundant == or != to conditions |
Currently, there is no applicable checker for this rule. |
| ES.100: Don't mix signed and unsigned arithmetic |
MISRA.CAST.INT.SIGN Non-trivial integral expression is cast to type with different signedness MISRA.CONV.INT.SIGN Implicit integral conversion changes signedness |
| ES.101: Use unsigned types for bit manipulation |
MISRA.SHIFT.RANGE Right operand of shift operation is out of range - greater or equal to max bit-length of left operand, or negative 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 |
| ES.102: Use signed types for arithmetic |
Currently, there is no applicable checker for this rule. |
| ES.103: Don't overflow |
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 NUM.OVERFLOW Possible Overflow NUM.OVERFLOW.DF Possible numeric overflow or wraparound |
| ES.104: Don't underflow |
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 RN.INDEX Suspicious use of index before negative check |
| ES.105: Don't divide by integer 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.FLOAT Division by zero might occur in a loop iterator DBZ.ITERATOR.CALL Division by zero might occur in a function call |
| ES.106: Don't try to avoid negative values by using unsigned |
MISRA.CAST.INT.SIGN Non-trivial integral expression is cast to type with different signedness MISRA.CONV.INT.SIGN Implicit integral conversion changes signedness MISRA.UMINUS.UNSIGNED Operand of unary minus is unsigned |
| ES.107: Don't use unsigned for subscripts |
ABV.TAINTED Buffer Overflow from Unvalidated Input CXX.SUSPICIOUS_INDEX_CHECK Suspicious use of index after boundary check CXX.SUSPICIOUS_INDEX_CHECK.CALL Suspicious use of index in a function call after a boundary check CXX.SUSPICIOUS_INDEX_CHECK.ZERO Suspicious use of index after index check for zero RABV.CHECK Suspicious use of index before boundary check RN.INDEX Suspicious use of index before negative check |
| Enum.1: Prefer enumerations over macros |
Currently, there is no applicable checker for this rule. |
| Enum.2: Use enumerations to represent sets of related named constants |
Currently, there is no applicable checker for this rule. |
| Enum.3: Prefer class enums over plain enums |
AUTOSAR.ENUM.UNSCOPED Enumerations shall be declared as scoped enum classes |
| Enum.4: Define operations on enumerations for safe and simple use |
Currently, there is no applicable checker for this rule. |
| Enum.5: Don't use ALL_CAPS for enumerators |
Currently, there is no applicable checker for this rule. |
| Enum.6: Avoid unnamed enumerations |
Currently, there is no applicable checker for this rule. |
| Enum.7: Specify the underlying type of an enumeration only when necessary |
Currently, there is no applicable checker for this rule. |
| Enum.8: Specify enumerator values only when necessary |
MISRA.ENUM.IMPLICIT.VAL.NON_UNIQUE.2012 Implicit enumerator value is not unique |
| F.1: Package meaningful operations as carefully named functions |
Currently, there is no applicable checker for this rule. |
| F.2: A function should perform a single logical operation |
Currently, there is no applicable checker for this rule. |
| F.3: Keep functions short and simple |
Currently, there is no applicable checker for this rule. |
| F.4: If a function must be very short and time-critical, declare it inline |
Currently, there is no applicable checker for this rule. |
| F.5: If a function is very small and time-critical, declare it constexpr |
Currently, there is no applicable checker for this rule. |
| F.6: If your function must not throw, declare it noexcept |
RETVOID.GEN Non-void function returns void value RETVOID.IMPLICIT Implicitly int function returns void value VOIDRET Void function returns value |
| F.7: For general use, take T* or T& arguments rather than smart pointers |
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.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 |
| F.8: Prefer pure functions |
Currently, there is no applicable checker for this rule. |
| F.9: Unused parameters should be unnamed |
MISRA.FUNC.UNUSEDPAR.2012 Unused parameters in functions |
| F.10: If an operation can be reused, give it a name |
Currently, there is no applicable checker for this rule. |
| F.11: Use an unnamed lambda if you need a simple function object in one place only |
Currently, there is no applicable checker for this rule. |
| F.15: Prefer simple and conventional ways of passing information |
Currently, there is no applicable checker for this rule. |
| F.16: For in parameters, pass cheaply-copied types by value and others by reference to const |
MISRA.PPARAM.NEEDS.CONST Pointer parameter is not used to modify the addressed object but is not declared as a pointer to const |
| F.17: For in-out parameters, pass by reference to non-const |
Currently, there is no applicable checker for this rule. |
| F.18: For will-move-from parameters, pass by X&& and std::move the parameter |
Currently, there is no applicable checker for this rule. |
| F.19: For forward parameters, pass by TP&& and only std::forward the parameter |
Currently, there is no applicable checker for this rule. |
| F.20: For out output values, prefer return values to output parameters |
Currently, there is no applicable checker for this rule. |
| F.21: To return multiple out values, prefer returning a struct |
Currently, there is no applicable checker for this rule. |
| F.22: Use T* or owner<T*> to designate a single object |
Currently, there is no applicable checker for this rule. |
| F.23: Use a not_null<T> to indicate that null is not a valid value |
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 RNPD.CALL Suspicious dereference of pointer in function call before NULL check RNPD.DEREF Suspicious dereference of pointer before NULL check |
| F.24: Use a span<T> or a span_p<T> to designate a half-open sequence |
Currently, there is no applicable checker for this rule. |
| F.25: Use a zstring or a not_null<zstring> to designate a C-style string |
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 |
| F.26: Use a unique_ptr<T> to transfer ownership where a pointer is needed |
Currently, there is no applicable checker for this rule. |
| F.27: Use a shared_ptr<T> to share ownership |
Currently, there is no applicable checker for this rule. |
| F.42: Return a T* to indicate a position only |
Currently, there is no applicable checker for this rule. |
| F.43: Never (directly or indirectly) return a pointer or a reference to a local object |
LOCRET.ARG Function returns address of local variable LOCRET.GLOB Function returns address of local variable LOCRET.RET Function returns address of local variable |
| F.44: Return a T& when copy is undesirable and returning no object is an option |
Currently, there is no applicable checker for this rule. |
| F.45: Don't return a T&& |
LOCRET.ARG Function returns address of local variable LOCRET.GLOB Function returns address of local variable LOCRET.RET Function returns address of local variable |
| F.46: int is the return type for main() |
FUNCRET.GEN Non-void function does not return value FUNCRET.IMPLICIT Non-void function implicitly returning int does not return value |
| F.47: Return T& from assignment operators |
Currently, there is no applicable checker for this rule. |
| F.48: Don't return std::move(local) |
LOCRET.RET Function returns address of local variable |
| F.49: Don't return const T |
Currently, there is no applicable checker for this rule. |
| F.51: Where there is a choice, prefer default arguments over overloading |
MISRA.FUNC.UNMATCHED.PARAMS Number of formal and actual parameters passed to function do not match |
| F.52: Prefer capturing by reference in lambdas that will be used locally |
Currently, there is no applicable checker for this rule. |
| F.53: Avoid capturing by reference in lambdas that will be used non-locally |
AUTOSAR.LAMBDA.REF_LIFETIME A lambda expression object shall not outlive any of its reference-captured objects |
| F.54: When writing a lambda that captures this or any class data member, don't use [=] |
AUTOSAR.LAMBDA.IMPLICIT_CAPTURE Variables shall not be implicitly captured in a lambda expression |
| F.55: Don't use va_arg arguments |
MISRA.FUNC.VARARG Function with variable number of arguments VA.LIST.INDETERMINATE Attempt to call va_arg() on a va_list that has an indeterminate value |
| F.56: Avoid unnecessary condition nesting |
Currently, there is no applicable checker for this rule. |
| I.1: Make interfaces explicit |
Currently, there is no applicable checker for this rule. |
| I.2: Avoid non-const global variables |
Currently, there is no applicable checker for this rule. |
| I.3: Avoid singletons |
Currently, there is no applicable checker for this rule. |
| I.4: Make interfaces precisely and strongly typed |
Currently, there is no applicable checker for this rule. |
| I.5: State preconditions (if any) |
Currently, there is no applicable checker for this rule. |
| I.6: Prefer Expects() for expressing preconditions |
Currently, there is no applicable checker for this rule. |
| I.7: State postconditions |
Currently, there is no applicable checker for this rule. |
| I.8: Prefer Ensures() for expressing postconditions |
Currently, there is no applicable checker for this rule. |
| I.9: If an interface is a template, document its parameters using concepts |
Currently, there is no applicable checker for this rule. |
| I.10: Use exceptions to signal a failure to perform a required task |
SV.RVT.RETVAL_NOTTESTED Ignored Return Value RETVOID.GEN Non-void function returns void value RETVOID.IMPLICIT Implicitly int function returns void value VOIDRET Void function returns value |
| I.11: Never transfer ownership by a raw pointer (T*) or reference (T&) |
Currently, there is no applicable checker for this rule. |
| I.12: Declare a pointer that must not be null as not_null |
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 RNPD.CALL Suspicious dereference of pointer in function call before NULL check RNPD.DEREF Suspicious dereference of pointer before NULL check |
| I.13: Do not pass an array as a single pointer |
ABV.ANY_SIZE_ARRAY Buffer Overflow - Array Index Out of Bounds ABV.GENERAL Buffer Overflow - Array Index Out of Bounds ABV.UNKNOWN_SIZE Buffer Overflow - Array Index Out of Bounds SV.TAINTED.CALL.INDEX_ACCESS Use of Unvalidated Integer as Array Index by Function Call SV.TAINTED.INDEX_ACCESS Use of Unvalidated Integer as Array Index |
| I.22: Avoid complex initialization of global objects |
UNINIT.STACK.MIGHT Uninitialized Variable - possible UNINIT.STACK.MUST Uninitialized Variable UNINIT.HEAP.MIGHT Uninitialized Heap Use - possible UNINIT.HEAP.MUST Uninitialized Heap Use |
| I.23: Keep the number of function arguments low |
Currently, there is no applicable checker for this rule. |
| I.24: Avoid adjacent parameters that can be invoked by the same arguments in either order with different meaning |
Currently, there is no applicable checker for this rule. |
| I.25: Prefer empty abstract classes as interfaces to class hierarchies |
Currently, there is no applicable checker for this rule. |
| I.26: If you want a cross-compiler ABI, use a C-style subset |
Currently, there is no applicable checker for this rule. |
| I.27: For stable library ABI, consider the Pimpl idiom |
Currently, there is no applicable checker for this rule. |
| I.30: Encapsulate rule violations |
SV.LPP.CONST Use of Insecure Macro for Dangerous Functions SV.LPP.VAR Use of Insecure Parameter for Dangerous Functions |
| NL.1: Don't say in comments what can be clearly stated in code |
Currently, there is no applicable checker for this rule. |
| NL.2: State intent in comments |
Currently, there is no applicable checker for this rule. |
| NL.3: Keep comments crisp |
Currently, there is no applicable checker for this rule. |
| NL.4: Maintain a consistent indentation style |
Currently, there is no applicable checker for this rule. |
| NL.5: Avoid encoding type information in names |
Currently, there is no applicable checker for this rule. |
| NL.7: Make the length of a name roughly proportional to the length of its scope |
Currently, there is no applicable checker for this rule. |
| NL.8: Use a consistent naming style |
Currently, there is no applicable checker for this rule. |
| NL.9: Use ALL_CAPS for macro names only |
Currently, there is no applicable checker for this rule. |
| NL.10: Prefer underscore_style names |
Currently, there is no applicable checker for this rule. |
| NL.11: Make literals readable |
Currently, there is no applicable checker for this rule. |
| NL.15: Use spaces sparingly |
Currently, there is no applicable checker for this rule. |
| NL.16: Use a conventional class member declaration order |
Currently, there is no applicable checker for this rule. |
| NL.17: Use K&R-derived layout |
Currently, there is no applicable checker for this rule. |
| NL.18: Use C++-style declarator layout |
Currently, there is no applicable checker for this rule. |
| NL.19: Avoid names that are easily misread |
Currently, there is no applicable checker for this rule. |
| NL.20: Don't place two statements on the same line |
Currently, there is no applicable checker for this rule. |
| NL.21: Declare one name (only) per declaration |
Currently, there is no applicable checker for this rule. |
| NL.25: Don't use void as an argument type |
Currently, there is no applicable checker for this rule. |
| NL.26: Use conventional const notation |
Currently, there is no applicable checker for this rule. |
| NL.27: Use a .cpp suffix for code files and .h for interface files |
Currently, there is no applicable checker for this rule. |
| P.1: Express ideas directly in code |
Currently, there is no applicable checker for this rule. |
| P.2: Write in ISO Standard C++ |
Currently, there is no applicable checker for this rule. |
| P.3: Express intent |
Currently, there is no applicable checker for this rule. |
| P.4: Ideally, a program should be statically type safe |
MISRA.CAST.CONST Cast operation removes const or volatile modifier from a pointer or reference MISRA.CAST.FUNC_PTR.2012 Conversion performed between a pointer to a function and another incompatible type MISRA.CAST.INT Non-trivial integer expression is cast to a wider type, or type with a different signedness MISRA.CAST.INT.SIGN Non-trivial integral expression is cast to type with different signedness MISRA.CAST.OBJ_PTR_TO_INT.2012 Conversion performed between a pointer to an object and an integer type MISRA.CAST.OBJ_PTR_TO_NON_INT.2012 A cast between a pointer to object and a non-integer arithmetic type MISRA.CAST.OBJ_PTR_TO_OBJ_PTR.2012 Cast between a pointer to object type and a pointer to a different object type MISRA.CAST.VOID_PTR_TO_INT.2012 Cast between a pointer to void and an arithmetic type MISRA.CAST.VOID_PTR_TO_OBJ_PTR.2012 Conversion performed from a pointer to void to a pointer to an object PORTING.CAST.FLTPNT Cast of a floating point expression to a non floating point type PORTING.CAST.PTR.FLTPNT Cast of a pointer to a floating point expression to a non floating point type pointer PORTING.CAST.PTR.SIZE Attempt to cast an expression to a type of a potentially incompatible size PRECISION.LOSS Loss of Precision PRECISION.LOSS.CALL Loss of Precision during function call PRECISION.LOSS.INIT Loss of Precision during initialization |
| P.5: Prefer compile-time checking to run-time checking |
INVARIANT_CONDITION.GEN Invariant expression in a condition INVARIANT_CONDITION.UNREACH Invariant expression in a condition UNREACH.GEN Unreachable code UNREACH.RETURN Unreachable Void Return UNREACH.ENUM Code is unreachable due to the possible value(s) of an enum UNREACH.SIZEOF Architecture-related unreachable code |
| P.6: What cannot be checked at compile time should be checkable at run time |
Currently, there is no applicable checker for this rule. |
| P.7: Catch run-time errors early |
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 ABV.TAINTED Buffer Overflow from Unvalidated Input 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.MIGHT Null pointer may be dereferenced NPD.GEN.MUST Null pointer will be dereferenced SV.RVT.RETVAL_NOTTESTED Ignored Return Value 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.FLOAT Division by zero might occur in a loop iterator DBZ.ITERATOR.CALL Division by zero might occur in a function call NUM.OVERFLOW Possible Overflow NUM.OVERFLOW.DF Possible numeric overflow or wraparound |
| P.8: Don't leak any resources |
CL.MLK Memory Leak - in destructor CL.MLK.ASSIGN Memory Leak - in assignment operator CL.MLK.VIRTUAL Memory Leak - possible in destructor FMM.MIGHT Freeing Mismatched Memory - possible FMM.MUST Freeing Mismatched Memory MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak MLK.RET.MIGHT Memory Leak - possible MLK.RET.MUST Memory Leak RH.LEAK Resource leak |
| P.9: Don't waste time or space |
Currently, there is no applicable checker for this rule. |
| P.10: Prefer immutable data to mutable data |
MISRA.CAST.CONST Cast operation removes const or volatile modifier from a pointer or reference SV.LPP.CONST Use of Insecure Macro for Dangerous Functions SV.LPP.VAR Use of Insecure Parameter for Dangerous Functions |
| P.11: Encapsulate messy constructs, rather than spreading through the code |
Currently, there is no applicable checker for this rule. |
| P.12: Use supporting tools as appropriate |
Currently, there is no applicable checker for this rule. |
| P.13: Use support libraries as appropriate |
Currently, there is no applicable checker for this rule. |
| Per.1: Don't optimize without reason |
Currently, there is no applicable checker for this rule. |
| Per.2: Don't optimize prematurely |
Currently, there is no applicable checker for this rule. |
| Per.3: Don't optimize something that's not performance critical |
Currently, there is no applicable checker for this rule. |
| Per.4: Don't assume that complicated code is necessarily faster than simple code |
Currently, there is no applicable checker for this rule. |
| Per.5: Don't assume that low-level code is necessarily faster than high-level code |
Currently, there is no applicable checker for this rule. |
| Per.6: Don't make claims about performance without measurements |
Currently, there is no applicable checker for this rule. |
| Per.7: Design to enable optimization |
Currently, there is no applicable checker for this rule. |
| Per.10: Rely on the static type system |
Currently, there is no applicable checker for this rule. |
| Per.11: Move computation from run time to compile time |
Currently, there is no applicable checker for this rule. |
| Per.12: Eliminate redundant aliases |
Currently, there is no applicable checker for this rule. |
| Per.13: Eliminate redundant indirections |
Currently, there is no applicable checker for this rule. |
| Per.14: Minimize the number of allocations and deallocations |
Currently, there is no applicable checker for this rule. |
| Per.15: Do not allocate on a critical branch |
Currently, there is no applicable checker for this rule. |
| Per.16: Use compact data structures |
Currently, there is no applicable checker for this rule. |
| Per.17: Declare the most used member of a time-critical struct first |
Currently, there is no applicable checker for this rule. |
| Per.18: Space is time |
Currently, there is no applicable checker for this rule. |
| Per.19: Access memory predictably |
Currently, there is no applicable checker for this rule. |
| Per.30: Avoid context switches on the critical path |
Currently, there is no applicable checker for this rule. |
| Pro.bounds: Bounds safety profile |
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 CWARN.ALIGNMENT Incorrect pointer scaling is used CWARN.BAD.PTR.ARITH Bad pointer arithmetic CXX.ITER.END.BEGIN Iterator representing end of the range precedes start of range CXX.SUSPICIOUS_INDEX_CHECK Suspicious use of index after boundary check CXX.SUSPICIOUS_INDEX_CHECK.CALL Suspicious use of index in a function call after a boundary check CXX.SUSPICIOUS_INDEX_CHECK.ZERO Suspicious use of index after index check for zero ITER.ADVANCE.NONADJACENT Advancing iterator by a distance of more than 1 ITER.CONTAINER.MODIFIED Use of invalid iterator ITER.END.OUTPARAM.MIGHT Use of 'end' as an output iterator ITER.END.OUTPARAM.MUST Use of 'end' as an output iterator ITER.INAPPROPRIATE Use of iterator with inappropriate container object ITER.INAPPROPRIATE.MULTIPLE Use of iterator with inappropriate container object MISRA.PTR.ARITH Pointer is used in arithmetic or array index expression RABV.CHECK Suspicious use of index before boundary check RN.INDEX Suspicious use of index before negative check SV.STRBO.BOUND_COPY.OVERFLOW Buffer Overflow in Bound String Copy SV.STRBO.BOUND_COPY.UNTERM Possible Buffer Overflow in Following String Operations SV.STRBO.BOUND_SPRINTF Buffer Overflow in Bound sprintf SV.STRBO.UNBOUND_COPY Buffer Overflow in Unbound String Copy SV.STRBO.UNBOUND_SPRINTF Buffer Overflow in Unbound sprintf SV.TAINTED.CALL.INDEX_ACCESS Use of Unvalidated Integer as Array Index by Function Call SV.TAINTED.INDEX_ACCESS Use of Unvalidated Integer as Array Index |
| Pro.lifetime: Lifetime safety profile |
AUTOSAR.LAMBDA.REF_LIFETIME A lambda expression object shall not outlive any of its reference-captured objects CERT.MEM.SMART_PTR.OWNED Multiple smart pointer owners of pointer CERT.MEM.SMART_PTR.OWNED.THIS The underlying resource might be already owned by a non-related smart pointer CL.FFM.ASSIGN Use of free memory (double free) - no operator= CL.FFM.COPY Use of free memory (double free) - no copy constructor CL.SELF-ASSIGN Use of free memory (double free) - in operator= CL.SHALLOW.ASSIGN Use of free memory (double free) - shallow copy in operator= CL.SHALLOW.COPY Use of free memory (double free) - shallow copy in copy constructor LOCRET.ARG Function returns address of local variable LOCRET.GLOB Function returns address of local variable LOCRET.RET Function returns address of local variable 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 RNPD.CALL Suspicious dereference of pointer in function call before NULL check RNPD.DEREF Suspicious dereference of pointer before NULL check SV.INCORRECT_RESOURCE_HANDLING.URH Insecure Resource Handling UFM.DEREF.MIGHT Use of free memory (access) - possible UFM.DEREF.MUST Use of Freed Memory by Pointer UFM.FFM.MIGHT Use of free memory (double free) - possible UFM.FFM.MUST Freeing Freed Memory UFM.RETURN.MIGHT Use of freed memory (return) - possible UFM.RETURN.MUST Use of Freed Memory on Return UFM.USE.MIGHT Use of free memory - possible UFM.USE.MUST Use of Freed Memory |
| Pro.type: Type safety profile |
AUTOSAR.CAST.CSTYLE Traditional C-style casts shall not be used AUTOSAR.CAST.REINTERPRET reinterpret_cast shall not be used MISRA.CAST.CONST Cast operation removes const or volatile modifier from a pointer or reference MISRA.CAST.FUNC_PTR.2012 Conversion performed between a pointer to a function and another incompatible type MISRA.CAST.INCOMPLETE_PTR_TO_ANY.2012 Conversion performed between a pointer to an incomplete type and a different type MISRA.CAST.INT Non-trivial integer expression is cast to a wider type, or type with a different signedness MISRA.CAST.INT.SIGN Non-trivial integral expression is cast to type with different signedness MISRA.CAST.OBJ_PTR_TO_INT.2012 Conversion performed between a pointer to an object and an integer type MISRA.CAST.OBJ_PTR_TO_NON_INT.2012 A cast between a pointer to object and a non-integer arithmetic type MISRA.CAST.OBJ_PTR_TO_OBJ_PTR.2012 Cast between a pointer to object type and a pointer to a different object type MISRA.CAST.UNSIGNED_BITS The result of bitwise operation on unsigned char or short is not cast back to original type MISRA.CAST.VOID_PTR_TO_INT.2012 Cast between a pointer to void and an arithmetic type MISRA.CAST.VOID_PTR_TO_OBJ_PTR.2012 Conversion performed from a pointer to void to a pointer to an object MISRA.FUNC.VARARG Function with variable number of arguments MISRA.UNION Union is used PORTING.CAST.FLTPNT Cast of a floating point expression to a non floating point type PORTING.CAST.PTR.FLTPNT Cast of a pointer to a floating point expression to a non floating point type pointer PORTING.CAST.PTR.SIZE Attempt to cast an expression to a type of a potentially incompatible size PRECISION.LOSS Loss of Precision PRECISION.LOSS.CALL Loss of Precision during function call PRECISION.LOSS.INIT Loss of Precision during initialization |
| R.1: Manage resources automatically using resource handles and RAII |
CL.MLK Memory Leak - in destructor CL.MLK.ASSIGN Memory Leak - in assignment operator CL.MLK.VIRTUAL Memory Leak - possible in destructor FMM.MIGHT Freeing Mismatched Memory - possible FMM.MUST Freeing Mismatched Memory MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak MLK.RET.MIGHT Memory Leak - possible MLK.RET.MUST Memory Leak RH.LEAK Resource leak |
| R.2: In interfaces, use raw pointers to denote individual objects only |
ABV.ANY_SIZE_ARRAY Buffer Overflow - Array Index Out of Bounds ABV.UNKNOWN_SIZE Buffer Overflow - Array Index Out of Bounds |
| R.3: A raw pointer (a T*) is non-owning |
UFM.DEREF.MIGHT Use of free memory (access) - possible UFM.DEREF.MUST Use of Freed Memory by Pointer UFM.USE.MIGHT Use of free memory - possible UFM.USE.MUST Use of Freed Memory |
| R.4: A raw reference (a T&) is non-owning |
Currently, there is no applicable checker for this rule. |
| R.5: Prefer scoped objects, don't heap-allocate unnecessarily |
MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak MLK.RET.MIGHT Memory Leak - possible MLK.RET.MUST Memory Leak |
| R.6: Avoid non-const global variables |
Currently, there is no applicable checker for this rule. |
| R.10: Avoid malloc() and free() |
FMM.MIGHT Freeing Mismatched Memory - possible FMM.MUST Freeing Mismatched Memory FNH.MIGHT Freeing Non-Heap Memory - possible FNH.MUST Freeing Non-Heap Memory |
| R.11: Avoid calling new and delete explicitly |
MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak UFM.FFM.MIGHT Use of free memory (double free) - possible UFM.FFM.MUST Freeing Freed Memory |
| R.12: Immediately give the result of an explicit resource allocation to a manager object |
MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak MLK.RET.MIGHT Memory Leak - possible MLK.RET.MUST Memory Leak |
| R.13: Perform at most one explicit resource allocation in a single expression statement |
MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak |
| R.14: Avoid [] parameters, prefer span |
Currently, there is no applicable checker for this rule. |
| R.15: Always overload matched allocation/deallocation pairs |
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 |
| R.20: Use unique_ptr or shared_ptr to represent ownership |
Currently, there is no applicable checker for this rule. |
| R.21: Prefer unique_ptr over shared_ptr unless you need to share ownership |
Currently, there is no applicable checker for this rule. |
| R.22: Use make_shared() to make shared_ptrs |
MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak MLK.RET.MIGHT Memory Leak - possible MLK.RET.MUST Memory Leak |
| R.23: Use make_unique() to make unique_ptrs |
MLK.MIGHT Memory Leak - possible MLK.MUST Memory Leak MLK.RET.MIGHT Memory Leak - possible MLK.RET.MUST Memory Leak |
| R.24: Use std::weak_ptr to break cycles of shared_ptrs |
Currently, there is no applicable checker for this rule. |
| R.30: Take smart pointers as parameters only to explicitly express lifetime semantics |
Currently, there is no applicable checker for this rule. |
| R.31: If you have non-std smart pointers, follow the basic pattern from std |
Currently, there is no applicable checker for this rule. |
| R.32: Take a unique_ptr<widget> parameter to express that a function assumes ownership of a widget |
Currently, there is no applicable checker for this rule. |
| R.33: Take a unique_ptr<widget>& parameter to express that a function reseats the widget |
Currently, there is no applicable checker for this rule. |
| R.34: Take a shared_ptr<widget> parameter to express shared ownership |
Currently, there is no applicable checker for this rule. |
| R.35: Take a shared_ptr<widget>& parameter to express that a function might reseat the shared pointer |
Currently, there is no applicable checker for this rule. |
| R.36: Take a const shared_ptr<widget>& parameter to express that it might retain a reference count to the object |
Currently, there is no applicable checker for this rule. |
| R.37: Do not pass a pointer or reference obtained from an aliased smart pointer |
CERT.MEM.SMART_PTR.OWNED Multiple smart pointer owners of pointer CERT.MEM.SMART_PTR.OWNED.THIS The underlying resource might be already owned by a non-related smart pointer |
| SF.1: Use a .cpp suffix for code files and .h for interface files |
Currently, there is no applicable checker for this rule. |
| SF.2: A header file must not contain object definitions or non-inline function definitions |
MISRA.ONEDEFRULE.FUNC Global function definition in a header file MISRA.ONEDEFRULE.VAR Global variable definition in a header file |
| SF.3: Use header files for all declarations used in multiple source files |
MISRA.LINKAGE.EXTERN Object or function declaration with external linkage not in header file |
| SF.4: Include header files before other declarations in a file |
MISRA.INCL.INSIDE Include directive preceded by a preprocessor output token |
| SF.5: A .cpp file must include the .h file(s) that defines its interface |
Currently, there is no applicable checker for this rule. |
| SF.6: Use using namespace directives for transition, for foundation libraries, or within a local scope only |
MISRA.NS.USING_DIR Using directive |
| SF.7: Don't write using namespace at global scope in a header file |
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 |
| SF.8: Use #include guards for all .h files |
MISRA.INCGUARD Include guard is not provided |
| SF.9: Avoid cyclic dependencies among source files |
Currently, there is no applicable checker for this rule. |
| SF.10: Avoid dependencies on implicitly #included names |
Currently, there is no applicable checker for this rule. |
| SF.11: Header files should be self-contained |
Currently, there is no applicable checker for this rule. |
| SF.12: Prefer the quoted form of #include for files relative to the including file |
Currently, there is no applicable checker for this rule. |
| SF.13: Use portable header identifiers when including headers |
Currently, there is no applicable checker for this rule. |
| SF.20: Use namespaces to express logical structure |
Currently, there is no applicable checker for this rule. |
| SF.21: Don't use an unnamed (anonymous) namespace in a header |
MISRA.NAMESPACE.UNMD Unnamed namespace in header file |
| SF.22: Use an unnamed (anonymous) namespace for all internal/non-exported entities |
Currently, there is no applicable checker for this rule. |
| SL.1: Use the standard library where possible |
Currently, there is no applicable checker for this rule. |
| SL.2: Prefer the standard library to other libraries |
Currently, there is no applicable checker for this rule. |
| SL.3: Do not add non-standard entities to namespace std |
CERT.DCL.STD_NS_MODIFIED Do not modify the standard namespaces |
| SL.4: Use the standard library in a type-safe manner |
SV.FMT_STR.PRINT_FORMAT_MISMATCH.BAD Incompatible type of a print function parameter SV.FMT_STR.SCAN_FORMAT_MISMATCH.BAD Incompatible type of a scan function parameter SV.FMT_STR.PRINT_PARAMS_WRONGNUM.FEW Too few arguments in a print function call SV.FMT_STR.PRINT_PARAMS_WRONGNUM.MANY Too many arguments in a print function call |
| SL.chrono.1: Use std::chrono::duration to express time durations |
Currently, there is no applicable checker for this rule. |
| SL.chrono.2: Use std::chrono::time_point to express specific points in time |
Currently, there is no applicable checker for this rule. |
| SL.con.1: Prefer using STL array or vector instead of a C array |
ABV.ANY_SIZE_ARRAY Buffer Overflow - Array Index Out of Bounds ABV.UNKNOWN_SIZE Buffer Overflow - Array Index Out of Bounds AUTOSAR.ARRAY.CSTYLE C-style arrays shall not be used |
| SL.con.2: Prefer using STL vector by default unless you have a reason to use a different container |
Currently, there is no applicable checker for this rule. |
| SL.con.3: Avoid bounds errors |
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 RABV.CHECK Suspicious use of index before boundary check RN.INDEX Suspicious use of index before negative check ITER.CONTAINER.MODIFIED Use of invalid iterator ITER.INAPPROPRIATE Use of iterator with inappropriate container object ITER.INAPPROPRIATE.MULTIPLE Use of iterator with inappropriate container object ITER.END.OUTPARAM.MIGHT Use of 'end' as an output iterator ITER.END.OUTPARAM.MUST Use of 'end' as an output iterator ITER.ADVANCE.NONADJACENT Advancing iterator by a distance of more than 1 CXX.ITER.END.BEGIN Iterator representing end of the range precedes start of range |
| SL.con.4: Don't use memset or memcpy for arguments that are not trivially-copyable |
Currently, there is no applicable checker for this rule. |
| SL.io.1: Use character-level input only when you have to |
Currently, there is no applicable checker for this rule. |
| SL.io.2: When reading, always consider ill-formed input |
SV.TAINTED.ALLOC_SIZE Use of Unvalidated Integer in Memory Allocation SV.TAINTED.BINOP Use of Unvalidated Integer in Binary Operation SV.TAINTED.INDEX_ACCESS Use of Unvalidated Integer as Array Index SV.TAINTED.LOOP_BOUND Use of Unvalidated Integer in Loop Condition SV.TAINTED.FMTSTR Use of Unvalidated Data in a Format String SV.TAINTED.INJECTION Command Injection SV.TAINTED.DEREF Dereference Of An Unvalidated Pointer SV.TAINTED.CALL.DEREF Dereference Of An Unvalidated Pointer |
| SL.io.3: Prefer iostream for I/O |
Currently, there is no applicable checker for this rule. |
| SL.io.10: Unless you use printf-family functions take care to set cout and printf synchronized |
Currently, there is no applicable checker for this rule. |
| SL.io.50: Avoid endl |
Currently, there is no applicable checker for this rule. |
| SL.regex.1: Don't use regexes unless your input is inherently text-based |
Currently, there is no applicable checker for this rule. |
| SL.str.1: Use std::string to own character sequences |
Currently, there is no applicable checker for this rule. |
| SL.str.2: Use std::string_view or gsl::string_span to refer to character sequences |
Currently, there is no applicable checker for this rule. |
| SL.str.3: Use zstring or czstring to refer to a C-style, zero-terminated sequence of characters |
Currently, there is no applicable checker for this rule. |
| SL.str.4: Use char* to refer to a single character |
Currently, there is no applicable checker for this rule. |
| SL.str.5: Use std::byte to refer to byte values that do not necessarily represent characters |
Currently, there is no applicable checker for this rule. |
| SL.str.10: Use std::string when you need to perform locale-sensitive string operations |
Currently, there is no applicable checker for this rule. |
| SL.str.11: Use gsl::string_span rather than std::string_view when you need to mutate a string |
Currently, there is no applicable checker for this rule. |
| SL.str.12: Use the s suffix for string literals meant to be standard-library strings |
Currently, there is no applicable checker for this rule. |
| T.1: Use templates to raise the level of abstraction of code |
Currently, there is no applicable checker for this rule. |
| T.2: Use templates to express algorithms that apply to many argument types |
Currently, there is no applicable checker for this rule. |
| T.3: Use templates to express containers and ranges |
Currently, there is no applicable checker for this rule. |
| T.4: Use templates to express syntax tree manipulation |
Currently, there is no applicable checker for this rule. |
| T.5: Combine generic and OO techniques to amplify their strengths |
Currently, there is no applicable checker for this rule. |
| T.10: Specify concepts for all template arguments |
Currently, there is no applicable checker for this rule. |
| T.11: Whenever possible use standard concepts |
Currently, there is no applicable checker for this rule. |
| T.12: Prefer concept names over auto for local variables |
Currently, there is no applicable checker for this rule. |
| T.13: Prefer the shorthand notation for simple, single-type argument concepts |
Currently, there is no applicable checker for this rule. |
| T.20: Avoid concepts without meaningful semantics |
Currently, there is no applicable checker for this rule. |
| T.21: Require a complete set of operations for a concept |
Currently, there is no applicable checker for this rule. |
| T.22: Specify axioms for concepts |
Currently, there is no applicable checker for this rule. |
| T.23: Differentiate a refined concept from its more general case by adding new use patterns |
Currently, there is no applicable checker for this rule. |
| T.24: Use tag classes or traits to differentiate concepts that differ only in semantics |
Currently, there is no applicable checker for this rule. |
| T.25: Avoid complementary constraints |
Currently, there is no applicable checker for this rule. |
| T.26: Prefer to define concepts in terms of use-patterns rather than simple syntax |
Currently, there is no applicable checker for this rule. |
| T.30: Use concept negation sparingly |
Currently, there is no applicable checker for this rule. |
| T.31: Use concept disjunction sparingly |
Currently, there is no applicable checker for this rule. |
| T.40: Use function objects to pass operations to algorithms |
Currently, there is no applicable checker for this rule. |
| T.41: Require only essential properties in a template's concept |
Currently, there is no applicable checker for this rule. |
| T.42: Use template aliases to simplify notation and hide implementation details |
Currently, there is no applicable checker for this rule. |
| T.43: Prefer using over typedef for defining aliases |
AUTOSAR.TYPEDEF The typedef specifier shall not be used |
| T.44: Use function templates to deduce class template argument types (where feasible) |
Currently, there is no applicable checker for this rule. |
| T.46: Require template arguments to be at least semiregular |
Currently, there is no applicable checker for this rule. |
| T.47: Avoid highly visible unconstrained templates with common names |
Currently, there is no applicable checker for this rule. |
| T.48: If your compiler does not support concepts, fake them with enable_if |
Currently, there is no applicable checker for this rule. |
| T.49: Where possible, avoid type-erasure |
Currently, there is no applicable checker for this rule. |
| T.60: Minimize a template's context dependencies |
Currently, there is no applicable checker for this rule. |
| T.61: Do not over-parameterize members (SCARY) |
Currently, there is no applicable checker for this rule. |
| T.62: Place non-dependent class template members in a non-templated base class |
Currently, there is no applicable checker for this rule. |
| T.64: Use specialization to provide alternative implementations of class templates |
Currently, there is no applicable checker for this rule. |
| T.65: Use tag dispatch to provide alternative implementations of a function |
Currently, there is no applicable checker for this rule. |
| T.67: Use specialization to provide alternative implementations for irregular types |
Currently, there is no applicable checker for this rule. |
| T.68: Use {} rather than () within templates to avoid ambiguities |
Currently, there is no applicable checker for this rule. |
| T.69: Inside a template, don't make an unqualified non-member function call unless you intend it to be a customization point |
MISRA.TEMPLMEM.NOQUAL In an instantiated template a member declared in a dependant base is used without a qualificator or 'this' |
| T.80: Do not naively templatize a class hierarchy |
Currently, there is no applicable checker for this rule. |
| T.81: Do not mix hierarchies and arrays |
Currently, there is no applicable checker for this rule. |
| T.82: Linearize a hierarchy when virtual functions are undesirable |
Currently, there is no applicable checker for this rule. |
| T.83: Do not declare a member function template virtual |
Currently, there is no applicable checker for this rule. |
| T.84: Use a non-template core implementation to provide an ABI-stable interface |
Currently, there is no applicable checker for this rule. |
| T.100: Use variadic templates when you need a function that takes a variable number of arguments of a variety of types |
Currently, there is no applicable checker for this rule. |
| T.101: How to pass arguments to a variadic template |
Currently, there is no applicable checker for this rule. |
| T.102: How to process arguments to a variadic template |
Currently, there is no applicable checker for this rule. |
| T.120: Use template metaprogramming only when you really need to |
Currently, there is no applicable checker for this rule. |
| T.121: Use template metaprogramming primarily to emulate concepts |
Currently, there is no applicable checker for this rule. |
| T.122: Use templates (usually template aliases) to compute types at compile time |
Currently, there is no applicable checker for this rule. |
| T.123: Use constexpr functions to compute values at compile time |
Currently, there is no applicable checker for this rule. |
| T.124: Prefer to use standard-library TMP facilities |
Currently, there is no applicable checker for this rule. |
| T.125: If you need to go beyond the standard-library TMP facilities, use an existing library |
Currently, there is no applicable checker for this rule. |
| T.140: Name all operations with potential for reuse |
Currently, there is no applicable checker for this rule. |
| T.141: Use an unnamed lambda if you need a simple function object in one place only |
Currently, there is no applicable checker for this rule. |
| T.142: Use template variables to simplify notation |
Currently, there is no applicable checker for this rule. |
| T.143: Don't write unintentionally non-generic code |
Currently, there is no applicable checker for this rule. |
| T.144: Don't specialize function templates |
MISRA.FUNC.SPEC.OVRLD Viable function set for a function call contains an overloaded template and its explicit specialization |
| T.150: Check that a class matches a concept using static_assert |
Currently, there is no applicable checker for this rule. |