V626. Consider checking for misprints. It's possible that ',' should be replaced by ';'.


The analyzer has detected a potential error: comma ',' is written by accident instead of semicolon ';'. This misprint can lead to an incorrect logic of program execution. Consider an example:

int a;
int b;
...
if (a == 2)
  a++,
b = a;

This code will result in executing the "b = a;" expression only when the 'if' operator's condition holds. This is most likely a misprint and ',' should be replaced with ';'. This is the correct code:

if (a == 2)
  a++;
b = a;

The analyzer won't generate the message if formatting of a code fragment demonstrates deliberate use of the ',' operator. Here is a code sample:

if (a == 2)
  a++,
  b = a;

if (a == 2)
  a++, b = a;

According to Common Weakness Enumeration, potential errors found by using this diagnostic are classified as CWE-483.

You can look at examples of errors detected by the V626 diagnostic.


Bugs Found

Checked Projects
344
Collected Errors
12 970