[previous] 2744 [next] This 'while' or 'for' loop controlling expression is a constant expression and its value is 'false'. The loop will not be entered.
Invariant operations

The value of the controlling expression in this 'while' or 'for' statement is a constant expression with zero (i.e. 'false') value. The code within the loop is therefore unreachable.

For example:


/*PRQA S 2017,3201,3325,3447,3408 ++*/

#define AM 5
#define BM 7

extern int y;

void foo(void)
{
    
    while (AM > BM)                 /* 2744 */
    {
        ++y;                        /* 2880 */
    }
}

See also:

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