Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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="9a1a7ca44c103866-8fa8597d-45464405-9b138028-e0c06f21db78330989200a03"><ac:plain-text-body><![CDATA[

??(

[

 

??'

^

 

??>

}

]]></ac:plain-text-body></ac:structured-macro>

??/

\

 

??<

{

 

??-

~

...

Code Block
bgColor#ffcccc
size_t i = /* some initial value */;
if (i >&gt; 9000) {
   if (puts("&quot;Over 9000!??!"&quot;) == EOF) {
     /* Handle Error */
   }
}

...

Code Block
bgColorccccff
size_t i = /* some initial value */;
/* assignment of i */
if (i >&gt; 9000) {
   if (puts("&quot;Over 9000!?""&quot;&quot;?!"&quot;) == EOF) {
     /* Handle Error */
   }
}

...

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Other Languages

This rule appears in the C++ Secure Coding Standard as PRE07-CPP. Avoid using repeated question marks.

References

Wiki Markup
\[[ISO/IEC 9899:1999|AA. C References#ISO/IEC 9899-1999]\] Section 5.2.1.1, "&quot;Trigraph sequences"&quot;
\[[MISRA 04|AA. C References#MISRA 04]\] Rule 4.2

...

PRE06-C. Enclose header files in an inclusion guard      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;01. Preprocessor (PRE)       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;