Rule 14.2 What is meant by assign" - 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: Rule 14.2 What is meant by assign" (/showthread.php?tid=1149) |
Rule 14.2 What is meant by assign" - misra-c - 13-02-2015 In the 1st clause what is meant by “assign a value to the loop counterâ€. May this “value†be an expression with side-effects? Code: int index; Re: Rule 14.2 What is meant by assign" - misra-c - 13-02-2015 The first clause may assign a value to the loop counter via a function call which includes persistent side-effects. The above example is compliant with this rule. |