<?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 Design Studio中的主题 Re: set enumeration size</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/set-enumeration-size/m-p/394177#M2473</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dale,&lt;/P&gt;&lt;P&gt;this is actually not a question about KDS, this is a question about compilers (well, gcc).&lt;/P&gt;&lt;P&gt;There is a good article about this topic:&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/1113855/is-the-sizeofenum-sizeofint-always" title="http://stackoverflow.com/questions/1113855/is-the-sizeofenum-sizeofint-always"&gt;http://stackoverflow.com/questions/1113855/is-the-sizeofenum-sizeofint-always&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and you will find more if you search the internet e.g. for&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gnu gcc force enum size&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some compilers have options to set the size. To my knowledge in gcc you only can set an option to pack (or making the enums 'short'), which is exactly what you do *not* want. So setting a dummy element with a value &amp;gt; one byte what I would do too. I don't see any other solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Apr 2015 19:25:42 GMT</pubDate>
    <dc:creator>BlackNight</dc:creator>
    <dc:date>2015-04-09T19:25:42Z</dc:date>
    <item>
      <title>set enumeration size</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/set-enumeration-size/m-p/394176#M2472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;KDS will will create a 8 or 16 bit value based on the number of elements is an enumeration. This is great for optimization but causes issues where a fixed size is expected. We worked around this issue by setting an element to 65535. But it is not clean. Is there a way to force enums to UInt16 in KDS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 15:50:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/set-enumeration-size/m-p/394176#M2472</guid>
      <dc:creator>barbercolman</dc:creator>
      <dc:date>2015-04-09T15:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: set enumeration size</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/set-enumeration-size/m-p/394177#M2473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dale,&lt;/P&gt;&lt;P&gt;this is actually not a question about KDS, this is a question about compilers (well, gcc).&lt;/P&gt;&lt;P&gt;There is a good article about this topic:&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/1113855/is-the-sizeofenum-sizeofint-always" title="http://stackoverflow.com/questions/1113855/is-the-sizeofenum-sizeofint-always"&gt;http://stackoverflow.com/questions/1113855/is-the-sizeofenum-sizeofint-always&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and you will find more if you search the internet e.g. for&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gnu gcc force enum size&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some compilers have options to set the size. To my knowledge in gcc you only can set an option to pack (or making the enums 'short'), which is exactly what you do *not* want. So setting a dummy element with a value &amp;gt; one byte what I would do too. I don't see any other solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 19:25:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/set-enumeration-size/m-p/394177#M2473</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2015-04-09T19:25:42Z</dc:date>
    </item>
  </channel>
</rss>

