>>> is capable of overflowing an 8 bit word, then at least bat needs to be >>> int for safety. >>> >> >> Right, except if bat is a checksum and it's an unsigned char because you >> designed it that way :( >> > if in doubt... > in all languages and projects > If it's not the same type cast or explicitly convert. letting the > compiler do it and making assumptions will bite you eventually. What if > you use a different compiler or want to translate to another language. > If your compiler has a "warnings" feature for automatic promotion or > truncation turn it on. Exactly - if bat really is a checksum, then surely the code should be showing an &0xFF somewhere on the RHS ... at least as part of documentation ... -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist