This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why does data type conversion not raise an error?

Hi, I have this code:

void main(void)
{ data unsigned char a = 0; data unsigned char b = 0; data unsigned int c = 1000;

b = c;

while(1) { a+= 1; }
}

And it compiles with no errors or warnings. Why is this? Why does it not raise an error because the 16-bit value c is being stored in the 8-bit value b? The Intpromote is turned off, so that is not it.

Yours, confused.

Robbie Martin.

Parents Reply Children
No data