My BCD to decimal function generates a warning in XC8:
warning: implicit conversion loses integer precision: 'uint16_t' (aka 'unsigned short') to 'uint8_t' (aka 'unsigned char') [-Wimplicit-int-conversion]
Can I safely ignore this warning or change the code to eliminate the warning?
I don't understand where the uint16_t comes in.
warning: implicit conversion loses integer precision: 'uint16_t' (aka 'unsigned short') to 'uint8_t' (aka 'unsigned char') [-Wimplicit-int-conversion]
C:
uint8_t BCD2Decimal(uint8_t BCD)
{
uint8_t dec = ((BCD & 0xF0) >> 4) * 10 + (BCD & 0x0F);
return dec;
}
I don't understand where the uint16_t comes in.




