Typecasting from signed to unsigned and vis-verse

Moderators: misra-c, david ward

Post Reply
deepabagalkot
Posts: 2
Joined: Wed Jun 25, 2014 9:01 am
Company: KPIT

Typecasting from signed to unsigned and vis-verse

Post by deepabagalkot » Thu Jul 31, 2014 11:37 am

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

misra-c
Posts: 571
Joined: Thu Jan 05, 2006 1:11 pm

Re: Typecasting from signed to unsigned and vis-verse

Post by misra-c » Fri Aug 22, 2014 12:37 pm

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: Select all

UINT_32 *ptr_u32 = ....
SINT_32 *ptr_s32 = ....

ptr_u32 = (UINT_32 *) ptr_s32; // violates rule 11.3
---
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “8.11 Pointer type conversions”