MISRAC++2023-5.7.2_a
In this section:
Synopsis
(Advisory) Sections of code should not be "commented out"
Enabled by default
No
Severity/Certainty
Low/Medium

Full description
Commented-out code has been detected. (To allow comments to contain pseudo-code or code samples, only comments that end in ;, {, or } characters are considered to be commented-out code.) This check is identical to MISRAC++2008-2-7-2.
Coding standards
- MISRA C++ 2008 2-7-2
(Required) Sections of code shall not be "commented out" using C-style comments.
Code examples
The following code example fails the check and will give a warning:
void example(void) {
/*
int i;
*/
}
The following code example passes the check and will not give a warning about this issue:
void example(void) {
#if 0
int i;
#endif
}