<?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: Unable to inline from other source files in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-Unable-to-inline-from-other-source-files/m-p/129468#M934</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;This is fully normal behavior.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;When compiling the compiler has only visibility on the current compilation unit (the source file and all the files it includes).&lt;/DIV&gt;&lt;DIV&gt;If a function is implemented in another module, the compiler will not be able to inline it as it will not know which is the code from the function.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If you wish to inline a function in several different source files, I would recommend you to implement a static function in a header file and include the header file in different source file.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Sep 2006 17:09:08 GMT</pubDate>
    <dc:creator>CrasyCat</dc:creator>
    <dc:date>2006-09-07T17:09:08Z</dc:date>
    <item>
      <title>HC12: Unable to inline from other source files</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-Unable-to-inline-from-other-source-files/m-p/129467#M933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I noticed today that when calling&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// foo.c&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#pragma INLINE &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void foo(void){xxx}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// bar.c&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void bar(void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; foo();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it's not inlined.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When calling INLINE functions from the same source file, it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I doing something wrong or is it not implemented?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;HCS12 with CW 3.1 &amp;amp; 4.5 with build option -Oi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/Thanks&lt;/SPAN&gt;&lt;P&gt;Message Edited by CrasyCat on &lt;SPAN class="date_text"&gt;2007-04-13&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;02:27 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2006 16:40:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-Unable-to-inline-from-other-source-files/m-p/129467#M933</guid>
      <dc:creator>falken</dc:creator>
      <dc:date>2006-09-07T16:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to inline from other source files</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-Unable-to-inline-from-other-source-files/m-p/129468#M934</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;This is fully normal behavior.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;When compiling the compiler has only visibility on the current compilation unit (the source file and all the files it includes).&lt;/DIV&gt;&lt;DIV&gt;If a function is implemented in another module, the compiler will not be able to inline it as it will not know which is the code from the function.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If you wish to inline a function in several different source files, I would recommend you to implement a static function in a header file and include the header file in different source file.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2006 17:09:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-Unable-to-inline-from-other-source-files/m-p/129468#M934</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-09-07T17:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to inline from other source files</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-Unable-to-inline-from-other-source-files/m-p/129469#M935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Ok, thanks.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2006 18:00:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-Unable-to-inline-from-other-source-files/m-p/129469#M935</guid>
      <dc:creator>falken</dc:creator>
      <dc:date>2006-09-07T18:00:35Z</dc:date>
    </item>
  </channel>
</rss>

