Andy, > I'm sure you already know this, but others might not: If your > compiler doesn't have an option to generate warnings when it > sees simple assignments within "if" expressions (or an option to It does that by default. I didn't want to mention that lest I be seen as opportunistic, self-serving and crass. But it's probably too late anyway... > disable such assignments), you can prevent the bug by reordering > the expression thusly: > > if (1 == fred) Indeed, I have come across this. I personally have never adopted this style, not because I can find any particular fault with it, but it just looks unnatural to me. I'm just used to having the variable on the left. Clyde -- Clyde Smith-Stubbs | HI-TECH Software Email: clyde@htsoft.com | Phone Fax WWW: http://www.htsoft.com/ | USA: (408) 490 2885 (408) 490 2885 PGP: finger clyde@htsoft.com | AUS: +61 7 3354 2411 +61 7 3354 2422 --------------------------------------------------------------------------- ANSI C for the PIC! Now shipping! See www.htsoft.com for more info.