From: Grissiom <cha...@gm...> - 2010-03-28 14:58:24
|
Hello all, When I develop a 8051 program with sdcc-20100320-5743, I get a problem about the warning 180, the whole message is: warning 180: using ~ on bit/bool/unsigned char variables can give unexpected results due to promotion to int The corresponding codes are: ====================================== 54 void motor_switch_ori() - 55 { | 56 mori = ~mori; | 57 } ====================================== the asm code generated by sdcc is: ====================================== 467 _motor_switch_ori: 468 ; motor_control.c:56: mori = ~mori; 469 setb _P1_6 470 ret ====================================== which is definitely not what I want. What could I do to reverse a bit? Or it's a compiler's bug? -- Cheers, Grissiom |