Synopsis: | Only ANSI defined escape sequences shall be used. |
Language: | C |
Severity Level: | 2 |
Category: | Lexical Elements |
Description: |
Justification Escape sequences (those beginning with \) other than those defined by the ANSI standard have undefined behavior, impacting both reliability and portability. Example char a = '\x'; /* WRONG */ char b = '\xfff'; /* WRONG */ char c = '\777'; /* WRONG */ char d[] = "\x"; /* WRONG */ char e[] = "\y"; /* WRONG */ char f = '\x; /* WRONG */ char g = '\8'; /* WRONG */ char h = '\n'; /* RIGHT */ |