#This script is designed to run with Understand - CodeCheck use base qw(Understand::Codecheck); use strict; use constant ERR1 => 'Nested Comment: /* found inside C-style comment'; sub register_tr_text { my $check = shift; $check->add_tr_text(ERR1); } sub name { 'Nested Comments' } sub description { 'The character sequence /* shall not be used within a C-style comment.' } sub detailed_description { <<'END_DESC'
Rationale
Nested C-Style comments (/*) can lead to runaway comments and is not supported by the C or C++ standard even though some compilers support this as a non-portable language extension. A comment beginning with /* continues until the first */ is encountered. Any /* occurring inside a comment is a violation of this rule.