<?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: aligned attribute issue  in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/aligned-attribute-issue/m-p/461904#M12205</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello cencong,&lt;/P&gt;&lt;P&gt;In the structure ss ,the longest is the&amp;nbsp; "int b" it&amp;nbsp; is 4 byte ,&lt;/P&gt;&lt;P&gt;so in the (aligned(x)),&amp;nbsp; the x minimum should be 4 , 1 is wrong.&lt;/P&gt;&lt;P&gt;If you write 1, it is default use the 4 to calculate .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it hleps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Alice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Apr 2016 02:54:50 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2016-04-26T02:54:50Z</dc:date>
    <item>
      <title>aligned attribute issue</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/aligned-attribute-issue/m-p/461903#M12204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;From the MCU Kinetis Builds Reference Manual, I see:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="146281_146281.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/121411i515A31E21ABF60E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="146281_146281.png" alt="146281_146281.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/35470i5D4FF5EC582826B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a code like:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;struct ss&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; char a;&lt;/P&gt;&lt;P&gt;&amp;nbsp; int b __attribute__ ((aligned(1)));&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I compile it with codewarrior 10.6 and use sizeof() to check the size of this struct, And I found the size is 8, and then I check the address of a and b, found their address still align at 4.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I mean to make b align at 1, so the size of the struct shall be 5.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I misunderstand something or I miss something?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 03:00:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/aligned-attribute-issue/m-p/461903#M12204</guid>
      <dc:creator>cencongsu</dc:creator>
      <dc:date>2016-04-20T03:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: aligned attribute issue</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/aligned-attribute-issue/m-p/461904#M12205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello cencong,&lt;/P&gt;&lt;P&gt;In the structure ss ,the longest is the&amp;nbsp; "int b" it&amp;nbsp; is 4 byte ,&lt;/P&gt;&lt;P&gt;so in the (aligned(x)),&amp;nbsp; the x minimum should be 4 , 1 is wrong.&lt;/P&gt;&lt;P&gt;If you write 1, it is default use the 4 to calculate .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it hleps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Alice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 02:54:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/aligned-attribute-issue/m-p/461904#M12205</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-04-26T02:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: aligned attribute issue</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/aligned-attribute-issue/m-p/461905#M12206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I guess the document description is wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2016 01:43:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/aligned-attribute-issue/m-p/461905#M12206</guid>
      <dc:creator>cencongsu</dc:creator>
      <dc:date>2016-04-27T01:43:21Z</dc:date>
    </item>
  </channel>
</rss>

