Rule Definition
A comment beginning with /* continues until the first */ is encountered. Any /* occurring inside a comment is a violation of this rule.
If a comment starting sequence, /* or //, occurs within a /* comment, it is quite likely to be caused by a missing */ comment ending sequence.
If a comment starting sequence occurs within a // comment, it is probably because a region of code has been commented-out using //.
Remediation
Ensure to not use //, /* within comments
Violation Code Sample
/* some comment, end comment marker accidentally omitted
Perform_Critical_Safety_Function(X);
/* this "comment" is Non-compliant */
In reviewing the code containing the call to the function, the assumption is that it is executed code.
Because of the accidental omission of the end comment marker, the call to Perform_Critical_
Safety_Function will not be execute
Reference
MISRA C++ 2008, 2-7-1: The character sequence /* shall not be used within a C-style comment.
MISRA C:2012, 3.1 - The character sequences /* and // shall not be used within a comment
Related Technologies
Technical Criterion
Documentation - Bad Comments
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.