#226 Unsigned comparisons not-optimal

closed-fixed
5
2013-05-25
2001-11-14
No

A commented example says it all:

volatile unsigned int x;

extern void do_something( void );

void foo( void )
{
if ( x < 0 ) {
do_something(); /* code is unreachable,
no warning is generated */
}

if ( x > 0 ) { /* can be replaced by if (x)
which is more efficient */
do_something();
}
}

As seen with november 12 snapshot, MingW,
sdcc -mz80 -c

Discussion

  • Sandeep Dutta

    Sandeep Dutta - 2001-12-21

    Logged In: YES
    user_id=1551

    Fixed sorry it took a while

     
  • Sandeep Dutta

    Sandeep Dutta - 2001-12-21
    • labels: --> C-Front End
    • milestone: --> fixed
    • assigned_to: nobody --> sandeep
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks