Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Misra rule 42
#1
Hi,

I have a question concerning rule 42, which states : \"comma operator shall not be used, except in the control expression of a for loop\".

Now what is \"the control expression\" in following instruction : for(i = 0; i < 10; i++) {...}

Is it \"i = 0\" or \"i < 10\" or \"i++\" ?

Currently we use a GreenHills compiler with build-in misra checking and they are saying it is \"i < 10\".
Searching on google:
IAR and ABRAXAS says it is \"i = 0\" and \"i++\"

Now hopefully you can give me the correct answer.

Thank you,

Jeroen
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)