18-10-2013, 03:49 PM
I'd made assumption, for no good reason, that your int size was 16 bits in which case Rule 10.5 wouldn't have been a problem because the LHS operand (ushort16)(EEPROM_BANK1[0]) would not be promoted.
I think you can avoid the second cast by ensuring that you do the operation using the unsigned int type instead of in ushort16, e.g.
[code]unsigned int tmp = 0;
tmp = (unsigned int)EEPROM_BANK1[1]) + ((unsigned int)EEPROM_BANK1[0]
I think you can avoid the second cast by ensuring that you do the operation using the unsigned int type instead of in ushort16, e.g.
[code]unsigned int tmp = 0;
tmp = (unsigned int)EEPROM_BANK1[1]) + ((unsigned int)EEPROM_BANK1[0]
<t></t>