facebook pixelCodiga Analysis C / C++ Rules, severity warning , category best practice
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
Warning

Avoid arithmetic operation on void pointers

AssignmentAddressToInteger

Best practice
Warning

Assigning a pointer to an integer is not portable.

CastIntegerToAddressAtReturn

Best practice
Warning

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

invalidPointerCast

Best practice
Warning

Invalid pointer cast

noDestructor

Best practice
Warning

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

pointerOutOfBounds

Best practice
Warning

Undefined behaviour

shiftNegativeLHS

Best practice
Warning

Shifting a negative value is technically undefined behaviour

varFuncNullUB

Best practice
Warning

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