[previous] 2992 [next] The value of this 'if' controlling expression is always 'false'.
Invariant operations

The value of the controlling expression in this 'if' statement is always zero. The contained code is therefore unreachable.

For example:


/*PRQA S 2017,3120,3199,3201,3227,3356,3359,3408,3447 ++*/

void f1(int x)
{
    if (x > 10)
    {
        if (x < 5)                      /* 2992 2996 */
        { 
            x++;                        /* 2880      */
        }
    }
}

See also:

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents