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="30271e4359c7401a-e11c7f15-4ce84baf-ac51b4c0-f14cc40fa613e5c90a5faa96"><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;