facebook pixelC and C++ Static Code Analysis Rules
BACK TO LIST

C / C++ rules

C and C++ are really performant languages and can be very error-prone. We all had core dumps and made pointer arithmetic errors! Thankfully, Codiga has hundreds of static analysis rules to flag potential errors in your C/C++ code, automate code reviews and merge with confidence.

      accessForwarded

      Safety
      High

      Access of forwarded variable

      charLiteralWithCharPtrCompare

      Safety
      High

      Char literal compared with pointer.

      containerOutOfBounds

      Safety
      High

      Access container out of bounds

      invalidPrintfArgType_n

      Safety
      High

      Invalid formatter for int

      invalidPrintfArgType_p

      Safety
      High

      Invalid formatter for signed int

      invalidPrintfArgType_s

      Safety
      High

      Invalid formatter for string

      invalidScanfArgType_float

      Safety
      High

      Invalid scanf for float

      invalidScanfArgType_s

      Safety
      High

      Invalid scanf for string

      localMutex

      Safety
      High

      The lock is ineffective because the mutex is locked at the same scope as the mutex itself.

      negativeContainerIndex

      Safety
      High

      Negative container index

      sizeofwithnumericparameter

      Safety
      High

      Suspicious usage of 'sizeof' with a numeric constant as parameter.

      StlMissingComparison

      Safety
      High

      Missing bounds check for extra iterator increment in loop.

      thisSubtraction

      Safety
      High

      Suspicious pointer subtraction.

      zerodivcond

      Safety
      High

      Either the condition is redundant or there is division by zero

      uninitDerivedMemberVar

      Safety
      High

      Member variable not initialized in constructor

      overlappingWriteUnion

      Safety
      High

      Overlapping read/write of union is undefined behavior