<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/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/"><channel><title>Else statement not working</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/36999/else-statement-not-working</link><description> 
I am using keil evaluation version. When i use debug for following
program in keil, it skips the else part altogether. It goes to line
1,2 and then 7. Whats wrong with it. 

 
1 a = 1; 
2 if(a == 2){ 
3 a = 4; 
4 }else{ 
5 a = 5; 
6 } 
7 while(1); </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Else statement not working</title><link>https://community.arm.com/thread/87903?ContentTypeID=1</link><pubDate>Sat, 09 Sep 2006 17:04:40 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f81bdd1a-f1c0-45b4-9ec3-4fac5154265a</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Even if &lt;b&gt;a&lt;/b&gt; where used elsewhere, the code is equivalent
to:&lt;/p&gt;

&lt;pre&gt;
   a = 5;

   while(1);
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Else statement not working</title><link>https://community.arm.com/thread/46766?ContentTypeID=1</link><pubDate>Sat, 09 Sep 2006 05:17:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5bed7217-ffc1-42ce-b578-196a7a56a6c3</guid><dc:creator>Mik Kleshov</dc:creator><description>&lt;p&gt;&lt;p&gt;
Must be optimization. Most likely, the variable &lt;b&gt;a&lt;/b&gt; is not
used anywhere, so the compiler removed all the code in lines 1-6.&lt;/p&gt;

&lt;p&gt;
Regards,&lt;br /&gt;
- mike&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>