[previous] MISRA C:2012  Rule-12.3:  (Advisory) [next] The comma operator should not be used

Example Code:


#pragma PRQA_MESSAGES_OFF 2984

#include "misra.h"
#include "m3cmex.h"

#define A (-5)
#define B 3

extern int16_t rule_1203( void )
{
   int16_t x;
   int16_t y;
   int16_t i;

   y = ( x = A, x + B );              /* 3417 3226 */

   for ( i = 0, ++y; i < B; ++i )     /* 3418      */
   {
      ++y;
   }

   return y;
}


QAC messages that encompass this guideline:

3417 The comma operator has been used outside a 'for' statement.
3418 The comma operator has been used in a 'for' statement.



(c) The Motor Industry Research Association, 2012
QA C Source Code Analyser 8.1.2
MISRA C:2012 Compliance Module 1.0
© 2013 Programming Research
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents