Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RTE call
#1
Hi All, I am calling RTE functions using microsar sip tools from vector and getting MISRA C 2012 rules violation:
1) The expression (vspSoundActivation_temp = Rte_CtApNvmWrapper_NV_VSPCfgParameters.VSP_SOUNDACTIVATIONTEMP_CF) , 0 uses the comma operator
2) The value returned by the assignment operator in vspSoundActivation_temp = Rte_CtApNvmWrapper_NV_VSPCfgParameters.VSP_SOUNDACTIVATIONTEMP_CF is being used

Is there any clear way of get rid of the messages?
#2
It is not possible to give a clear comment from the given example of code.  In general the comma operator can be replaced by splitting up the expression.
For example:

Code:
  X = ( A = B, 0 );
    can be replaced by
  A = B; X = 0;
and
  while ( (A = B, A > 0) ) { .... }
      can be replaced by
  A = B;
  while ( A > 0 {  ... A = B; }

If it is not possible to ammend the code, the advisory rule could be disapplied subject to appropriate justificatications.
Posted by and on behalf of the MISRA C Working Group


Forum Jump:


Users browsing this thread: 3 Guest(s)