V693. Consider inspecting conditional expression of the loop. It is possible that 'i < X.size()' should be used instead of 'X.size()'.

The analyzer has detected a typo in the loop termination condition.

For example:

for (size_t i = 0; v.size(); ++i)
  sum += v[i];

If the 'v' array is not empty, an infinite loop will occur.

The fixed code:

for (size_t i = 0; i < v.size(); ++i)
  sum += v[i];

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

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


Bugs Found

Checked Projects
410
Collected Errors
14 111
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