[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:2004 Rules applicable to message 3426:

Rule  14.2  (Required) All non-null statements shall either (i) have at least one side effect however executed, or (ii) cause control flow to change.


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