]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
checkSpace: be more careful about bad function headers.
authorNick Mathewson <nickm@torproject.org>
Fri, 10 Jan 2020 20:32:34 +0000 (15:32 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 6 Feb 2020 19:54:04 +0000 (14:54 -0500)
Previously we would forbid macro indentations like this:

FOO({
  int x;
  })

But clang-format sometimes generates those.

scripts/maint/checkSpace.pl

index bf1c69e00aa77bd378086a0270e44494e74571d8..27615f910cc0e00af8661694450d011e48f2b8bc 100755 (executable)
@@ -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_]+\(/) {