commit f39ba52029c946304cc5a67fa93ca9aab10b2941 Author: Nick Mathewson nickm@torproject.org Date: Fri Jan 10 15:32:34 2020 -0500
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. --- scripts/maint/checkSpace.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/maint/checkSpace.pl b/scripts/maint/checkSpace.pl index bf1c69e00..27615f910 100755 --- a/scripts/maint/checkSpace.pl +++ b/scripts/maint/checkSpace.pl @@ -208,7 +208,7 @@ for my $fn (@ARGV) { ($fn !~ /.h$/ && /^[a-zA-Z0-9_]/ && ! /^(?:const |static )*(?:typedef|struct|union)[^(]*$/ && ! /= *{$/ && ! /;$/) && ! /^[a-zA-Z0-9_]+\s*:/) { - if (/.{$/){ + if (/[^,\s]\s*{$/){ msg "fn() {:$fn:$.\n"; $in_func_head = 0; } elsif (/^\S[^(]* +**[a-zA-Z0-9_]+(/) {