|ARM Technical Support Knowledge Articles|
Applies to: C166 C Compiler
Information in this article applies to:
I have just upgraded my C166 package. With this new version 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 has been recently introduced into the C166 compiler. It is issued because your statement generates a potential int value and the result gets truncated by the assignment to an unsigned char.
You can avoid this warning with an explicit type cast like:
v = (unsigned char) ((s & 0x0F) | ((s + 1) << 4) | 0x88);
Article last edited on: 2004-04-24 12:18:25
Did you find this article helpful? Yes No
How can we improve this article?