![]() |
|
13.3 What not being evaluated means? - 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.13 Side effects (https://forum.misra.org.uk/forumdisplay.php?fid=168) +---- Thread: 13.3 What not being evaluated means? (/showthread.php?tid=1780) |
13.3 What not being evaluated means? - Loïc - 28-08-2026 Hi there, Rule 13.3 says: Quote:All sub-expressions of the full expression are treated as if they were evaluated for the purposes of this rule, even if specified as not being evaluated by the C Standard. I understand what it makes sense in the context for instance of the conditional operator, but I wanted to check it this applies the sub-expressions that can be determined as never evaluated because they are in non-evaluated operands. Code: int f(int a) {Accessing the volatile variable i is a persistent side effect, but since this access happens as part of a sizeof operand, that is not evaluated, no actual access to the volatile actually happens. Would it make sense to update this rule (and several other that use similar wording) to separate the undecidable case of infeasible paths from the very decidable case of non-evaluated expressions? FYI, in similar cases, MISRA C++ uses wording such as " even if they occur in an infeasible path" instead of "even if specified as not being evaluated". |