<?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 array declaration without identify array size in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/array-declaration-without-identify-array-size/m-p/594434#M30955</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by murnesty on Sun Mar 24 22:39:30 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes. Actually... I'm thinking is unsafe too but this is a sample code so I thought there is some trick there. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you. So I just erase his code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:55:00 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:55:00Z</dc:date>
    <item>
      <title>array declaration without identify array size</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/array-declaration-without-identify-array-size/m-p/594434#M30955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by murnesty on Sun Mar 24 22:39:30 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes. Actually... I'm thinking is unsafe too but this is a sample code so I thought there is some trick there. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you. So I just erase his code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:55:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/array-declaration-without-identify-array-size/m-p/594434#M30955</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: array declaration without identify array size</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/array-declaration-without-identify-array-size/m-p/594435#M30956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Mon Mar 25 00:44:45 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;No it is not safe. Suggest you learn about pointers and arrays.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://pw1.netcom.com/~tjensen/ptr/pointers.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:55:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/array-declaration-without-identify-array-size/m-p/594435#M30956</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: array declaration without identify array size</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/array-declaration-without-identify-array-size/m-p/594436#M30957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Mon Mar 25 01:26:04 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;What do you think is your compiler trying to tell you with:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt; char uart0_buf[]; &lt;BR /&gt; warning: array 'uart0_buf' assumed to have one element &lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;If you are still unsure about array size, look in your map file:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And surprise, it's 1 byte :) So this is a safe 1 byte array ;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you are filling this array with sprintf:&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; sprintf(uart0_buf,"Testing1234 - Uart 2\n\r");&amp;nbsp;&amp;nbsp;&amp;nbsp; // Print Message String&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;That's safe, too. Sprintf is using start address of array uart0_buf and writing your data ;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Memory view is showing your string in RAM, so the compiler was executing all your nonsense :D&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:55:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/array-declaration-without-identify-array-size/m-p/594436#M30957</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: array declaration without identify array size</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/array-declaration-without-identify-array-size/m-p/594437#M30958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wrighflyer on Mon Mar 25 03:36:16 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I love it when people edit/remove the first post on a forum - ho hum.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway I wonder if malloc() might have been the solution to the problem we'll never see again?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:55:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/array-declaration-without-identify-array-size/m-p/594437#M30958</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: array declaration without identify array size</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/array-declaration-without-identify-array-size/m-p/594438#M30959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Mon Mar 25 03:57:05 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: wrighflyer&lt;/STRONG&gt;&lt;BR /&gt;I love it when people edit/remove the first post on a forum - ho hum.&lt;BR /&gt;&lt;BR /&gt;Anyway I wonder if malloc() might have been the solution to the problem we'll never see again?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes and No :rolleyes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Following his sample, he is using an 1 char array. So if you also allocate 1 byte, it's the same nonsense :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:55:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/array-declaration-without-identify-array-size/m-p/594438#M30959</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:55:03Z</dc:date>
    </item>
  </channel>
</rss>

