| ||||||||
Technical Support Support Resources Product Information | C166: WARNING C192 (VALUE TRUNCATED)Information in this article applies to:
QUESTIONI 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? ANSWERWarning 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); SEE ALSOLast Reviewed: Saturday, April 24, 2004 | |||||||
| ||||||||