MISRA Discussion Forums

Full Version: Loops violate Rule 14.3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello.

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

kind regards.
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.
Ok, thank you.