<?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: CodeWarrior for HC12 version 5.2 does not comply to C90 in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-for-HC12-version-5-2-does-not-comply-to-C90/m-p/896769#M15043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;shows that the compiler violates C90 as far as the very important clause&amp;nbsp;6.3.3.4 is concerned, where it says:&lt;/LI&gt;&lt;/UL&gt;&lt;P style="padding: 0px; min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; When applied to an operand that has type char. unsigned char. or signed char. (or a qualified version thereof) the result is 1.&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It also says&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;sizeof &lt;/STRONG&gt;operator yields the size (in bytes) of its operand, which may be an expression or the parenthesized name of a type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bytes, not chars. And both clauses about sizeof&amp;nbsp;kind of forbid option to make char wider than minimum addressable piece of memory (8bits byte on S12(X), 16bits byte on TI's C2000).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 20 Apr 2019 18:15:09 GMT</pubDate>
    <dc:creator>kef2</dc:creator>
    <dc:date>2019-04-20T18:15:09Z</dc:date>
    <item>
      <title>CodeWarrior for HC12 version 5.2 does not comply to C90</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-for-HC12-version-5-2-does-not-comply-to-C90/m-p/896766#M15040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Compiling the following snippet, say, included in source file r.c:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; int a[sizeof(char) == 2 ? -1 : 1];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with a command like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "C:\Program Files (x86)\Freescale\CWS12v5.2\Prog\chc12.exe" -Tc2s2 r.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shows that the compiler violates C90 as far as the very important clause&amp;nbsp;6.3.3.4 is concerned, where it says:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; When applied to an operand that has type char. unsigned char. or signed char. (or a qualified version thereof) the result is 1.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this a known bug?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2019 12:34:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-for-HC12-version-5-2-does-not-comply-to-C90/m-p/896766#M15040</guid>
      <dc:creator>robertobagnara</dc:creator>
      <dc:date>2019-04-16T12:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior for HC12 version 5.2 does not comply to C90</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-for-HC12-version-5-2-does-not-comply-to-C90/m-p/896767#M15041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="282821" data-username="robertobagnara" href="https://community.nxp.com/people/robertobagnara"&gt;Roberto Bagnara&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested your code on my side, there is neither build error nor debug error. see attached video.&lt;/P&gt;&lt;P&gt;please create a new project with IDE and test it also.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jun Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Apr 2019 09:47:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-for-HC12-version-5-2-does-not-comply-to-C90/m-p/896767#M15041</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2019-04-17T09:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior for HC12 version 5.2 does not comply to C90</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-for-HC12-version-5-2-does-not-comply-to-C90/m-p/896768#M15042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jun Zhang.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You probably missed the -Tc2s2&amp;nbsp; option on the command line. This sets the size of both chars and shorts to 16 bits.&amp;nbsp; The option is described in the manual in section "-T: Flexible Type Management".&amp;nbsp; Figure 5.4 in the same manual explains how to set this in the IDE.&amp;nbsp; The bug in the compiler manifests itself only if the size of chars is set to anything different from 8 bits.&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Roberto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Apr 2019 18:01:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-for-HC12-version-5-2-does-not-comply-to-C90/m-p/896768#M15042</guid>
      <dc:creator>robertobagnara</dc:creator>
      <dc:date>2019-04-17T18:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior for HC12 version 5.2 does not comply to C90</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-for-HC12-version-5-2-does-not-comply-to-C90/m-p/896769#M15043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;shows that the compiler violates C90 as far as the very important clause&amp;nbsp;6.3.3.4 is concerned, where it says:&lt;/LI&gt;&lt;/UL&gt;&lt;P style="padding: 0px; min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; When applied to an operand that has type char. unsigned char. or signed char. (or a qualified version thereof) the result is 1.&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It also says&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;sizeof &lt;/STRONG&gt;operator yields the size (in bytes) of its operand, which may be an expression or the parenthesized name of a type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bytes, not chars. And both clauses about sizeof&amp;nbsp;kind of forbid option to make char wider than minimum addressable piece of memory (8bits byte on S12(X), 16bits byte on TI's C2000).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Apr 2019 18:15:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/CodeWarrior-for-HC12-version-5-2-does-not-comply-to-C90/m-p/896769#M15043</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2019-04-20T18:15:09Z</dc:date>
    </item>
  </channel>
</rss>

