Hello all,

I'm  having  a  strange  compilation problem when I turned on Level 4
Optimizations  in  CodeWarrior  8.3. With optimizations off and up to
level 3 of optimizations next code works without any problems:



Int16 DiffX, DiffY;
Int8 bombfatal;

     if ( ( (DiffX*DiffX + DiffY*DiffY) <= (bombfatal*bombfatal) ) ) {

     // some code here...

     }


     
But  when  I switch on Level 4 optimizations, program never gets into
the  part  which  should  be  executed  when IF statement is true. It
is always false and the code inside the brackets is never executed.

But, if I write this code, like:



Int16 DiffX, DiffY;
Int8 bombfatal;
Int16 a,b;

      a = DiffX*DiffX + DiffY*DiffY;
      b = bombfatal*bombfatal;
      if ( a <= b ) {

      // some code here...

      }


      
it works with Level 4 optimizations!!!

Is this compilers error, or I wrote something wrong here???


-- 
http://www.indus3.org  icq:41832403


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to