We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Why does the following code produce a C192: '=': value truncated error? They are all uint8_t's. Structure definition shown below. What is there to truncate, all variables are of the exact same type! The result is correct but I am just interested in why.
msg.DataBuffer[7] = msg.DataBuffer[0] ^ msg.DataBuffer[1] ^ msg.DataBuffer[6];
typedef struct { uint16_t CANID; uint8_t DataBuffer[8]; uint8_t DataSize; } CAN_MESSAGE;
integer promotion?
You seem to be expressing a doubt. Why?
... it should be a 'warning' only.
Probably the OP misreported the message.
http://www.keil.com/support/docs/2569.htm
It seems that Keil also mis-documented it:
http://www.keil.com/support/man/docs/c166/c166_c192.htm