Rule 21.1: uint8 = ~uint8?

6.21 Run-time Failures

Moderators: misra-c, david ward

Manni
Posts: 11
Joined: Mon Feb 20, 2006 12:28 pm

Rule 21.1: uint8 = ~uint8?

Postby Manni » Wed May 17, 2006 11:06 am

Hello,

I use a tool, which tested code to MISRA-C:2004 compliance.

Here is a code example, on which our analyse tool says, there is a breach of rule 21.1.

Code: Select all

...
...
int main(void)
{
...
...
   uint8_t STATE;
   uint8_t MASK;
...
...
   STATE = 0x01;
   MASK = 0x10;
...
...
   

   STATE = ~MASK;
        /* That line it is, which show up the breach of the rule*/

}


The Tool says, this breaches rule 21.1. But i think it's ok, or what do the MISRA comitee says?

thanks a lot
best regards,
Manni

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

Postby misra-c » Tue Aug 22, 2006 4:07 pm

MISRA-C meeting 22-8-2006

Your example is fully compliant.
---
Posted by and on behalf of
the MISRA C Working Group


Return to “6.21 Run-time Failures”

Who is online

Users browsing this forum: No registered users and 2 guests