mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 06:03:10 +00:00
tools: checkpatch.sh - Add warning that // style comments don't match
recommended (kernel) comment style Signed-off-by: Lou Berger <lberger@labn.net>
This commit is contained in:
parent
7a7a480dfe
commit
f1beb87ed1
@ -1249,11 +1249,6 @@ sub sanitise_line {
|
||||
$res =~ s@(\#\s*(?:error|warning)\s+).*@$1$clean@;
|
||||
}
|
||||
|
||||
if ($allow_c99_comments && $res =~ m@(//.*$)@) {
|
||||
my $match = $1;
|
||||
$res =~ s/\Q$match\E/"$;" x length($match)/e;
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -3612,6 +3607,7 @@ sub process {
|
||||
|
||||
# no C99 // comments
|
||||
if ($line =~ m{//}) {
|
||||
if (!$allow_c99_comments) {
|
||||
if(ERROR("C99_COMMENTS",
|
||||
"do not use C99 // comments\n" . $herecurr) &&
|
||||
$fix) {
|
||||
@ -3621,6 +3617,10 @@ sub process {
|
||||
$fixed[$fixlinenr] =~ s@\/\/(.*)$@/\* $comment \*/@;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
WARN("C99_COMMENTS",
|
||||
"C99 // comments do not match recommendation\n" . $herecurr);
|
||||
}
|
||||
}
|
||||
# Remove C99 comments.
|
||||
$line =~ s@//.*@@;
|
||||
|
Loading…
Reference in New Issue
Block a user