Loops violate Rule 14.3

6.14 Control Flow

Moderators: misra-c, david ward

Post Reply
chrisT
Posts: 3
Joined: Tue Feb 03, 2015 2:43 pm
Company: Bender GmbH & Co. KG
Location: Germany

Loops violate Rule 14.3

Post by chrisT » Tue Jun 02, 2015 11:20 am

Hello.

In our company, we have developers who uses

Code: Select all

for(;;)
loops. Are these a violation against rule 14.3?

kind regards.

misra-c
Posts: 548
Joined: Thu Jan 05, 2006 1:11 pm

Re: Loops violate Rule 14.3

Post by misra-c » Thu Jun 25, 2015 8:34 am

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.
---
Posted by and on behalf of
the MISRA C Working Group

chrisT
Posts: 3
Joined: Tue Feb 03, 2015 2:43 pm
Company: Bender GmbH & Co. KG
Location: Germany

Re: Loops violate Rule 14.3

Post by chrisT » Thu Jun 25, 2015 8:52 am

Ok, thank you.

Post Reply

Return to “6.14 Control Flow”