[previous] 3110 [next] The left-hand operand of this ',' has no side effects.
Redundancy REFERENCE - ISO:C90-6.6.3 Expression and Null Statements

The left hand operand of a comma operator is only evaluated for its side effects. In this expression there are no side effects, so the comma operation is pointless.

For example:


/*PRQA S 1278,2017,2472,3227,3408,3418,3602,3625,3673 ++*/

#include <string.h>

void foo(char *s)
{
    unsigned int i = 0U;
    unsigned int j;

    for(i, j = strlen(s) - 1U; i < j; i++, j--)          /* Message 3110 */
    {
    }
}

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