AutosarC++18_10-A2.5.1¶
Trigraphs shall not be used
Required inputs: IR
Bad code (using trigraphs):
int arr??<10>; // ERROR: ??< is trigraph for [, ??> is trigraph for ]
// Array declaration unclear
if (x != 0)??! // ERROR: ??! is trigraph for |
Good code (using standard syntax):
int arr[10]; // OK: clear and unambiguous
if (x != 0) {
// ...
}
Trigraph summary:
??= alternative for #
??/ alternative for \
??' alternative for ^
??( alternative for [
??) alternative for ]
??! alternative for |
??< alternative for {
??> alternative for }
??- alternative for ~
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
trigraph_use |
Use of trigraph. |
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_in_comments¶
allow_in_comments : bool = True
Exception: a trigraph at the end of a line that might be interpreted as a line continuation is not allowed even if this option is enabled.