Hi to all recently i noticed a strange behavior debugging a a simple code that i wrote in C for the Mitsubishi-Renesas microcontroller M16C:
void Function_multiply(void) { unsigned char term1,term2,result; term1=6; term2=8;
result= term1 * term2; } I expect that result=48 ,with no loss of data,being the 2 terms small numbers
instead i have result=6 ,same with other small numers
To have result=48 i need to declare the local variable as unsigned int.
I dont think that i s a real bug,but i find strange that some option in the compiler could generate this unexpecyed situation
Thanks you for your attention Have a nice weekend
Diego,Milan Italy