MISRA Discussion Forums
Typecasting from signed to unsigned and vis-verse - 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:2012 and MISRA C:2023 guidelines (https://forum.misra.org.uk/forumdisplay.php?fid=21)
+---- Forum: 8.11 Pointer type conversions (https://forum.misra.org.uk/forumdisplay.php?fid=166)
+---- Thread: Typecasting from signed to unsigned and vis-verse (/showthread.php?tid=1090)



Typecasting from signed to unsigned and vis-verse - deepabagalkot - 31-07-2014

Hi,

Please can anybody help me to understand whether Misra C rules support signed to unsigned and vis-verse data typecasting?

Thanks in advance,
Deepa


Re: Typecasting from signed to unsigned and vis-verse - misra-c - 22-08-2014

It is unclear whether this question has been superceded by the post at http://www.misra.org.uk/forum/viewtopic.php?t=1398 in the MISRA C:2004 part of bulletin board

8.11 is a section on pointer conversions. For example:
Code:
UINT_32 *ptr_u32 = ....
SINT_32 *ptr_s32 = ....

ptr_u32 = (UINT_32 *) ptr_s32; // violates rule 11.3