From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwwYa-0008G4-7T for qemu-devel@nongnu.org; Fri, 26 Aug 2011 09:34:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwwYZ-0000sm-7t for qemu-devel@nongnu.org; Fri, 26 Aug 2011 09:34:48 -0400 Received: from mail-bw0-f45.google.com ([209.85.214.45]:62242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwwYY-0000sh-UR for qemu-devel@nongnu.org; Fri, 26 Aug 2011 09:34:47 -0400 Received: by bkbzv3 with SMTP id zv3so2702928bkb.4 for ; Fri, 26 Aug 2011 06:34:45 -0700 (PDT) From: Pavel Borzenkov Date: Fri, 26 Aug 2011 17:34:37 +0400 Message-Id: <1314365677-10039-1-git-send-email-pavel.borzenkov@gmail.com> Subject: [Qemu-devel] [PATCH] checkpatch: fix braces {} handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org checkpatch.pl doesn't report warning for if/else statements with missing 'else' braces: if (something) { foo; } else bar; The patch has been tested using the last 100 commits. Signed-off-by: Pavel Borzenkov --- scripts/checkpatch.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 3498425..0eba357 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2532,7 +2532,7 @@ sub process { $allowed = 1; } } - if (!$seen) { + if ($seen != ($#chunks + 1)) { WARN("braces {} are necessary for all arms of this statement\n" . $herectx); } } -- 1.7.0.4