Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Appendix B - mapping of rule 10.2
#1
It seems there is a minor inconsistency in MISRA-C 2004. At top of pag. 103 (Appendix B) I can read that rule 77 in MISRA-C 1998 is mapped onto rule 10.2 in MISRA-C 2004. Indeed this latter is as duly reported in third column ("The value of an expression of floating type..."), but corresponding rule 77 in MISRA C 1998 is well different:

"The unqualifed type of parameters passed to a function shall be compatible with the unqualified expected types defined in the function prototype".

Can you help me?
<t></t>
Reply
#2
Rule 77 is concerned with function calls and it requires the parameter to match exactly with the function argument type ( excluding volatile, const etc). Therefore you can not pass a short to a function expecting a long etc.

The closest rules to this in MISRA-C:2004 are 10.1 and 10.2, which includes a ban on implicit conversions on function arguments. It looks like rule 10.1 was missed out from the Appendix.
Posted by and on behalf of the MISRA C Working Group
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)