Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is a function parameter “used” if cast to void?
#2
param is an operand of the cast operator and so is "used" according to the definition of “used” in Appendix J.

Therefore this code does not violate rule 2.7. This is consistent with the exception to rule 2.2 on dead code, which states “ A cast to void is assumed to indicate a value that is intentionally not being used.”
Posted by and on behalf of the MISRA C Working Group


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)