[previous] 3426 [next] Right hand side of comma expression has no side effect and its value is not used.
Redundancy

The right hand operand of this comma operator is redundant. It generates no side effects and its value is not used. What is the intention ?

For example:


/*PRQA S 2017,3199,3203,3227,3408,3417,3440 ++*/

extern void foo(int p, int j)
{
    int n;

    n = (++p, j + 1);           /* OK           */

    ++p, j + 1;                 /* Message 3426 */

}


MISRA C:2012 Rules applicable to message 3426:

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