MISRA Discussion Forums

Full Version: RTE call
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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.