<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Warning Message C2705 in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Warning-Message-C2705/m-p/494055#M12182</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Edward,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 May 2016 21:24:38 GMT</pubDate>
    <dc:creator>rayhall</dc:creator>
    <dc:date>2016-05-03T21:24:38Z</dc:date>
    <item>
      <title>Warning Message C2705</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Warning-Message-C2705/m-p/494053#M12180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting this warning for some code, and not for other code&amp;nbsp; that are basically the same. "Warning C2750: Possible loss of data"&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can disable the message, but would prefer not to do this. What is wrong ?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIM_TFLG1 &amp;amp;= ~(1&amp;lt;&amp;lt;TIM_TFLG1_C0F_MASK); // No warning&lt;/P&gt;&lt;P&gt;TIM_TFLG1 &amp;amp;= ~(1&amp;lt;&amp;lt;TIM_TFLG1_C1F_MASK); // No warning&lt;/P&gt;&lt;P&gt;TIM_TFLG1 &amp;amp;= ~(1&amp;lt;&amp;lt;TIM_TFLG1_C2F_MASK); // No warning&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIM_TFLG1 &amp;amp;= ~(1&amp;lt;&amp;lt;TIM_TFLG1_C3F_MASK); // Get Warning C2705&lt;/P&gt;&lt;P&gt;TIM_TFLG1 &amp;amp;= ~(1&amp;lt;&amp;lt;TIM_TFLG1_C4F_MASK); // Get Warning C2705&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIM_TFLG1 &amp;amp;= ~(1&amp;lt;&amp;lt;TIM_TFLG1_C5F_MASK); // No warning&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The micro is the S12XE.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 May 2016 02:36:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Warning-Message-C2705/m-p/494053#M12180</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2016-05-03T02:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Warning Message C2705</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Warning-Message-C2705/m-p/494054#M12181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;_MASK at the end tells that it already equals one shifted left by N bit places. Look in H files how those xxx_MASK constants are defined. They all are bit masks and not a bit number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So&lt;/P&gt;&lt;P&gt;1&amp;lt;&amp;lt;TIM_TFLG1_C0F_MASK ==&amp;nbsp; 1&amp;lt;&amp;lt;1 = 2&lt;/P&gt;&lt;P&gt;1&amp;lt;&amp;lt;TIM_TFLG1_C1F_MASK ==&amp;nbsp; 1&amp;lt;&amp;lt;2 = 4&lt;/P&gt;&lt;P&gt;1&amp;lt;&amp;lt;TIM_TFLG1_C2F_MASK ==&amp;nbsp; 1&amp;lt;&amp;lt;4 = 0x10&lt;/P&gt;&lt;P&gt;1&amp;lt;&amp;lt;TIM_TFLG1_C3F_MASK == 1&amp;lt;&amp;lt;8 = 0x100 , which requires 9 bits and can't fit 8bit TFLG1.&lt;/P&gt;&lt;P&gt;1&amp;lt;&amp;lt; TIM_TFLG1_C4F_MASK == 1&amp;lt;&amp;lt;16 = 0x10000 which requires 17bits&lt;/P&gt;&lt;P&gt;1&amp;lt;&amp;lt; TIM_TFLG1_C5F_MASK == 1&amp;lt;&amp;lt;32&amp;nbsp;&amp;nbsp;&amp;nbsp; 33 bits. Certainly compiler integer constants math is 32bits wide and thus compiler doesn't produce warning for 1&amp;lt;&amp;lt;32&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to remove erroneous "1&amp;lt;&amp;lt; "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Edward&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 May 2016 12:28:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Warning-Message-C2705/m-p/494054#M12181</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2016-05-03T12:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Warning Message C2705</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Warning-Message-C2705/m-p/494055#M12182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Edward,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 May 2016 21:24:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Warning-Message-C2705/m-p/494055#M12182</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2016-05-03T21:24:38Z</dc:date>
    </item>
  </channel>
</rss>

