<?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 Using Not used variables in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-Not-used-variables/m-p/196313#M5124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm using a lot of constant variables in a table and the code is written in a way that the linker cannot see that they are used and hence they will not be linked into the application. To avoid this I'm forced to do a dummy read for each variable.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is there a way to tell the linker that the variables inside this segment must be linked even if they seem to be unused??&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;//Bengt&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Oct 2008 21:11:08 GMT</pubDate>
    <dc:creator>BAN</dc:creator>
    <dc:date>2008-10-22T21:11:08Z</dc:date>
    <item>
      <title>Using Not used variables</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-Not-used-variables/m-p/196313#M5124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm using a lot of constant variables in a table and the code is written in a way that the linker cannot see that they are used and hence they will not be linked into the application. To avoid this I'm forced to do a dummy read for each variable.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is there a way to tell the linker that the variables inside this segment must be linked even if they seem to be unused??&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;//Bengt&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 21:11:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-Not-used-variables/m-p/196313#M5124</guid>
      <dc:creator>BAN</dc:creator>
      <dc:date>2008-10-22T21:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using Not used variables</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-Not-used-variables/m-p/196314#M5125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;In the .prm file, add each variable name below "ENTRIES":&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;ENTRIES
  x
END&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;/* C file */

#pragma CONST_SEG MY_CONST_DATA

int x my_table[N] = {...};

#pragma CONST_SEG DEFAULT

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:51:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-Not-used-variables/m-p/196314#M5125</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2020-10-29T09:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using Not used variables</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-Not-used-variables/m-p/196315#M5126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi BAN,&lt;BR /&gt;&lt;BR /&gt;This depends on CodeWarrior you are using. Could you specify which CodeWarrior you mean?&lt;BR /&gt;&lt;BR /&gt;e.g. 8/16 bits CW: in linker parameter file (.prm) you can use:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;&lt;B&gt;ENTRIES&amp;nbsp;&amp;nbsp; /* switch off smart linking to get unreferenced vector table */&lt;BR /&gt;&amp;nbsp;vectab&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;END&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/B&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;in other CW e.g. CW for MPC55xx&amp;nbsp; you can use&amp;nbsp; FORCEACTIVE keyword in the linker command file .lcf:&lt;BR /&gt;&lt;B&gt;&lt;FONT face="Courier New"&gt;&lt;BR /&gt;FORCEACTIVE { symbol1 symbol2 ... }&lt;/FONT&gt;&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;For more information I'd suggest you to see appropriate Build tools manual&lt;BR /&gt;&lt;BR /&gt;Stanish&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 22:07:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-Not-used-variables/m-p/196315#M5126</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2008-10-22T22:07:59Z</dc:date>
    </item>
  </channel>
</rss>

