facebook pixelCodiga Analysis C / C++ Rules, severity error , category safety
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
Error

Access of forwarded variable

charLiteralWithCharPtrCompare

Safety
Error

Char literal compared with pointer.

containerOutOfBounds

Safety
Error

Access container out of bounds

invalidPrintfArgType_n

Safety
Error

Invalid formatter for int

invalidPrintfArgType_p

Safety
Error

Invalid formatter for signed int

invalidPrintfArgType_s

Safety
Error

Invalid formatter for string

invalidScanfArgType_float

Safety
Error

Invalid scanf for float

invalidScanfArgType_s

Safety
Error

Invalid scanf for string

localMutex

Safety
Error

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

negativeContainerIndex

Safety
Error

Negative container index

sizeofwithnumericparameter

Safety
Error

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

StlMissingComparison

Safety
Error

Missing bounds check for extra iterator increment in loop.

thisSubtraction

Safety
Error

Suspicious pointer subtraction.

zerodivcond

Safety
Error

Either the condition is redundant or there is division by zero

uninitDerivedMemberVar

Safety
Error

Member variable not initialized in constructor

overlappingWriteUnion

Safety
Error

Overlapping read/write of union is undefined behavior

mismatchingContainers

Safety
Error

Iterators of different containers are used together.