[previous] 2877 [next] This loop will never be executed more than once.
Control flow

This loop will only be executed once and so the loop mechanism is redundant. Has there been a mistake ?

For example:


/*PRQA S 2017,2465,2467,3120,3227,3408 ++*/
void foo(void)
{
    int i;
    
    for (i = 0; i < 1; ++i)             /* 2877 */
    {
    }
    

    i = 10;

    while (i <= 10)                     /* 2877 */
    {
        ++i;
    }
    
}

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