![]() |
![]() |
3110 | ![]() |
||||
![]() | |||||||
| 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 */
{
}
}
MISRA C:2012 Rules applicable to message 3110:
| 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 |