MISRA Discussion Forums
Proposal: Rule 0-1-4 exception - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C++ (https://forum.misra.org.uk/forumdisplay.php?fid=18)
+--- Forum: MISRA C++:2008 rules (https://forum.misra.org.uk/forumdisplay.php?fid=19)
+---- Forum: 6.0 Language independent issues (C++) (https://forum.misra.org.uk/forumdisplay.php?fid=129)
+---- Thread: Proposal: Rule 0-1-4 exception (/showthread.php?tid=1291)



Proposal: Rule 0-1-4 exception - dg1980 - 27-10-2016

Exception: Variables which are written by the program but read by an external entity (e.g. ASAM MCD tools like Vector CANape) are not considered a violation of this rule.


Re: Proposal: Rule 0-1-4 exception - mishak - 27-10-2016

This rule reports (e.g.) dead stores as they may be the sign of a defect.

As with your proposal for an exception to 0-1-3, there would be no way for a tool to know that the intent is for the value to be read by something other than the program.

You would, of course, also have to ensure that any objects have volatile qualification to ensure that the compiler does not optimise out what it sees as dead stores.

Looks like another candidate for a permit / deviation (which needs to include a requirement for volatile qualification).


Re: Proposal: Rule 0-1-4 exception - misra cpp - 24-01-2017

We agree with mishak, whilst a valid reason for a deviation, there is no way of expressing this as a checkable exception to the rule, as a static analysis tool cannot know what use other software is going to make of a variable