<?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 About 5744p stack initial in MPC5xxx</title>
    <link>https://community.nxp.com/t5/MPC5xxx/About-5744p-stack-initial/m-p/650925#M6804</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;if there is a function likes bellow:&lt;/P&gt;&lt;P&gt;void Func_A(void)&lt;/P&gt;&lt;P&gt;{&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;unsigned int a;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;unsigned int b = 0;&lt;/SPAN&gt;&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;can we make sure the local variables 'a' and 'b' are all zero when Func_A is called?&lt;/P&gt;&lt;P&gt;if we can't make sure 'a' will be zero, how can we do to make sure that?&lt;/P&gt;&lt;P&gt;i know one way of coding like below:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;unsigned int a = 0;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but some times i can not make sure all local variables are all initialed. &amp;nbsp;how can i do to make compiler to initial all un-initialled local variables to zero before running the functions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PS: my compiler is Green Hills.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Sep 2016 08:03:45 GMT</pubDate>
    <dc:creator>liujinhang</dc:creator>
    <dc:date>2016-09-26T08:03:45Z</dc:date>
    <item>
      <title>About 5744p stack initial</title>
      <link>https://community.nxp.com/t5/MPC5xxx/About-5744p-stack-initial/m-p/650925#M6804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;if there is a function likes bellow:&lt;/P&gt;&lt;P&gt;void Func_A(void)&lt;/P&gt;&lt;P&gt;{&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;unsigned int a;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;unsigned int b = 0;&lt;/SPAN&gt;&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;can we make sure the local variables 'a' and 'b' are all zero when Func_A is called?&lt;/P&gt;&lt;P&gt;if we can't make sure 'a' will be zero, how can we do to make sure that?&lt;/P&gt;&lt;P&gt;i know one way of coding like below:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;unsigned int a = 0;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but some times i can not make sure all local variables are all initialed. &amp;nbsp;how can i do to make compiler to initial all un-initialled local variables to zero before running the functions?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PS: my compiler is Green Hills.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 08:03:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/About-5744p-stack-initial/m-p/650925#M6804</guid>
      <dc:creator>liujinhang</dc:creator>
      <dc:date>2016-09-26T08:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: About 5744p stack initial</title>
      <link>https://community.nxp.com/t5/MPC5xxx/About-5744p-stack-initial/m-p/650926#M6805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, it is rather question for GreenHills but in principle only “unsigned int a = 0;” or further initialization in code will guarantee unitialized local variable is cleared.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 10:41:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/About-5744p-stack-initial/m-p/650926#M6805</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2016-09-26T10:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: About 5744p stack initial</title>
      <link>https://community.nxp.com/t5/MPC5xxx/About-5744p-stack-initial/m-p/650927#M6806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm not aware of such a a feature/switch.&lt;/P&gt;&lt;P&gt;User is responsible for the initialization of all the local variables. These variables exists on stack or a register.&lt;/P&gt;&lt;P&gt;Anyway compiler should issue a warning in case there is an uninitialized variable. So I'd suggest you to start with these warnings.&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 10:58:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/About-5744p-stack-initial/m-p/650927#M6806</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2016-09-26T10:58:34Z</dc:date>
    </item>
  </channel>
</rss>

