AutosarC++18_10-A2.13.1¶
Only those escape sequences that are defined in ISO/IEC 14882:2014 shall be used
Required inputs: IR
Bad code (non-standard escape sequences):
const char* str = "Hello\eWorld"; // ERROR: \e not standard (compiler-dependent) const char* invalid = "Path\n\q"; // ERROR: \q is not standard escape
Good code (standard escape sequences):
const char* str = "Hello\n"; // OK: standard newline const char* tab = "Col1\tCol2"; // OK: standard tab const char* quote = "Say \"Hi\""; // OK: standard quote escape
Standard escape sequences:
\\ backslash \' single quote \" double quote \? question mark \a alert (bell) \b backspace \f form feed \n newline \r carriage return \t horizontal tab \v vertical tab \nnn octal (up to 3 digits) \xhh hexadecimal (any number of digits) \uxxxx unicode (exactly 4 hex digits, C++11) \Uxxxxxxxx unicode (exactly 8 hex digits, C++11)
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
nonstandard_escape_sequence |
Use of non-standard escape sequence. |
None |
False |
Options¶
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
allow_delimited_escape_sequences¶
allow_delimited_escape_sequences : bool = False
allowed¶
allowed : str = ''"?\abfnrtv'