mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-31 22:11:53 -06:00
CHECKPATCH: Add warning for single else statement.
For an example:
WARNING: braces {} are necessary even for single statement blocks
+ } else
+ return env->regs[R_EAX];
total: 0 errors, 1 warnings, 41 lines checked
Signed-off-by: Don Slutz <Don@CloudSwitch.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
69402a6944
commit
dfe7053a34
1 changed files with 10 additions and 6 deletions
|
|
@ -2549,10 +2549,14 @@ sub process {
|
||||||
|
|
||||||
# Check the pre-context.
|
# Check the pre-context.
|
||||||
if (substr($line, 0, $-[0]) =~ /(\}\s*)$/) {
|
if (substr($line, 0, $-[0]) =~ /(\}\s*)$/) {
|
||||||
|
my $pre = $1;
|
||||||
|
|
||||||
|
if ($line !~ /else/) {
|
||||||
print "APW: ALLOWED: pre<$pre> line<$line>\n"
|
print "APW: ALLOWED: pre<$pre> line<$line>\n"
|
||||||
if $dbg_adv_apw;
|
if $dbg_adv_apw;
|
||||||
$allowed = 1;
|
$allowed = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
my ($level, $endln, @chunks) =
|
my ($level, $endln, @chunks) =
|
||||||
ctx_statement_full($linenr, $realcnt, $-[0]);
|
ctx_statement_full($linenr, $realcnt, $-[0]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue