Question about 14.2 and the controlling variable - 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:2012 and MISRA C:2023 guidelines (https://forum.misra.org.uk/forumdisplay.php?fid=21) +---- Forum: 8.14 Control statement expressions (https://forum.misra.org.uk/forumdisplay.php?fid=169) +---- Thread: Question about 14.2 and the controlling variable (/showthread.php?tid=1228) |
Question about 14.2 and the controlling variable - triboix - 23-02-2016 Hello, 14.2 states that the "controlling variable" must be of essentially boolean type. Does that mean that the following code is non-compliant? Code: struct stuff Thanks a lot for any help! Re: Question about 14.2 and the controlling variable - misra-c - 03-03-2016 Rule 14.2 includes the following statements: Quote: Second clause which Quote: A loop control flag is defined as a single identifier denoting an object with essentially Boolean type that is used in the second clause."found" does not meet the criteria for a loop control flag and therefore is non-compliant with rule 14.2 Re: Question about 14.2 and the controlling variable - triboix - 06-03-2016 misra-c Wrote:Rule 14.2 includes the following statements:All right, thanks a lot for the clarification!Quote: Second clause which |