From: Maarten B. <sou...@ds...> - 2004-07-13 09:10:08
|
Jonathan, Vangelis meant this bug report I think: http://sourceforge.net/tracker/index.php?func=detail&aid=974835&grou p_id=599&atid=100599 But what it comes down to is that ~ promotes the bit to an int as required by the C99 std. After complementing the bits in the int it is cast back down to a bit by comparing it to 0. So there is no bug here, it's just what the standard says it should do. As you found out, if you want to invert a bit variable, use !. > ----- Original Message ----- > From: "jonathan dumaresq" <jdu...@ci...> > To: <sdc...@li...> > Subject: [Sdcc-user] sdcc and some weird bug ! > > > > while(1) > > { > > > > PORTCbits.RC1 = !PORTCbits.RC1; > > > > PORTAbits.RA5 = ~PORTAbits.RA5; > > } > > } > > > > whit this code only RC0 toggle. > > > > the RA5 dosen't toggle.. > > > > so this is very weird ! > > Check the following conversation taking place in sdcc-devel list. It > has some references to ~ and ! operators... > > http://sourceforge.net/tracker/?func=detail&atid=100599&aid=979599&gro > up_id=599 > > > Vangelis |