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.

constParameter

Design
Informational

Parameter can be declared with const

constParameterCallback

Design
Informational

Parameter can be declared with const.

copyCtorPointerCopying

Design
Error

Value of pointer 'count'

duplInheritedMember

Design
Error

Duplicated inherited member

hidingInheritedPublic

Design
Informational

Virtual function is a public in a base class and became not-public in derived. It's violate a substitutability a principle in OOP.

mismatchAllocDealloc

Design
Critical

Mismatching allocation and deallocation

shadowArgument

Design
Informational

Local variable shadows outer argument

shadowVariable

Design
Informational

Local variable shadows outer variable

templateRecursion

Design
Informational

Template recursion threshold reached

unusedLabelConfiguration

Design
Informational

Label is not used, a pre-processor configuration prevents it to be shown.

unusedLabelSwitch

Design
Error

Label is not used.

unusedLabelSwitchConfiguration

Design
Error

Unused label in switch

virtualDestructor

Design
Critical

Class which is inherited does not have a virtual destructor.

ctuOneDefinitionRuleViolation

Design
Error

The one definition rule is violated, different classes/structs have the same name.

operatorEqShouldBeLeftUnimplemented

Design
Error

operator should either return reference to 'this' instance or be declared private and left unimplemented.

We use cookies to improve your site experience, including analytics cookies to understand how you use our product and design better experiences. Please read our Cookie Policy.