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.

arithOperationsOnVoidPointer

Best practice
Medium

Avoid arithmetic operation on void pointers

AssignmentAddressToInteger

Best practice
Medium

Assigning a pointer to an integer is not portable.

CastIntegerToAddressAtReturn

Best practice
Medium

Returning an integer in a function with pointer return type is not portable.

invalidPointerCast

Best practice
Medium

Invalid pointer cast

noDestructor

Best practice
Medium

Class does not have a destructor which is recommended since it has dynamic memory/resource allocation(s).

pointerOutOfBounds

Best practice
Medium

Undefined behaviour

shiftNegativeLHS

Best practice
Medium

Shifting a negative value is technically undefined behaviour

varFuncNullUB

Best practice
Medium

Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.