AutosarC++18_03-A2.13.6¶
Universal character names shall be used only inside character or string literals
Required inputs: IR
| Level | required |
|---|---|
| Target | architecture / design / implementation |
| Enforcement | automated |
Rationale
Using universal-character-names to define a language identifier can be confusing for a developer and may be troublesome to use this identifier in the source code.
Example
//% $Id: A2-13-6.cpp 307578 2018-02-14 14:46:20Z michal.szczepankiewicz $
#include <string>
void F() {
const std::string c = "\U0001f34c"; // Compliant
}
// non-compliant
void \U0001f615() {
//
}Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
universal_character |
Use of universal character names |
None |
False |
Options¶
This rule shares the following common options: confidence, 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_in_comments¶
allow_in_comments : bool = False
allow_in_string_literals¶
allow_in_string_literals : bool = True