<?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: LINKER error in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/LINKER-error/m-p/205048#M5677</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Search for TERMIO_PutChar with the search box below in this forum.&lt;BR /&gt;I had 26 hits and some of them did answer your question.&lt;BR /&gt;Apart from this issue, your function looks a bit suspicious to me&lt;BR /&gt;as it for some inputs returns a non nul terminated string, and for some it writes up to length+1 bytes in the passed in buffer. I would make sure to always 0 terminate string buffers, and to never write more than the passed in length (of course the caller could allocate one byte more for the 0 byte already, but that is not the common way buffer sizes are done).&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 22 Mar 2008 09:42:39 GMT</pubDate>
    <dc:creator>CompilerGuru</dc:creator>
    <dc:date>2008-03-22T09:42:39Z</dc:date>
    <item>
      <title>LINKER error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/LINKER-error/m-p/205047#M5676</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 am a newbie on micrcontroller. I am implementing a function (in C)&amp;nbsp; that reads in messages received at the SCI input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The function reads characters in using the GetSci( ) function, storing the characters into the inData array.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;The function returns a message giving the actual length of the message via the hyperterminal (by which I am supposed to dialog with the PC) . the length has a max value of 100, but can be shorter . this is why the function displays the actual size of the message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;when I compile with code warrior, I have the &lt;/SPAN&gt;&lt;STRONG&gt;linker error L 1822 TERMIO_PUTCHAR undefined.&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;reading other posts about it, it seems to be the &lt;/SPAN&gt;&lt;STRONG&gt;printf&lt;/STRONG&gt;&lt;SPAN&gt; function but I did not understood the proposed fixes. I am using the MC9S12C32 processor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here my function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;int MsgIn(char inData[], unsigned int length){&amp;nbsp;&amp;nbsp;&amp;nbsp; int size=0;&amp;nbsp;&amp;nbsp;&amp;nbsp; char character=0;&amp;nbsp;&amp;nbsp;&amp;nbsp; character =GetSci();&amp;nbsp; // reading character from SCI&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(size&amp;lt;length){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inData[size]=character;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size++;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(character==LF)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inData[size]=0;// stor a 0 at the end of the message&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }// end while&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; return printf("The length is %d \n",size);}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can I have some suggestions about how to fix it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thankx&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Mar 2008 00:41:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/LINKER-error/m-p/205047#M5676</guid>
      <dc:creator>Halom</dc:creator>
      <dc:date>2008-03-22T00:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: LINKER error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/LINKER-error/m-p/205048#M5677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Search for TERMIO_PutChar with the search box below in this forum.&lt;BR /&gt;I had 26 hits and some of them did answer your question.&lt;BR /&gt;Apart from this issue, your function looks a bit suspicious to me&lt;BR /&gt;as it for some inputs returns a non nul terminated string, and for some it writes up to length+1 bytes in the passed in buffer. I would make sure to always 0 terminate string buffers, and to never write more than the passed in length (of course the caller could allocate one byte more for the 0 byte already, but that is not the common way buffer sizes are done).&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Mar 2008 09:42:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/LINKER-error/m-p/205048#M5677</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2008-03-22T09:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: LINKER error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/LINKER-error/m-p/205049#M5678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thankx ,&lt;BR /&gt;I got an answer!&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2008 02:43:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/LINKER-error/m-p/205049#M5678</guid>
      <dc:creator>Halom</dc:creator>
      <dc:date>2008-03-24T02:43:29Z</dc:date>
    </item>
  </channel>
</rss>

