diff options
Diffstat (limited to 'contrib/checkSpace.pl')
-rwxr-xr-x | contrib/checkSpace.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/checkSpace.pl b/contrib/checkSpace.pl index 686427f73d..fb0c9861bf 100755 --- a/contrib/checkSpace.pl +++ b/contrib/checkSpace.pl @@ -9,6 +9,7 @@ if ($ARGV[0] =~ /^-/) { for $fn (@ARGV) { open(F, "$fn"); $lastnil = 0; + $lastline = ""; $incomment = 0; while (<F>) { ## Warn about windows-style newlines. @@ -27,6 +28,11 @@ for $fn (@ARGV) { if ($C && /\s(?:if|while|for|switch)\(/) { print " KW(:$fn:$.\n"; } + ## Warn about #else #if instead of #elif. + if (($lastline =~ /^\# *else/) and ($_ =~ /^\# *if/)) { + print " #else#if:$fn:$.\n"; + } + $lastline = $_; ## Warn about multiple empty lines. if ($lastnil && /^$/) { print " DoubleNL:$fn:$.\n"; |