<?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>Classic/Legacy CodeWarriorのトピックCodeWarrior for StarCore V3.0 - array initialization</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CodeWarrior-for-StarCore-V3-0-array-initialization/m-p/130085#M429</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hi,everyone&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;recently, I find CW for starcore 3.0 does not support initialization of arrays with variables, which requires&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;constant. Other compiles such as Visual C++ from Microsoft supports this function. I don't know how the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C standard specify this, but this function is not very difficulty to implement. If this function is supported&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in the next release, it can avoid changing codes when we port codes from one compiler to another. Any comments?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jogging Song&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;Message Edited by CrasyCat on &lt;SPAN class="date_text"&gt;2007-04-10&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;11:04 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Apr 2007 13:36:41 GMT</pubDate>
    <dc:creator>jogging</dc:creator>
    <dc:date>2007-04-10T13:36:41Z</dc:date>
    <item>
      <title>CodeWarrior for StarCore V3.0 - array initialization</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CodeWarrior-for-StarCore-V3-0-array-initialization/m-p/130085#M429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hi,everyone&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;recently, I find CW for starcore 3.0 does not support initialization of arrays with variables, which requires&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;constant. Other compiles such as Visual C++ from Microsoft supports this function. I don't know how the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C standard specify this, but this function is not very difficulty to implement. If this function is supported&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in the next release, it can avoid changing codes when we port codes from one compiler to another. Any comments?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jogging Song&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;Message Edited by CrasyCat on &lt;SPAN class="date_text"&gt;2007-04-10&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;11:04 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2007 13:36:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CodeWarrior-for-StarCore-V3-0-array-initialization/m-p/130085#M429</guid>
      <dc:creator>jogging</dc:creator>
      <dc:date>2007-04-10T13:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior for StarCore V3.0 - array initialization</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CodeWarrior-for-StarCore-V3-0-array-initialization/m-p/130086#M430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can you please be more specific.&lt;/DIV&gt;&lt;DIV&gt;What is not working?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can you provide a code snippet?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2007 16:05:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CodeWarrior-for-StarCore-V3-0-array-initialization/m-p/130086#M430</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2007-04-10T16:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior for StarCore V3.0 - array initialization</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CodeWarrior-for-StarCore-V3-0-array-initialization/m-p/130087#M431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi, CrasyCat&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Following is an example,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;int a, b;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;int arr[] =&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a, b&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;BR /&gt;The example is just an example.&lt;BR /&gt;&lt;BR /&gt;CW tells me: illegal constant expression. C compiles doesn't support to initialize arrays using variables,&lt;BR /&gt;it requires programmer to use constant to initialize arrays.&lt;BR /&gt;&lt;BR /&gt;By the way,&lt;BR /&gt;I can't find materails about SC3400's instruction set on the websites. Now I need to write assemble code for MSC8144,so instruction set is necessary. Is it available now?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Best Regards&lt;BR /&gt;Jogging Song&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2007 17:00:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CodeWarrior-for-StarCore-V3-0-array-initialization/m-p/130087#M431</guid>
      <dc:creator>jogging</dc:creator>
      <dc:date>2007-04-10T17:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: CodeWarrior for StarCore V3.0 - array initialization</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CodeWarrior-for-StarCore-V3-0-array-initialization/m-p/130088#M432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;That code snippet is not legal in ANSI C 89.&lt;BR /&gt;It is legal in C++, and when using C++ the starcore compiler does accept it, so the point is not if it is difficult to implement (I would actually say so, but its done already), but what the language supports. That other compilers do support this as C language extension does not change the language :smileywink:.&lt;BR /&gt;If you want to use C, I would suggest that you adapt your source code. I'm sure MSVC will still compile it. Using C++ just for global initialization seems a bit too much for me.&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;BR /&gt;PS: I did not check C99, not sure what is supported in this C dialect.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;PPS: Does a/b really has to be a variable? I wonder what the real code is using the global initializatio&lt;A href="http://forums.freescale.com/post?board.id=CWCOMM&amp;amp;message.reply_to_id=4730#" rel="nofollow" target="_blank"&gt;&lt;IMG alt="Submit Post" border="0" src="http://forums.freescale.com/../i/skins/freescale/freescale-submitbutton.gif" /&gt;&lt;/A&gt;n for.&lt;BR /&gt;(Not tested&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;enum {a=0, b=0};&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;int arr[] =&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a, b&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;/FONT&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2007 05:32:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CodeWarrior-for-StarCore-V3-0-array-initialization/m-p/130088#M432</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-04-11T05:32:32Z</dc:date>
    </item>
  </channel>
</rss>

