Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Checker

Guideline

CERT C++: CON50-CPP CON50-CPP. Do not destroy a mutex while it is locked
CERT C++: CON52-CPP CON52-CPP. Prevent data races when accessing bit-fields from multiple threads
CERT C++: CON53-CPP CON53-CPP. Avoid deadlock by locking in a predefined order
CERT C++: CON54-CPP CON54-CPP. Wrap functions that can spuriously wake up in a loop
CERT C++: CTR50-CPP CTR50-CPP. Guarantee that container indices and iterators are within the valid range
CERT C++: CTR51-CPP CTR51-CPP. Use valid references, pointers, and iterators to reference elements of a container
CERT C++: CTR52-CPP CTR52-CPP. Guarantee that library functions do not overflow
CERT C++: CTR53-CPP CTR53-CPP. Use valid iterator ranges
CERT C++: CTR54-CPP CTR54-CPP. Do not subtract iterators that do not refer to the same container
CERT C++: CTR55-CPP CTR55-CPP. Do not use an additive operator on an iterator if the result would overflow
CERT C++: CTR56-CPP CTR56-CPP. Do not use pointer arithmetic on polymorphic objects
CERT C++: CTR57-CPP CTR57-CPP. Provide a valid ordering predicate
CERT C++: CTR58-CPP CTR58-CPP. Predicate function objects should not be mutable
CERT C++: DCL50-CPP DCL50-CPP. Do not define a C-style variadic function
CERT C++: DCL51-CPP DCL51-CPP. Do not declare or define a reserved identifier
CERT C++: DCL52-CPP DCL52-CPP. Never qualify a reference type with const or volatile
CERT C++: DCL53-CPP DCL53-CPP. Do not write syntactically ambiguous declarations
CERT C++: DCL54-CPP DCL54-CPP. Overload allocation and deallocation functions as a pair in the same scope
CERT C++: DCL55-CPP DCL55-CPP. Avoid information leakage when passing a class object across a trust boundary
CERT C++: DCL56-CPP DCL56-CPP. Avoid cycles during initialization of static objects
CERT C++: DCL57-CPP DCL57-CPP. Do not let exceptions escape from destructors or deallocation functions
CERT C++: DCL58-CPP DCL58-CPP. Do not modify the standard namespaces
CERT C++: DCL59-CPP DCL59-CPP. Do not define an unnamed namespace in a header file
CERT C++: DCL60-CPP DCL60-CPP. Obey the one-definition rule
CERT C++: ERR50-CPP ERR50-CPP. Do not abruptly terminate the program
CERT C++: ERR51-CPP ERR51-CPP. Handle all exceptions
CERT C++: ERR52-CPP ERR52-CPP. Do not use setjmp() or longjmp()
CERT C++: ERR53-CPP ERR53-CPP. Do not reference base classes or class data members in a constructor or destructor function-try-block handler
CERT C++: ERR54-CPP ERR54-CPP. Catch handlers should order their parameter types from most derived to least derived
CERT C++: ERR55-CPP ERR55-CPP. Honor exception specifications
CERT C++: ERR56-CPP ERR56-CPP. Guarantee exception safety
CERT C++: ERR57-CPP ERR57-CPP. Do not leak resources when handling exceptions
CERT C++: ERR58-CPP ERR58-CPP. Handle all exceptions thrown before main() begins executing
CERT C++: ERR59-CPP ERR59-CPP. Do not throw an exception across execution boundaries
CERT C++: ERR61-CPP ERR61-CPP. Catch exceptions by lvalue reference
CERT C++: EXP50-CPP EXP50-CPP. Do not depend on the order of evaluation for side effects
CERT C++: EXP51-CPP EXP51-CPP. Do not delete an array through a pointer of the incorrect type
CERT C++: EXP52-CPP EXP52-CPP. Do not rely on side effects in unevaluated operands
CERT C++: EXP53-CPP EXP53-CPP. Do not read uninitialized memory
CERT C++: EXP54-CPP EXP54-CPP. Do not access an object outside of its lifetime
CERT C++: EXP55-CPP EXP55-CPP. Do not access a cv-qualified object through a cv-unqualified type
CERT C++: EXP57-CPP EXP57-CPP. Do not cast or delete pointers to incomplete classes
CERT C++: EXP58-CPP EXP58-CPP. Pass an object of the correct type to va_start
CERT C++: EXP59-CPP EXP59-CPP. Use offsetof() on valid types and members
CERT C++: EXP61-CPP EXP61-CPP. A lambda object must not outlive any of its reference captured objects
CERT C++: EXP62-CPP EXP62-CPP. Do not access the bits of an object representation that are not part of the object's value representation
CERT C++: EXP63-CPP EXP63-CPP. Do not rely on the value of a moved-from object
CERT C++: FIO50-CPP FIO50-CPP. Do not alternately input and output from a file stream without an intervening positioning call
CERT C++: FIO51-CPP FIO51-CPP. Close files when they are no longer needed
CERT C++: MEM50-CPP MEM50-CPP. Do not access freed memory
CERT C++: MEM51-CPP MEM51-CPP. Properly deallocate dynamically allocated resources
CERT C++: MEM52-CPP MEM52-CPP. Detect and handle memory allocation errors
CERT C++: MEM53-CPP MEM53-CPP. Explicitly construct and destruct objects when manually managing object lifetime
CERT C++: MEM54-CPP MEM54-CPP. Provide placement new with properly aligned pointers to sufficient storage capacity
CERT C++: MEM55-CPP MEM55-CPP. Honor replacement dynamic storage management requirements
CERT C++: MEM56-CPP MEM56-CPP. Do not store an already-owned pointer value in an unrelated smart pointer
CERT C++: MEM57-CPP MEM57-CPP. Avoid using default operator new for over-aligned types
CERT C++: MSC50-CPP MSC50-CPP. Do not use std::rand() for generating pseudorandom numbers
CERT C++: MSC51-CPP MSC51-CPP. Ensure your random number generator is properly seeded
CERT C++: MSC52-CPP MSC52-CPP. Value-returning functions must return a value from all exit paths
CERT C++: MSC53-CPP MSC53-CPP. Do not return from a function declared [[noreturn]]
CERT C++: OOP50-CPP OOP50-CPP. Do not invoke virtual functions from constructors or destructors
CERT C++: OOP51-CPP OOP51-CPP. Do not slice derived objects
CERT C++: OOP52-CPP OOP52-CPP. Do not delete a polymorphic object without a virtual destructor
CERT C++: OOP53-CPP OOP53-CPP. Write constructor member initializers in the canonical order
CERT C++: OOP54-CPP OOP54-CPP. Gracefully handle self-copy assignment
CERT C++: OOP55-CPP OOP55-CPP. Do not use pointer-to-member operators to access nonexistent members
CERT C++: OOP57-CPP OOP57-CPP. Prefer special member functions and overloaded operators to C Standard Library functions
CERT C++: OOP58-CPP OOP58-CPP. Copy operations must not mutate the source object
CERT C++: STR50-CPP STR50-CPP. Guarantee that storage for strings has sufficient space for character data and the null terminator
CERT C++: STR51-CPP STR51-CPP. Do not attempt to create a std::string from a null pointer
CERT C++: STR52-CPP STR52-CPP. Use valid references, pointers, and iterators to reference elements of a basic_string
CERT C++: STR53-CPP STR53-CPP. Range check element access