[previous] 2980 [next] The value of this function parameter is never used before being modified.
Redundancy

The value passed in this function parameter is always modified before being used and so the parameter is effectively redundant. Is this really intended ?

For example:


/*PRQA S 2017,2986,3195,3203,3227,3408 ++*/

int foo(int n, int x)    /* 2980 */
{
    n = x + 1;

    return n;
}


MISRA C:2012 Rules applicable to message 2980:

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