Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 3-4-1 and defining constants in one place
#3
Indeed, because if one wishes to use the strategy of putting all the constants in one well-known place and then have a commercial Static Analysis tool check that code and then the static analysis tool pulls out all the constants that are only used in single places elsewhere in the code:

Then in order to comply with MISRA, one has to either:
  1. Create an individual guideline violation approval and associated deviation record for each individual violation, or
  2. Create a generic deviation permit together with our reasoning for allowing such a class of deviations, or
  3. Convince the toolset vendor that the rule was not intended to be applied in this way and that this is a false-positive.

For cases ( a ) and ( b ), should a customer specify that Rule 3-4-1 is completely Mandatory and that no violations are allowed under any circumstances, then the code would not meet such a requirement.

However, for case ( c ), the code would not have any violations, but it would be necessary to convince the toolset vendor that this situation was a false-positive and that the rule was not meant to be applied this way.

I was hoping for some clarity here so that if I have a discussion with the toolset vendor I have some evidence regarding how MISRA intended this rule to be applied.
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)