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.

      badBitmaskCheck

      Error prone
      High

      Bad usage of bitmap operator

      checkCastIntToCharAndBack

      Error prone
      High

      Storing getchar() return value in char variable and then comparing with EOF.

      clarifyStatement

      Error prone
      High

      Misuse of ++ operator

      comparisonOfBoolWithInvalidComparator

      Error prone
      High

      Comparison of a boolean value using relational operator (e.g. < ,>, etc)

      incorrectCharBooleanError

      Error prone
      High

      Conversion of char literal to bool always evaluates to true.

      incorrectStringBooleanError

      Error prone
      High

      Incorrect string boolean operator

      memsetZeroBytes

      Error prone
      High

      memset() called to fill 0 bytes.

      sizeofFunctionCall

      Error prone
      High

      Found function call inside sizeof().

      sizeofwithsilentarraypointer

      Error prone
      High

      Using 'sizeof' on array given as function argument returns size of a pointer.

      stlIfFind

      Error prone
      High

      Suspicious condition. The result of find() is an iterator

      uselessCallsRemove

      Error prone
      High

      Return value ignored. Elements remain in container.

      wrongPrintfScanfParameterPositionError

      Error prone
      High

      printf: invalid parameter position