<?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 CW 10 std  libs error in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CW-10-std-libs-error/m-p/174421#M3641</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I using CW 10&lt;/P&gt;&lt;P&gt;(Eclipse C/C++ Development Tools&lt;BR /&gt;Version: 5.0.2.FSL_b02025-A21&lt;BR /&gt;Build id: b02025-A21)&amp;nbsp; and mcf52233 cpu.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I using std lib functions, which returns char*&amp;nbsp;&amp;nbsp; this function work not correctly, because they return in char* in&amp;nbsp; A4 register, but&amp;nbsp; compiler using D0 register as return data. If&amp;nbsp; std lib function return int, then working OK. (return in D0 and using D0).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How resolve this problem?&lt;/P&gt;&lt;P&gt;I tryed recompile libs ( info in pdf ),&amp;nbsp; but got more errors.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Jan 2011 21:46:50 GMT</pubDate>
    <dc:creator>DariusB</dc:creator>
    <dc:date>2011-01-07T21:46:50Z</dc:date>
    <item>
      <title>CW 10 std  libs error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CW-10-std-libs-error/m-p/174421#M3641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I using CW 10&lt;/P&gt;&lt;P&gt;(Eclipse C/C++ Development Tools&lt;BR /&gt;Version: 5.0.2.FSL_b02025-A21&lt;BR /&gt;Build id: b02025-A21)&amp;nbsp; and mcf52233 cpu.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I using std lib functions, which returns char*&amp;nbsp;&amp;nbsp; this function work not correctly, because they return in char* in&amp;nbsp; A4 register, but&amp;nbsp; compiler using D0 register as return data. If&amp;nbsp; std lib function return int, then working OK. (return in D0 and using D0).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How resolve this problem?&lt;/P&gt;&lt;P&gt;I tryed recompile libs ( info in pdf ),&amp;nbsp; but got more errors.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jan 2011 21:46:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CW-10-std-libs-error/m-p/174421#M3641</guid>
      <dc:creator>DariusB</dc:creator>
      <dc:date>2011-01-07T21:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: CW 10 std libs error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CW-10-std-libs-error/m-p/174422#M3642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like you are calling a library function but did not have a prototype for this function.&lt;/P&gt;&lt;P&gt;Did you include the appropriate .h file on top of your source file?&lt;/P&gt;&lt;P&gt;Can you please open project properties then activate the &lt;STRONG&gt;C/C++&lt;/STRONG&gt; &lt;STRONG&gt;Build&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;Settings&lt;/STRONG&gt; page. Then activate the panel &lt;STRONG&gt;Coldfire Compiler&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;Language Settings&lt;/STRONG&gt;. Make sure Require Prototypes is checked.&lt;/P&gt;&lt;P&gt;Then try to build application again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case you try to call a function for which you do not have a prototype you will get an error message,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are still unable to build can you specify which function you are trying to invoke?&lt;/P&gt;&lt;P&gt;Is this function implemented in assembly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 19:01:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CW-10-std-libs-error/m-p/174422#M3642</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2011-01-10T19:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: CW 10 std libs error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CW-10-std-libs-error/m-p/174423#M3643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I known about prototype problems. I was tryed include&amp;nbsp; and extern function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function which I using strpbrk: (but I think that this problem for all function which return pointer type)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was protyping it..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;extern char * strpbrk(const char *, const char *) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think, that stdlib compiled with&amp;nbsp; options, which returns pointer type data via A4.&lt;/P&gt;&lt;P&gt;But&amp;nbsp; project compiler use returns data via D0 register.&lt;/P&gt;&lt;P&gt;So posible resolve problems change compiler options for stdlib buil or for main project. I dont found this options.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;stdlib have other problem, that it using near model for static memory- so need special init A5 register, at startup or in treads.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jan 2011 00:00:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CW-10-std-libs-error/m-p/174423#M3643</guid>
      <dc:creator>DariusB</dc:creator>
      <dc:date>2011-01-11T00:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: CW 10 std libs error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CW-10-std-libs-error/m-p/174424#M3644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did create a project for MCF52233 with the wizard. I activated optimization level 4 and checked the generated disassembly file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got following code generated:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;;   23:     pch = strpbrk (str, key);;   24:         while (pch != NULL);0x00000022  0x43F900000000           lea      _key,a10x00000028  0x41F900000000           lea      _str,a00x0000002E  0x4EBA0000               jsr      _strpbrk0x00000032  0x2D48FFF0               move.l   a0,-16(a6)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So return value is read from A0 (as expected by the calling convention) and strpbrk is putting return value in A0 as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which library file are you linking with your application?&lt;/P&gt;&lt;P&gt;How did you create your project?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you define a pragma&amp;nbsp;&amp;nbsp;pointers_in_xx somewhere in your application (where xx stands either for A0 or for D0)?&lt;/P&gt;&lt;P&gt;This pragmas changes the way the compiler returns pointer values. See&amp;nbsp;FAQ-27837 on &lt;A href="http://www.freescale.com" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;www.freescale.com&lt;/A&gt; for more information on this pragma.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:23:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CW-10-std-libs-error/m-p/174424#M3644</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2020-10-29T09:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: CW 10 std libs error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CW-10-std-libs-error/m-p/174425#M3645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My project was imported from CW7.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;Did you define a pragma&amp;nbsp;&amp;nbsp;pointers_in_xx somewhere in your application (where xx stands either for A0 or for D0)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, you right! &amp;nbsp;&amp;nbsp; &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; &amp;nbsp; pragma was defined . I commented it and now working ok .&lt;/P&gt;&lt;P&gt;//#pragma pointers_in_D0 .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thenks you very much CrasyCat !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jan 2011 19:34:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/CW-10-std-libs-error/m-p/174425#M3645</guid>
      <dc:creator>DariusB</dc:creator>
      <dc:date>2011-01-11T19:34:34Z</dc:date>
    </item>
  </channel>
</rss>

