[previous] 2984 [next] This operation is redundant. The value of the result is always 'name'.
Redundancy

This operation appears to be redundant because a given constant value can always be used instead.

For example:


/*PRQA S 2017,2983,3198,3203,3408,3447 ++*/

void foo(unsigned int i, unsigned int j)
{
    int k;

    if (i < 10)
    {
        if (j >= 10)
        {
            k = i / j;   /* 2984 */
        }
    }
}


MISRA C:2012 Rules applicable to message 2984:

Rule-2.2  (Required) There shall be no dead code


QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents