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.
This is why Keil pushes PC-Lint on their website:
http://www.keil.com/pclint/
Keil has pre-made PC-Lint configuration files for all of their compilers.
This 'what if' case is a perfect role for code analysis software, not a compiler.