MISRA Discussion Forums
6.1, 6.2 and casts? - 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.6 Types (https://forum.misra.org.uk/forumdisplay.php?fid=33)
+---- Thread: 6.1, 6.2 and casts? (/showthread.php?tid=719)



6.1, 6.2 and casts? - gs - 18-03-2010

Does rule 6.1 permit a numeric value to be cast to plain char type and then assigned to an object of plain char?
Does rule 6.2 permit a character value to be cast to signed/unsigned char type and then assigned to an object of signed/unsigned char?


Re: 6.1, 6.2 and casts? - misra-c - 13-05-2010

Yes, both of these are permitted.