You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Non-Compliant Example

Do not use the character sequence /* within a comment:

/* comment with end comment marker unintentionally ommitted
...
security_critical_function();
/* some other comment */

In this example, the call to the security critical function is not executed. It is possible that, in reviewing this page, a reviewer may assume that the code is executed.

In cases where this is the result of an accidental ommision, it is useful to use an editor that provides syntax highlighting or formats the code to help identify issues like missing end comment deliminators.

Because missing end deliminators is error prone and often viewed as a mistake, it is recommended that this approach not be used to comment out code.

Compliant Example

References

  • No labels