V6063. Odd semicolon ';' after 'if/foreach' operator.

The analyzer has detected a potential defect that has to do with a semicolon ';' after an if or foreach statement.

Consider the following example:

int someMethod(int value, int a, int b, int c, ...)
{
  int res = -1;
  ....
  if (value > (a - b)/c);
  {
    ....
    res = calculate(value);
  }
  ....
  return res;
}

Fixed code:

int someMethod(int value, int a, int b, int c, ...)
{
  int res = -1;
  ....
  if (value > (a - b)/c)
  {
    ....
    res = calculate(value);
  }
  ....
  return res;
}

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


Bugs Found

Checked Projects
411
Collected Errors
14 100
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site. Learn More →
Accept