<?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>Kinetis MicrocontrollersのトピックRe: Kinetis K40 codewarrior structure problem</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179555#M1682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart from the colon instead of a semi-colon, this compiles fine for me with CW10.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reference - entire &lt;STRONG&gt;main.c&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13548445002118910" jivemacro_uid="_13548445002118910" modifiedtitle="true"&gt;
&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;#include "derivative.h" /* include peripheral declarations */&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;typedef struct {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int x;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int y;&lt;/P&gt;
&lt;P&gt;} new_struct;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;new_struct my_new_struct;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;void main (void) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; my_new_struct.x=0;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:29:09 GMT</pubDate>
    <dc:creator>pgo</dc:creator>
    <dc:date>2020-10-29T09:29:09Z</dc:date>
    <item>
      <title>Kinetis K40 codewarrior structure problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179551#M1678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using eclipse based codewarrior for mcu 10.1 and I cant use structures, what Iam doing wrong? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;struct steering {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int P;&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;steering left;&lt;/P&gt;&lt;P&gt;left.P=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;typedef struct{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int x;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int y;&lt;/P&gt;&lt;P&gt;} new_struct;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;new_struct.x=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In both examples I am getting declaration syntax error. It can make a structure but if I want to change its member I am getting declaration syntax error.&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Nov 2012 14:28:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179551#M1678</guid>
      <dc:creator>mareklagger</dc:creator>
      <dc:date>2012-11-17T14:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis K40 codewarrior structure problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179552#M1679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a couple of obvious problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may be used to C++ which has some different rules to C.&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13532072792692327" jivemacro_uid="_13532072792692327" modifiedtitle="true"&gt;
&lt;P&gt;struct steering {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; int P;&lt;/P&gt;
&lt;P&gt;};&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;struct steering left;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;left.P=0;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;
&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;SPAN class="mce_paste_marker"&gt;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to repeat the keyword &lt;STRONG&gt;struct&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;in the declaration of the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13532073060042957" jivemacro_uid="_13532073060042957" modifiedtitle="true"&gt;
&lt;P&gt;typedef struct&lt;/P&gt;
&lt;P&gt;int x;&lt;/P&gt;
&lt;P&gt;int yl&lt;/P&gt;
&lt;P&gt;}new_struct;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;new_struct.x = 0;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;
&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is illegal for two reasons:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;STRONG&gt;typedef struct&lt;/STRONG&gt; does not create a variable but a type instead.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="mce_paste_marker"&gt;You also cannot have declarations after executable statements e.g.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker" style="font-family: courier new,courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_13532072792391917 jive_text_macro jive_macro_code" jivemacro_uid="_13532072792391917"&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&lt;SPAN class="mce_paste_marker"&gt;int x;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="mce_paste_marker" style="font-family: courier new,courier;"&gt;x = 4;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="mce_paste_marker" style="font-family: courier new,courier;"&gt;int y;&amp;nbsp; /* Illegal */&lt;/SPAN&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker" style="font-family: courier new,courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;bye&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:29:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179552#M1679</guid>
      <dc:creator>pgo</dc:creator>
      <dc:date>2020-10-29T09:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis K40 codewarrior structure problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179553#M1680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried it and the result is the same. Declaration and syntax error for both. It looks like there is something with compiler.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Nov 2012 08:53:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179553#M1680</guid>
      <dc:creator>mareklagger</dc:creator>
      <dc:date>2012-11-18T08:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis K40 codewarrior structure problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179554#M1681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;typedef struct{&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int x;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int y;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;} new_struct;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;new_struct my_new_struct: &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;void foo (void)&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;{&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff; padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;my_new_struct&lt;/SPAN&gt;.x=0;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff; padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;}&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 21:52:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179554#M1681</guid>
      <dc:creator>carlos_neri</dc:creator>
      <dc:date>2012-12-06T21:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis K40 codewarrior structure problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179555#M1682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart from the colon instead of a semi-colon, this compiles fine for me with CW10.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reference - entire &lt;STRONG&gt;main.c&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13548445002118910" jivemacro_uid="_13548445002118910" modifiedtitle="true"&gt;
&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;#include "derivative.h" /* include peripheral declarations */&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;typedef struct {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int x;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int y;&lt;/P&gt;
&lt;P&gt;} new_struct;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;new_struct my_new_struct;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;void main (void) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; my_new_struct.x=0;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:29:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179555#M1682</guid>
      <dc:creator>pgo</dc:creator>
      <dc:date>2020-10-29T09:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis K40 codewarrior structure problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179556#M1683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the feedback PGO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully this will help Marek.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 01:45:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179556#M1683</guid>
      <dc:creator>carlos_neri</dc:creator>
      <dc:date>2012-12-07T01:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Kinetis K40 codewarrior structure problem</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179557#M1684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. The problem was that I didnt create the variable of struct type. But there was also some minor problem because I declared it in header. Now its working well&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 09:18:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Kinetis-K40-codewarrior-structure-problem/m-p/179557#M1684</guid>
      <dc:creator>mareklagger</dc:creator>
      <dc:date>2012-12-07T09:18:29Z</dc:date>
    </item>
  </channel>
</rss>

