MISRAC2004-2.4
In this section:
Synopsis
(Advisory) Sections of code should not be commented out.
Enabled by default
No
Severity/Certainty
Low/Medium

Full description
Code sections in comments were found, where the comment ends in ;, {, or } characters. This check is identical to MISRAC2012-Dir-4.4.
Coding standards
- MISRA C:2004 2.4
(Advisory) Sections of code should not be commented out.
- MISRA C:2012 Dir-4.4
(Advisory) Sections of code should not be "commented out"
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
}