提交 8e655da0 编写于 作者: D Dr. David von Oheimb

check-format.pl: Extend exceptions for no SPC after trailing ';' in 'for (...;)'

Reviewed-by: NPaul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13019)
上级 df4ec392
......@@ -29,6 +29,13 @@ int f(void) /*
/* entire-line comment may have same indent as normal code */
}
for (;;)
;
for (i = 0;;)
;
for (i = 0; i < 1;)
;
#if X
if (1) /* bad style: just part of control structure depends on #if */
#else
......
......@@ -658,7 +658,8 @@ while (<>) { # loop over all lines of all input files
# treat remaining blinded comments and string literal contents as (single) space during matching below
$intra_line =~ s/@+/ /g; # note that double SPC has already been handled above
$intra_line =~ s/\s+$//; # strip any (resulting) space at EOL
$intra_line =~ s/(for\s*\();;(\))/"$1$2"/eg; # strip ';;' in for (;;)
$intra_line =~ s/(for\s*\([^;]*);;(\))/"$1$2"/eg; # strip trailing ';;' in for (;;)
$intra_line =~ s/(for\s*\([^;]+;[^;]+);(\))/"$1$2"/eg; # strip trailing ';' in for (;;)
$intra_line =~ s/(=\s*)\{ /"$1@ "/eg; # do not report {SPC in initializers such as ' = { 0, };'
$intra_line =~ s/, \};/, @;/g; # do not report SPC} in initializers such as ' = { 0, };'
report("SPC before '$1'") if $intra_line =~ m/[\w)\]]\s+(\+\+|--)/; # postfix ++/-- with preceding space
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册