Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.
"Comments shall not be nested." Custom Rule in Static Analysis
Hi,
I have to add this rule to perform a static analysis.
The rule is the MISRA C RULE 9.
"Comments shall not be nested".
Can someone help me?
Thanks.
Tagged:
0
Comments
-
The rule is not listed.
0 -
Hi SLT,
there are already some existing rules in C/C++test, which check if there are nested comments in C/C++ code. Please, look in C/C++test at the rules like COMMENT-11, COMMENT-12, MISRA2004-2_3 or MISRA2012-RULE-3_1. They should help you.1 -
Unfortunately, I cannot find this rule in C/C++test. However, there is a similar rule MISRA2004-15_1 ('A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement').
2