Rules 6-5-1 to 6-5-6

Moderators: david ward, misra cpp

Post Reply
Posts: 109
Joined: Wed Apr 27, 2016 2:33 pm
Company: Elektrobit Automotive GmbH

Rules 6-5-1 to 6-5-6

Post by dg1980 » Thu Apr 28, 2016 10:32 am


i was under the impression that these rules apply to for loops only, as all examples show only for loops.
I recently ran across a static analyzer, which applied these rules to while loops too.
Is this intended by MISRA?
Thanks in advance.

misra cpp
Posts: 151
Joined: Mon Jun 02, 2008 1:55 pm
Company: MISRA

Re: Rules 6-5-1 to 6-5-6

Post by misra cpp » Tue Oct 11, 2016 10:53 am

6-5-1 only applies to for loops, arguably 6-5-2 to 6-5-6 may apply to while loops as well.

These rules are under consideration in light of this and MISRA C:2012's approach
Posted by and on behalf of
the MISRA C++ Working Group

Post Reply

Return to “6.5 Expressions (C++)”