MISRA.TOKEN.WRONGESCIncorrect escape sequence in a literal. MISRA-C Rule 4.1 (required): Only those escape sequences that are defined in the ISO C standard shall be used.[Undefined 11; Implementation 11] Only "simple-escape-sequences" in ISO/IEC 9899:1990 [3—6] Section 6.1.3.4 and '\0' are permitted escape sequences. All "hexadecimal-escape-sequences" are prohibited. The "octal-escape-sequences" other than '\0' are also prohibited under Rule 7.1. MISRA-C++ Rule 2-13-1 (required): Only those escape sequences that are defined in ISO/IEC 14882:2003 shall be used.[Undefined 2.13.2(3)] RationaleThe use of an undefined escape sequence leads to undefined behaviour. The defined escape sequences (ISO/IEC 14882:2003 [1] §2.13.2) are: \n, \t, \v, \b, \r, \f, \a, \\, \?, \', \", \<Octal Number>, \x<Hexadecimal Number> Examplevoid fn ( ) { const char_t a[ 2 ] = "\k"; // Non-compliant const char_t b[ 2 ] = "\b"; // Compliant } |