AnsweredAssumed Answered

Preventing warning "Possible loss of data"?

Question asked by Mehmet Fide on Dec 30, 2006
Latest reply on Jan 2, 2007 by Daniel Lundin
Hi,
 
I'm new at CW and using MS9S08LC60. The compiler gives me "Possible loss of data" warning at the line below. How can I prevent the compiler to give this warning?
 
 
void ByteToBcd(char val, char* bcd)

 char tmp = val % 100; <- Warning C2705: Possible loss of data
 *bcd++ = (tmp / 10) + '0';
 *bcd = (tmp % 10) + '0'; 
}
 
Thank you.

Outcomes