<?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>CodeWarrior for MCU中的主题 Re: Data Structure problem in Code warrior</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127397#M540</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;you are not going to beleive what the problem was. if you declare DATA after the structure you are using it in it doesn't compile and gives you all sort of errors but&amp;nbsp;if you declare DATA before u use it in another data structure, it complies with no problem.&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;sincerely,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Aug 2006 22:37:07 GMT</pubDate>
    <dc:creator>wheelmonitor</dc:creator>
    <dc:date>2006-08-22T22:37:07Z</dc:date>
    <item>
      <title>Data Structure problem in Code warrior</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127391#M534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Does anyone know if Code Warrior has a problem of declaring data structure within a data structure, In specific i am doing the following and the code warrios is giving me compile error. Anyone has any idea on how to get around the problem:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;struct{&lt;/DIV&gt;&lt;DIV&gt;int x;&lt;/DIV&gt;&lt;DIV&gt;int y;&lt;/DIV&gt;&lt;DIV&gt;}DATA;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;typedef struct{&lt;/DIV&gt;&lt;DIV&gt;int j;&lt;/DIV&gt;&lt;DIV&gt;int k;&lt;/DIV&gt;&lt;DIV&gt;DATA d;&lt;/DIV&gt;&lt;DIV&gt;}STRUCT;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;the error i get is "typedef name expected"&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 01:59:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127391#M534</guid>
      <dc:creator>wheelmonitor</dc:creator>
      <dc:date>2006-08-22T01:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Data Structure problem in Code warrior</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127392#M535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;you missed the typedef before the first declaration.&lt;BR /&gt;Therefore this defines a global struct DATA, DATA is not a type, it a variable!&lt;BR /&gt;Daniel&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 03:22:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127392#M535</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2006-08-22T03:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Data Structure problem in Code warrior</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127393#M536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;sorry that was a typo. i did use typedef in front of both structures.&lt;/P&gt;&lt;P&gt;thanks for the reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 03:27:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127393#M536</guid>
      <dc:creator>wheelmonitor</dc:creator>
      <dc:date>2006-08-22T03:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Data Structure problem in Code warrior</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127394#M537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;This should work.&lt;/P&gt;&lt;P&gt;Which processor are you targeting (HC08, HC12, Coldfire, PowerPC, .....)?&lt;/P&gt;&lt;P&gt;Which version of CodeWarrior are you using?&lt;BR /&gt;To retrieve version information:&lt;BR /&gt;&amp;nbsp; - Start IDE&lt;BR /&gt;&amp;nbsp; - Select "Help" -&amp;gt; "About Metrowerks CodeWarrior" or "About Freescale CodeWarrior"&lt;BR /&gt;&amp;nbsp; - Press the "Installed Products" button&lt;BR /&gt;&amp;nbsp; - You will see the CodeWarrior version number on top of the "Installed product" dialog.&lt;/P&gt;&lt;P&gt;CrasyCat&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 16:40:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127394#M537</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-08-22T16:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Data Structure problem in Code warrior</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127395#M538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;i am targetting freescale HC12(MC9S12D64) &amp;nbsp;and the Code warrior version is 3.0 with IDE version number is 5.5.1272.&lt;/P&gt;&lt;P&gt;Could it be something in the compiler options that i need to look at???&lt;/P&gt;&lt;P&gt;thanks for replying&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 21:12:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127395#M538</guid>
      <dc:creator>wheelmonitor</dc:creator>
      <dc:date>2006-08-22T21:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Data Structure problem in Code warrior</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127396#M539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;There should be something in your application.&lt;/P&gt;&lt;P&gt;I have created a project with CodeWarrior HC12 V3.0 and added following code there.&lt;/P&gt;&lt;P&gt;typedef struct{&lt;BR /&gt;int x;&lt;BR /&gt;int y;&lt;BR /&gt;}DATA;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;typedef struct{&lt;BR /&gt;int j;&lt;BR /&gt;int k;&lt;BR /&gt;DATA d;&lt;BR /&gt;}STRUCT;&lt;/P&gt;&lt;P&gt;STRUCT myStruct;&lt;/P&gt;&lt;P&gt;void main(void) {&lt;BR /&gt;&amp;nbsp; /* put your own code here */&lt;BR /&gt;&amp;nbsp; EnableInterrupts;&lt;BR /&gt;&amp;nbsp; myStruct.j= 9;&lt;BR /&gt;&amp;nbsp; for(;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt; {} /* wait forever */&lt;BR /&gt;}&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I can build that without any problem.&lt;/P&gt;&lt;P&gt;You may have a syntax error right before the type definition for DATA. Anyway I would need to look at the preprocessor output of the file generating the message.&lt;/P&gt;&lt;P&gt;Can you generate that preprocessor listing (just add option -lp to your compiler command line. The compiler will generate a file with extension .pre. That is the file I need).&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 21:43:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127396#M539</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-08-22T21:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Data Structure problem in Code warrior</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127397#M540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;you are not going to beleive what the problem was. if you declare DATA after the structure you are using it in it doesn't compile and gives you all sort of errors but&amp;nbsp;if you declare DATA before u use it in another data structure, it complies with no problem.&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;sincerely,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2006 22:37:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127397#M540</guid>
      <dc:creator>wheelmonitor</dc:creator>
      <dc:date>2006-08-22T22:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Data Structure problem in Code warrior</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127398#M541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;This is compliant to ANSI C standard &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;.&lt;/P&gt;&lt;P&gt;If type DATA&amp;nbsp;is not known when STRUCT is defined, the compiler cannot evaluate the size of the type STRUCT. So it complains.&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2006 16:47:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Data-Structure-problem-in-Code-warrior/m-p/127398#M541</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-08-23T16:47:38Z</dc:date>
    </item>
  </channel>
</rss>

