C166: WARNING C192 (VALUE TRUNCATED)
Information in this article applies to:
With my C166 package, I sometimes receive the following message:
Warning C192: Value Truncated
The following example causes this warning:
unsigned char v; unsigned char s; v = (s & 0x0F) | ((s + 1) << 4) | 0x88;
The code still works. So, what does this warning mean and is it serious?
Warning C192 is issued because your statement generates a potential int value and the result gets truncated by the assignment to an unsigned char.
Avoid this warning with an explicit type cast like:
v = (unsigned char) ((s & 0x0F) | ((s + 1) << 4) | 0x88);
The following Discussion Forum threads may provide information related to this topic.
Last Reviewed: Wednesday, November 18, 2020
of your data.