MISRAC++2023-5.7.1
In this section:
Synopsis
(Required) The character sequence /* shall not be used within a C-style comment
Enabled by default
Yes
Severity/Certainty
Low/High

Full description
Detected /* inside comments This check is identical to COMMENT-nested, MISRAC++2008-2-7-1, MISRAC2004-2.3, MISRAC++2023-5.7.1.
Coding standards
- MISRA C:2004 2.3
(Required) The character sequence /* shall not be used within a comment.
- MISRA C++ 2008 2-7-1
(Required) The character sequence /* shall not be used within a C-style comment.
Code examples
The following code example fails the check and will give a warning:
void example(void) {
/* This comment starts here
/* Nested comment starts here
*/
}
The following code example passes the check and will not give a warning about this issue:
void example(void) {
/* This comment starts here */
/* Nested comment starts here
*/
}