<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[MISRA Discussion Forums - 6.21 Run-time Failures]]></title>
		<link>https://forum.misra.org.uk/</link>
		<description><![CDATA[MISRA Discussion Forums - https://forum.misra.org.uk]]></description>
		<pubDate>Thu, 05 Nov 2026 15:12:47 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Rule 21.1: uint8 = ~uint8?]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=259</link>
			<pubDate>Wed, 17 May 2006 10:06:08 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=211">Manni</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=259</guid>
			<description><![CDATA[Hello,<br />
<br />
I use a tool, which tested code to MISRA-C:2004 compliance.<br />
<br />
Here is a code example, on which our analyse tool says, there is a breach of rule 21.1. <br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>...<br />
...<br />
int main(void)<br />
{<br />
...<br />
...<br />
&nbsp;&nbsp;&nbsp;&nbsp;uint8_t STATE;<br />
&nbsp;&nbsp;&nbsp;&nbsp;uint8_t MASK;<br />
...<br />
...<br />
&nbsp;&nbsp;&nbsp;&nbsp;STATE = 0x01;<br />
&nbsp;&nbsp;&nbsp;&nbsp;MASK = 0x10;<br />
...<br />
...<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;STATE = ~MASK;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* That line it is, which show up the breach of the rule*/<br />
<br />
}</code></div></div><br />
The Tool says, this breaches rule 21.1. But i think it's ok, or what do the MISRA comitee says?<br />
<br />
thanks a lot]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
I use a tool, which tested code to MISRA-C:2004 compliance.<br />
<br />
Here is a code example, on which our analyse tool says, there is a breach of rule 21.1. <br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>...<br />
...<br />
int main(void)<br />
{<br />
...<br />
...<br />
&nbsp;&nbsp;&nbsp;&nbsp;uint8_t STATE;<br />
&nbsp;&nbsp;&nbsp;&nbsp;uint8_t MASK;<br />
...<br />
...<br />
&nbsp;&nbsp;&nbsp;&nbsp;STATE = 0x01;<br />
&nbsp;&nbsp;&nbsp;&nbsp;MASK = 0x10;<br />
...<br />
...<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;STATE = ~MASK;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* That line it is, which show up the breach of the rule*/<br />
<br />
}</code></div></div><br />
The Tool says, this breaches rule 21.1. But i think it's ok, or what do the MISRA comitee says?<br />
<br />
thanks a lot]]></content:encoded>
		</item>
	</channel>
</rss>