...
Instead of using /* and */ to comment out blocks of code, use conditional compilation (for example, #if, #ifdef, or #ifndef).:
| Code Block | ||||
|---|---|---|---|---|
| ||||
#if 0 /* Use of critical security function no
* longer necessary */
security_critical_function();
/* Some other comment */
#endif
|
...
Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
GCC |
|
| Can detect violations of this rule when the | ||||||
| cmntdout_tokenuse | Fully implemented | |||||||
| 119 S | Partially implemented. |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...
| CERT C++ Secure Coding Standard | MSC04-CPP. Use comments consistently and in a readable fashion |
| MISRA - C:2012 | Rule 21.2 (advisory) |
Bibliography
...