MISRA Discussion Forums
Loops violate Rule 14.3 - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4)
+--- Forum: MISRA-C: 2004 rules (https://forum.misra.org.uk/forumdisplay.php?fid=17)
+---- Forum: 6.14 Control Flow (https://forum.misra.org.uk/forumdisplay.php?fid=46)
+---- Thread: Loops violate Rule 14.3 (/showthread.php?tid=1183)



Loops violate Rule 14.3 - chrisT - 02-06-2015

Hello.

In our company, we have developers who uses
Code:
for(;;)
loops. Are these a violation against rule 14.3?

kind regards.


Re: Loops violate Rule 14.3 - misra-c - 25-06-2015

The ";" in a for loop control are part of the syntax for a //for// loop and not part of an "expression-statement".

Rule 14.3 only applies to "expression-statements" and therefore your for expression does not violate rule 14.3.


Re: Loops violate Rule 14.3 - chrisT - 25-06-2015

Ok, thank you.