assignIfError
Mismatching assignment and comparison
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.
Mismatching assignment and comparison
Bad usage of bitmap operator
Storing getchar() return value in char variable and then comparing with EOF.
Misuse of ++ operator
Code not handled
Comparison of a boolean value using relational operator (e.g. < ,>, etc)
Invalid usage of output stream: '<< std::cout'.
Possible dereference of an invalid iterator
Value used after being erased
fflush() called on input stream may result in undefined behaviour on non-linux systems
Conversion of char literal to bool always evaluates to true.
Incorrect string boolean operator
Invalid container
I/O operations without positioning
Container is always empty
memset() called to fill 0 bytes.
Redundant initialization. The initialized value is overwritten before it is read.
Found function call inside sizeof().
Behaviour of 'sizeof(void)' is not covered by the ISO C standard.
Using 'sizeof' on array given as function argument returns size of a pointer.
Suspicious condition. The result of find() is an iterator
int result is returned as long value. If the return value is long to avoid loss of information
Return value ignored. Elements remain in container.
Write operation on a file that was opened only for reading.
printf: invalid parameter position
Comparison of a variable having boolean value using relational (<, >, <= or >=) operator
Non-standard character literal
Rethrowing current exception
Wrong parameter for va_start()
Call of pure virtual function in constructor.
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.