Click on image to see enlargment
A florist is beginning to write a program to prepare lists of flowers. The names of the flowers are to be separated by a byte of all ones. But something is not working. To his amazement this test program is printing 'Huh?'. What's wrong?
bug693.cpp lint Output
--- Module: bug693.cpp (C++) _ const char * const eof = "\0xFF"; bug693.cpp(4) : Warning 693: Hexadecimal digit 'F' immediately after '\0x' is suspicious in string literal bug693.cpp(4) : Info 840: Use of nul character in a string literal
Reference Manual Explanation
693 Hexadecimal digit 'Char' immediately after 'String' is suspicious in string literal. -- A String was found that looks suspiciously like (but is not) a hexadecimal escape sequence; rather, it is a null character followed by letter "x" followed by some hexadecimal digit, e.g.: "\0x62" was found where the programmer probably meant to type "\x62". If you need precisely this sequence you can use: "\0" "x62" and this warning will not be issued.
If you have comments or questions about this bug, please post them to our Discussion Forum
Previous Bug - Bug #1572 - April 2009