checkSpace: be more careful about bad function headers.

Previously we would forbid macro indentations like this:

FOO({
  int x;
  })

But clang-format sometimes generates those.
This commit is contained in:
Nick Mathewson 2020-01-10 15:32:34 -05:00
parent 99a5aecbc7
commit f39ba52029

View File

@ -208,7 +208,7 @@ for my $fn (@ARGV) {
($fn !~ /\.h$/ && /^[a-zA-Z0-9_]/ && ($fn !~ /\.h$/ && /^[a-zA-Z0-9_]/ &&
! /^(?:const |static )*(?:typedef|struct|union)[^\(]*$/ && ! /^(?:const |static )*(?:typedef|struct|union)[^\(]*$/ &&
! /= *\{$/ && ! /;$/) && ! /^[a-zA-Z0-9_]+\s*:/) { ! /= *\{$/ && ! /;$/) && ! /^[a-zA-Z0-9_]+\s*:/) {
if (/.\{$/){ if (/[^,\s]\s*\{$/){
msg "fn() {:$fn:$.\n"; msg "fn() {:$fn:$.\n";
$in_func_head = 0; $in_func_head = 0;
} elsif (/^\S[^\(]* +\**[a-zA-Z0-9_]+\(/) { } elsif (/^\S[^\(]* +\**[a-zA-Z0-9_]+\(/) {