<?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: Crazy function for local scope: help! in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Crazy-function-for-local-scope-help/m-p/188970#M6715</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;YUUuuuuuuuuuu!&amp;nbsp;&amp;nbsp; &lt;SPAN&gt;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Thanks: I have insert option: -Wpd&lt;BR /&gt;and the compiler have alert me with warnig!&lt;BR /&gt;Missing : #include funcs.h&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN&gt;&lt;IMG alt=":smileysurprised:" class="emoticon emoticon-smileysurprised" id="smileysurprised" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-surprised.gif" title="Smiley Surprised" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;thanks again!&amp;nbsp;&amp;nbsp; &lt;SPAN&gt;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Oct 2008 02:54:50 GMT</pubDate>
    <dc:creator>cicciounico</dc:creator>
    <dc:date>2008-10-01T02:54:50Z</dc:date>
    <item>
      <title>Crazy function for local scope: help!</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Crazy-function-for-local-scope-help/m-p/188967#M6712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I use MC9S08LC36.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have make a function defined in funcs.h :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void CaricoOre(unsigned char );&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I use this function and I pass it a global var defined in ram.h with:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#ifdef _MAIN_C&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; #define g_var&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; #define g_var extern&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;g_var unsigned char ore;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My problem is: when I call My function, the var passed is 0 but insiede the function is random value!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The screen shot: call function&lt;/SPAN&gt;&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fciccioamore.altervista.org%2F1.jpg" rel="nofollow" target="_blank"&gt;http://ciccioamore.altervista.org/1.jpg&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://ciccioamore.altervista.org/2.jpg"&gt;&lt;IMG src="http://ciccioamore.altervista.org/2.jpg" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Inside the function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fciccioamore.altervista.org%2F2.jpg" rel="nofollow" target="_blank"&gt;http://ciccioamore.altervista.org/2.jpg&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://ciccioamore.altervista.org/2.jpg"&gt;&lt;IMG src="http://ciccioamore.altervista.org/2.jpg" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://ciccioamore.altervista.org/2.jpg"&gt;&lt;IMG src="http://ciccioamore.altervista.org/2.jpg" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://ciccioamore.altervista.org/2.jpg"&gt;&lt;IMG src="http://ciccioamore.altervista.org/2.jpg" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://ciccioamore.altervista.org/2.jpg"&gt;&lt;IMG src="http://ciccioamore.altervista.org/2.jpg" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://ciccioamore.altervista.org/2.jpg"&gt;&lt;IMG src="http://ciccioamore.altervista.org/2.jpg" /&gt;&lt;/A&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Sep 2008 04:40:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Crazy-function-for-local-scope-help/m-p/188967#M6712</guid>
      <dc:creator>cicciounico</dc:creator>
      <dc:date>2008-09-27T04:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Crazy function for local scope: help!</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Crazy-function-for-local-scope-help/m-p/188968#M6713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I am no debugger expert, but what happens here is that the parameter is passed through a register (namely A), and not on the stack. Check the value of the A register (the register view is not included in you screenshots). I would expect it to be 0. Note that for functions with a fixed number of arguments and when the size of the last argument is one byte, the compiler will always pass this last argument through a A register (this behavior is documented in the compiler manual in this section: "Calling Protocol and Conventions" ).&lt;BR /&gt;&lt;BR /&gt;Navidad&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 14:26:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Crazy-function-for-local-scope-help/m-p/188968#M6713</guid>
      <dc:creator>Navidad</dc:creator>
      <dc:date>2008-09-29T14:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Crazy function for local scope: help!</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Crazy-function-for-local-scope-help/m-p/188969#M6714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It would be worthwhile checking if you have a prototype of function Caricoure&amp;nbsp;in module where ShowLCD is implemented.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In order to figure that out, can you please add the option -Wpd to your compiler command line? If you get an error message that means you are invoking the function, but there is no prototype for it.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Please add a prototype for&amp;nbsp;the function before you call it.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If this does not help, I would recommend you to submit a service request for that.&lt;BR /&gt;&lt;BR /&gt;Click &lt;A href="https://www.freescale.com/webapp/servicerequest.create_SR.framework?regFlag=fromOpenSR" rel="nofollow" target="_blank"&gt;here&lt;/A&gt; to submit a service request.&lt;BR /&gt;&lt;BR /&gt;Make sure to attach a reproducible project and installed product information to the service request.&lt;BR /&gt;To generate the required information:&lt;BR /&gt;- Start CodeWarrior&lt;BR /&gt;- Open the project&lt;BR /&gt;- Select "Help" -&amp;gt; "Pack and Go" and follow instructions on the screen.&lt;BR /&gt;&lt;BR /&gt;Attach the generated .zip file to the SR.&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2008 15:57:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Crazy-function-for-local-scope-help/m-p/188969#M6714</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2008-09-29T15:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Crazy function for local scope: help!</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Crazy-function-for-local-scope-help/m-p/188970#M6715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;YUUuuuuuuuuuu!&amp;nbsp;&amp;nbsp; &lt;SPAN&gt;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Thanks: I have insert option: -Wpd&lt;BR /&gt;and the compiler have alert me with warnig!&lt;BR /&gt;Missing : #include funcs.h&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN&gt;&lt;IMG alt=":smileysurprised:" class="emoticon emoticon-smileysurprised" id="smileysurprised" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-surprised.gif" title="Smiley Surprised" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;thanks again!&amp;nbsp;&amp;nbsp; &lt;SPAN&gt;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2008 02:54:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Crazy-function-for-local-scope-help/m-p/188970#M6715</guid>
      <dc:creator>cicciounico</dc:creator>
      <dc:date>2008-10-01T02:54:50Z</dc:date>
    </item>
  </channel>
</rss>

