Bob Blick wrote: > I'm using HiTech C on a 16F688 and notice a promotion I didn't think > should happen. Here's a little example. "Something" is unimportant > but included for context. > > unsigned char foo; > unsigned char bar; > unsigned char bat; > > if(bat==foo+bar) > Something(); As others have said. Applying the "as if" rule to your code, what you may want could be if( bat == (unsigned char)(foo+bar) ) Something(); Whether or not you want this depends mainly on what you want the comparison to do when (foo+bar) overflows from unsigned char into int land: do you want 1 == (255+2) to be true (the cast is needed) or false (the cast is wrong, and the original code does exactly what you want it to do)? Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist