<?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 HOWTO: Optimization disable for sections of code in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HOWTO-Optimization-disable-for-sections-of-code/m-p/134618#M3767</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;SPAN style=": ; color: #000000; font-size: 4; font-family: Arial;"&gt;Wow, no standard font to get me started in the thread? Thats just weird! I even had to setup justification just to start typing in this screen!&lt;BR /&gt;&lt;BR /&gt;Anyway, im pretty new to Codewarrior and C Coding, however, i have 10 years of writing assembly code under my belt&lt;BR /&gt;&lt;BR /&gt;Simple question, how do i disable all optimization for sections of C code. Im debugging code that obviously gets removed by optimization while testing. I just want to tell the compilier, for these lines, dont just compile.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Carl&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by CarlFST60L on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2007-05-23&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;11:13 AM&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by CarlFST60L on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2007-05-23&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;11:17 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 May 2007 17:08:31 GMT</pubDate>
    <dc:creator>CarlFST60L</dc:creator>
    <dc:date>2007-05-23T17:08:31Z</dc:date>
    <item>
      <title>HOWTO: Optimization disable for sections of code</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HOWTO-Optimization-disable-for-sections-of-code/m-p/134618#M3767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;SPAN style=": ; color: #000000; font-size: 4; font-family: Arial;"&gt;Wow, no standard font to get me started in the thread? Thats just weird! I even had to setup justification just to start typing in this screen!&lt;BR /&gt;&lt;BR /&gt;Anyway, im pretty new to Codewarrior and C Coding, however, i have 10 years of writing assembly code under my belt&lt;BR /&gt;&lt;BR /&gt;Simple question, how do i disable all optimization for sections of C code. Im debugging code that obviously gets removed by optimization while testing. I just want to tell the compilier, for these lines, dont just compile.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Carl&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by CarlFST60L on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2007-05-23&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;11:13 AM&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by CarlFST60L on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2007-05-23&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;11:17 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2007 17:08:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HOWTO-Optimization-disable-for-sections-of-code/m-p/134618#M3767</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2007-05-23T17:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: HOWTO: Optimization disable for sections of code</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HOWTO-Optimization-disable-for-sections-of-code/m-p/134619#M3768</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;There is no way to disable all of the optimization.&lt;/DIV&gt;&lt;DIV&gt;If compiler removes dead code in a function, just use -Onu. You may also try -O0 (Do not know what it is doing, but could be worth a try).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If you want to link functions, which are never used to your executable file, you have to use the ENTRIES block in a .prm file.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;ENTRIES&lt;/DIV&gt;&lt;DIV&gt;// List of functions/variables to link here.&lt;/DIV&gt;&lt;DIV&gt;END&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If this does not help, I need to know which kind of code is removed.&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>Wed, 23 May 2007 17:29:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HOWTO-Optimization-disable-for-sections-of-code/m-p/134619#M3768</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2007-05-23T17:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: HOWTO: Optimization disable for sections of code</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HOWTO-Optimization-disable-for-sections-of-code/m-p/134620#M3769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Thanks, for what i was doing this time, it worked, but im sure there will be more optimization problems to come...&lt;BR /&gt;&lt;BR /&gt;I have just finished developing a project in assembly, and thought it would be a great test to right the same code in C before starting my next contract which requires C.&lt;BR /&gt;&lt;BR /&gt;There is no specific code that is a problem, as i am learning, i am continually 'trying' diffrent things, and as its 'dead code' (or what ever) it just dosnt alow me to debug&lt;BR /&gt;&lt;BR /&gt;Just a simple on/off optimization button would be very useful for development/testing (maybe its just me, im know that i am only knew to this, so maybe i will not think otherwise in a few weeks when i know how it all works)&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by CarlFST60L on &lt;SPAN class="date_text"&gt;2007-05-23&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;12:01 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2007 17:51:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HOWTO-Optimization-disable-for-sections-of-code/m-p/134620#M3769</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2007-05-23T17:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: HOWTO: Optimization disable for sections of code</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HOWTO-Optimization-disable-for-sections-of-code/m-p/134621#M3770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;If the code is considered as dead, it is because the compiler didn't see any way to get to it.&lt;BR /&gt;I would concentrate on eliminating the ambiguity or mistake rather than disabling the messages and their source. You are likely to get a problem if the compiler flags something like this.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Alban.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2007 22:10:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HOWTO-Optimization-disable-for-sections-of-code/m-p/134621#M3770</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2007-05-23T22:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: HOWTO: Optimization disable for sections of code</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HOWTO-Optimization-disable-for-sections-of-code/m-p/134622#M3771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello I completely agree with Alban here. Switching optimization off might give the impression the compiler is generating bad (non-optimal) code. It would probably make more sense to figure out why the code has been removed and fix the source code. CrasyCat&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2007 10:53:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HOWTO-Optimization-disable-for-sections-of-code/m-p/134622#M3771</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2007-05-24T10:53:07Z</dc:date>
    </item>
  </channel>
</rss>

