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
Error

Bad usage of bitmap operator

checkCastIntToCharAndBack

Error prone
Error

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

clarifyStatement

Error prone
Error

Misuse of ++ operator

comparisonOfBoolWithInvalidComparator

Error prone
Error

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

incorrectCharBooleanError

Error prone
Error

Conversion of char literal to bool always evaluates to true.

incorrectStringBooleanError

Error prone
Error

Incorrect string boolean operator

memsetZeroBytes

Error prone
Error

memset() called to fill 0 bytes.

sizeofFunctionCall

Error prone
Error

Found function call inside sizeof().

sizeofwithsilentarraypointer

Error prone
Error

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

stlIfFind

Error prone
Error

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

uselessCallsRemove

Error prone
Error

Return value ignored. Elements remain in container.

wrongPrintfScanfParameterPositionError

Error prone
Error

printf: invalid parameter position

va_start_wrongParameter

Error prone
Error

Wrong parameter for va_start()

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.