Appendix B - mapping of rule 10.2 - 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: 2004 rules (https://forum.misra.org.uk/forumdisplay.php?fid=17) +---- Forum: 6.10 Arithmetic Type Conversions (https://forum.misra.org.uk/forumdisplay.php?fid=37) +---- Thread: Appendix B - mapping of rule 10.2 (/showthread.php?tid=960) |
Appendix B - mapping of rule 10.2 - andream - 23-04-2013 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? Re: Appendix B - mapping of rule 10.2 - misra-c - 12-09-2013 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. |