diff --git a/util/check-format-test-positives.c b/util/check-format-test-positives.c index 40077925ff..7d9bbea5c7 100644 --- a/util/check-format-test-positives.c +++ b/util/check-format-test-positives.c @@ -334,11 +334,11 @@ void f_looong_body() ; - ; /*@ 2 essentially empty lines before */ + ; /*@ 2 essentially empty lines before, if !sloppy-spc */ } /*@ function body length > 200 lines */ #if 0 /*@0 unclosed #if */ struct t { /*@0 unclosed brace at decl/block level */ enum { /*@0 unclosed brace at enum/expression level */ v = (1 /*@0 unclosed parenthesis */ - etyp /*@0 empty line follows just before EOF: */ + etyp /*@0 empty line follows just before EOF, if !sloppy-spc: */ diff --git a/util/check-format.pl b/util/check-format.pl index 2bbf7e7c54..0619240f82 100755 --- a/util/check-format.pl +++ b/util/check-format.pl @@ -1075,11 +1075,11 @@ while (<>) { # loop over all lines of all input files } if (m/^\s*$/) { # essentially empty line: just whitespace (and maybe a '\') - report("empty line at beginnig of file") if $line == 1; + report("empty line at beginnig of file") if $line == 1 && !$sloppy_SPC; } else { if ($line_before > 0) { my $linediff = $line - $line_before - 1; - report("$linediff empty lines before") if $linediff > 1; + report("$linediff empty lines before") if $linediff > 1 && !$sloppy_SPC; } $line_before2 = $line_before; $contents_before2 = $contents_before; @@ -1103,7 +1103,7 @@ while (<>) { # loop over all lines of all input files if (eof) { # check for essentially empty line (which may include a '\') just before EOF report(($1 eq "\n" ? "empty line" : $2 ne "" ? "'\\'" : "whitespace")." at EOF") - if $contents =~ m/^(\s*(\\?)\s*)$/; + if $contents =~ m/^(\s*(\\?)\s*)$/ && !$sloppy_SPC; # report unclosed expression-level nesting check_nested_nonblock_indents("expr at EOF"); # also adapts @nested_block_indents