<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Compiler problem in Keil 5.24.2.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45550/compiler-problem-in-keil-5-24-2-0</link><description>Hi, 
 Please find following source code. 
 
 After compiler by Keil 5.24.2, some code will not compiled, 
 I can see the situation by &amp;quot;enter debug mode, please find following image. 
 
 Would you please tell me why? 
 Thank you</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 Apr 2019 07:22:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45550/compiler-problem-in-keil-5-24-2-0" /><item><title>RE: Compiler problem in Keil 5.24.2.0</title><link>https://devzone.nordicsemi.com/thread/179668?ContentTypeID=1</link><pubDate>Tue, 02 Apr 2019 07:22:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db63de50-8027-4d35-9445-7e3ea22875be</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Chianglin&lt;/p&gt;
&lt;p&gt;You should be able to turn of code optimization in the compiler settings. By default it is set to level 3, which does a lot of optimizations, but you can turn it off completely.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you try to change this and see if it solves the problem?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler problem in Keil 5.24.2.0</title><link>https://devzone.nordicsemi.com/thread/179552?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2019 14:54:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3965429-4ce2-4281-a759-866798a2ee35</guid><dc:creator>chianglin</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Torbj&amp;oslash;rn,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for your explain.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It looks the compiler is very smart, so it will ignore some which may not be execute.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can I disable this compile option, so all of my source can compile to binary?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Chianglin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compiler problem in Keil 5.24.2.0</title><link>https://devzone.nordicsemi.com/thread/179457?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2019 11:13:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32a6c979-1b21-4047-afea-ced2acfc5421</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ives&lt;/p&gt;
&lt;p&gt;It seems the compiler expects the MotorDirection variable never to be set to -1.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could it be that it is defined as unsigned, or that you never set it to -1?&lt;/p&gt;
&lt;p&gt;Possibly it should be declared as volatile, if you write to it from an interrupt handler.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>