...
All occurrences in a source file of the following sequences of three characters (that is, trigraph sequences) are replaced with the corresponding single character.
??=
#
??)
]
??!
|
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="42b090b4db9b7dd0-447d3c5b-48204924-9880a250-2d867a8a8298189ef4bfeba2"><ac:plain-text-body><![CDATA[
??(
[
??'
^
??>
}
]]></ac:plain-text-body></ac:structured-macro>
??/
\
??<
{
??-
~
...
The following compliant solution eliminates the accidental introduction of the trigraph.
Code Block | ||
---|---|---|
| ||
//* what is the value of a now */? a++; |
Non-Compliant Code Example
...
The above code will print out Over 9000!??!
, as intended.
Implementation Details
Some compilers provide options to warn when trigraphs are encountered, or to disable trigraph expansion. Use the warning options and ensure your code compiles cleanly (MSC00-A. Compile cleanly at high warning levels)
Risk Assessment
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
PRE07-A | 1 (low) | 1 (unlikely) | 2 (medium) | P2 | L3 |
...