Compiler Warning (level 1) C4139

'hexnumber' : hex escape sequence is out of range

A hexadecimal escape sequence appearing in a character or string constant was too large to be converted to a character.

If the hexadecimal escape sequence is in a string constant, the compiler casts the low byte of the hexadecimal number to a char. If in a char constant, the compiler made the cast and then sign extended the result. If in a char constant and the program was compiled with the /J command-line option, the compiler cast the value to an unsigned char.

Note that the following code generates this warning:

printf("\x7Bell\n");

The compiler reads the characters "7Be" as a legal hexadecimal number, but it is too large to fit in a character. To correct this example, use three hexadecimal digits:

printf("\007Bell\n");