Qt-Autosar-A2.5.1

Trigraphs shall not be used

Required inputs: IR

Trigraphs are three-character sequences (??x) that represent operators on keyboards lacking certain symbols. They are legacy features created for obsolete terminal keyboards and are now considered dangerous and confusing. Trigraphs can be replaced unintentionally in comments and string literals, leading to subtle bugs. Modern tools and keyboards have no need for trigraphs.
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

allow_in_comments

allow_in_comments : bool = True

Allow the use of trigraphs in comments.

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.