Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
V6004. The 'then' statement is...
menu mobile close menu
Additional information
toggle menu Contents

V6004. The 'then' statement is equivalent to the 'else' statement.

May 04 2018

The analyzer has detected that the true and false statements of the if statement completely coincide. This often indicates a logical error.

The example:

if (condition)
  result = FirstFunc(val);
else
  result = FirstFunc(val);

Regardless of the variable's value, the same operations will be performed.

The fixed code:

if (condition)
  result = FirstFunc(val);
else
  result = SecondFunc(val);

This diagnostic is classified as:

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