<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>if(x &amp;amp; 0x0f == 0) { do something } versus if(!(x &amp;amp; 0x0f) { }</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/14848/if-x-0x0f-0-do-something-versus-if-x-0x0f</link><description> Maybe i have missed an ANSI C rule?? With old compiler (V3.40) both versions show the same results. With new compiler versions the first version recognizes dead code which is eliminated. 
 
Werner </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: if(x &amp; 0x0f == 0) { do something } versus if(!(x &amp; 0x0f) { }</title><link>https://community.arm.com/thread/110033?ContentTypeID=1</link><pubDate>Thu, 30 May 2002 00:04:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ec69e8bf-d3a6-437a-8b14-d173f18f417d</guid><dc:creator>Vaclav Korecek</dc:creator><description>&lt;p&gt;You can read also follow article:&lt;br /&gt;
&lt;a href="http://www.embedded.com/1999/9912/9912feat1.htm" target="_blank"&gt;http://www.embedded.com/1999/9912/9912feat1.htm&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
There are also some links.&lt;br /&gt;
&lt;br /&gt;
HTH&lt;br /&gt;
VK&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: if(x &amp; 0x0f == 0) { do something } versus if(!(x &amp; 0x0f) { }</title><link>https://community.arm.com/thread/95059?ContentTypeID=1</link><pubDate>Wed, 29 May 2002 11:00:38 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2fbf6e0a-f400-4747-a38b-6c649ab10495</guid><dc:creator>Mik Kleshov</dc:creator><description>&lt;p&gt;&lt;a href="http://www.misra.org.uk/misra-c.htm" target="_blank"&gt;http://www.misra.org.uk/misra-c.htm&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: if(x &amp; 0x0f == 0) { do something } versus if(!(x &amp; 0x0f) { }</title><link>https://community.arm.com/thread/54430?ContentTypeID=1</link><pubDate>Wed, 29 May 2002 10:31:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3ecc101a-b333-47f0-8502-8bde50497fef</guid><dc:creator>Werner Meier</dc:creator><description>&lt;p&gt;Sorry about my ignorance what is MISRA?&lt;br /&gt;
&lt;br /&gt;
Werner&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: if(x &amp; 0x0f == 0) { do something } versus if(!(x &amp; 0x0f) { }</title><link>https://community.arm.com/thread/38786?ContentTypeID=1</link><pubDate>Wed, 29 May 2002 07:38:20 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:56634fd0-f201-4630-ab72-35befcf12cfe</guid><dc:creator>Vaclav Korecek</dc:creator><description>&lt;p&gt;Operator &amp;quot;==&amp;quot; has higher priority then &lt;br /&gt;
operator &amp;quot;&amp;amp;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Right nototion is second version or:&lt;br /&gt;
&lt;br /&gt;
  if( (x &amp;amp; 0x0F)==0 ){ do something}&lt;br /&gt;
&lt;br /&gt;
The new compiler version is more&lt;br /&gt;
ANSI C consequent I think.&lt;br /&gt;
&lt;br /&gt;
BTW: How about MISRA C Rules?&lt;br /&gt;
&lt;br /&gt;
VK&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>